Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dadigang
Ventoy
Commits
e252fab9
Commit
e252fab9
authored
Apr 12, 2021
by
longpanda
Browse files
boot iso file with ventoy in ventoy_grub.cfg
parent
37212a8e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy.c
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy.c
+39
-0
No files found.
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy.c
View file @
e252fab9
...
@@ -2229,6 +2229,42 @@ static grub_err_t ventoy_cmd_img_name(grub_extcmd_context_t ctxt, int argc, char
...
@@ -2229,6 +2229,42 @@ static grub_err_t ventoy_cmd_img_name(grub_extcmd_context_t ctxt, int argc, char
VENTOY_CMD_RETURN
(
GRUB_ERR_NONE
);
VENTOY_CMD_RETURN
(
GRUB_ERR_NONE
);
}
}
static
grub_err_t
ventoy_cmd_ext_select_img_path
(
grub_extcmd_context_t
ctxt
,
int
argc
,
char
**
args
)
{
int
len
=
0
;
char
id
[
32
]
=
{
0
};
img_info
*
cur
=
g_ventoy_img_list
;
(
void
)
ctxt
;
if
(
argc
!=
1
)
{
return
grub_error
(
GRUB_ERR_BAD_ARGUMENT
,
"Usage: %s {var}"
,
cmd_raw_name
);
}
len
=
(
int
)
grub_strlen
(
args
[
0
]);
while
(
cur
)
{
if
(
len
==
cur
->
pathlen
&&
0
==
grub_strcmp
(
args
[
0
],
cur
->
path
))
{
break
;
}
cur
=
cur
->
next
;
}
if
(
!
cur
)
{
return
grub_error
(
GRUB_ERR_BAD_ARGUMENT
,
"No such image"
);
}
grub_snprintf
(
id
,
sizeof
(
id
),
"VID_%d"
,
cur
->
id
);
grub_env_set
(
"chosen"
,
id
);
grub_env_export
(
"chosen"
);
VENTOY_CMD_RETURN
(
GRUB_ERR_NONE
);
}
static
grub_err_t
ventoy_cmd_chosen_img_path
(
grub_extcmd_context_t
ctxt
,
int
argc
,
char
**
args
)
static
grub_err_t
ventoy_cmd_chosen_img_path
(
grub_extcmd_context_t
ctxt
,
int
argc
,
char
**
args
)
{
{
int
img_id
=
0
;
int
img_id
=
0
;
...
@@ -4255,6 +4291,8 @@ static int ventoy_env_init(void)
...
@@ -4255,6 +4291,8 @@ static int ventoy_env_init(void)
grub_snprintf
(
buf
,
sizeof
(
buf
),
"%p"
,
g_grub_param
);
grub_snprintf
(
buf
,
sizeof
(
buf
),
"%p"
,
g_grub_param
);
grub_env_set
(
"env_param"
,
buf
);
grub_env_set
(
"env_param"
,
buf
);
grub_env_set
(
"ventoy_env_param"
,
buf
);
grub_env_set
(
"ventoy_env_param"
,
buf
);
grub_env_export
(
"env_param"
);
grub_env_export
(
"ventoy_env_param"
);
grub_env_export
(
"ventoy_env_param"
);
}
}
...
@@ -4277,6 +4315,7 @@ static cmd_para ventoy_cmds[] =
...
@@ -4277,6 +4315,7 @@ static cmd_para ventoy_cmds[] =
{
"vt_clear_img"
,
ventoy_cmd_clear_img
,
0
,
NULL
,
""
,
"clear image list"
,
NULL
},
{
"vt_clear_img"
,
ventoy_cmd_clear_img
,
0
,
NULL
,
""
,
"clear image list"
,
NULL
},
{
"vt_img_name"
,
ventoy_cmd_img_name
,
0
,
NULL
,
"{imageID} {var}"
,
"get image name"
,
NULL
},
{
"vt_img_name"
,
ventoy_cmd_img_name
,
0
,
NULL
,
"{imageID} {var}"
,
"get image name"
,
NULL
},
{
"vt_chosen_img_path"
,
ventoy_cmd_chosen_img_path
,
0
,
NULL
,
"{var}"
,
"get chosen img path"
,
NULL
},
{
"vt_chosen_img_path"
,
ventoy_cmd_chosen_img_path
,
0
,
NULL
,
"{var}"
,
"get chosen img path"
,
NULL
},
{
"vt_ext_select_img_path"
,
ventoy_cmd_ext_select_img_path
,
0
,
NULL
,
"{var}"
,
"select chosen img path"
,
NULL
},
{
"vt_img_sector"
,
ventoy_cmd_img_sector
,
0
,
NULL
,
"{imageName}"
,
""
,
NULL
},
{
"vt_img_sector"
,
ventoy_cmd_img_sector
,
0
,
NULL
,
"{imageName}"
,
""
,
NULL
},
{
"vt_dump_img_sector"
,
ventoy_cmd_dump_img_sector
,
0
,
NULL
,
""
,
""
,
NULL
},
{
"vt_dump_img_sector"
,
ventoy_cmd_dump_img_sector
,
0
,
NULL
,
""
,
""
,
NULL
},
{
"vt_load_wimboot"
,
ventoy_cmd_load_wimboot
,
0
,
NULL
,
""
,
""
,
NULL
},
{
"vt_load_wimboot"
,
ventoy_cmd_load_wimboot
,
0
,
NULL
,
""
,
""
,
NULL
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment