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
7f2f845a
"vscode:/vscode.git/clone" did not exist on "47c09972275555238d4c79a085dca04cb5e66a8f"
Commit
7f2f845a
authored
May 31, 2022
by
longpanda
Browse files
Auto use memdisk mode when booting iKuai OS.
parent
2cd22da8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
5 deletions
+32
-5
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c
+22
-2
INSTALL/grub/grub.cfg
INSTALL/grub/grub.cfg
+10
-3
No files found.
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c
View file @
7f2f845a
...
@@ -2612,24 +2612,38 @@ static grub_err_t ventoy_cmd_chosen_img_path(grub_extcmd_context_t ctxt, int arg
...
@@ -2612,24 +2612,38 @@ static grub_err_t ventoy_cmd_chosen_img_path(grub_extcmd_context_t ctxt, int arg
{
{
char
value
[
32
];
char
value
[
32
];
char
*
pos
=
NULL
;
char
*
pos
=
NULL
;
char
*
last
=
NULL
;
const
char
*
id
=
NULL
;
const
char
*
id
=
NULL
;
img_info
*
cur
=
NULL
;
img_info
*
cur
=
NULL
;
(
void
)
ctxt
;
(
void
)
ctxt
;
if
(
argc
<
1
||
argc
>
2
)
if
(
argc
<
1
||
argc
>
3
)
{
{
return
grub_error
(
GRUB_ERR_BAD_ARGUMENT
,
"Usage: %s {var}"
,
cmd_raw_name
);
return
grub_error
(
GRUB_ERR_BAD_ARGUMENT
,
"Usage: %s {var}"
,
cmd_raw_name
);
}
}
if
(
g_fake_vlnk_src
[
0
]
&&
g_fake_vlnk_dst
[
0
])
if
(
g_fake_vlnk_src
[
0
]
&&
g_fake_vlnk_dst
[
0
])
{
{
grub_env_set
(
args
[
0
],
grub_strchr
(
g_fake_vlnk_src
,
'/'
));
pos
=
grub_strchr
(
g_fake_vlnk_src
,
'/'
);
grub_env_set
(
args
[
0
],
pos
);
if
(
argc
>
1
)
if
(
argc
>
1
)
{
{
grub_snprintf
(
value
,
sizeof
(
value
),
"%llu"
,
(
ulonglong
)(
g_fake_vlnk_size
));
grub_snprintf
(
value
,
sizeof
(
value
),
"%llu"
,
(
ulonglong
)(
g_fake_vlnk_size
));
grub_env_set
(
args
[
1
],
value
);
grub_env_set
(
args
[
1
],
value
);
}
}
if
(
argc
>
2
)
{
for
(
last
=
pos
;
*
pos
;
pos
++
)
{
if
(
*
pos
==
'/'
)
{
last
=
pos
;
}
}
grub_env_set
(
args
[
2
],
last
+
1
);
}
goto
end
;
goto
end
;
}
}
...
@@ -2658,6 +2672,12 @@ static grub_err_t ventoy_cmd_chosen_img_path(grub_extcmd_context_t ctxt, int arg
...
@@ -2658,6 +2672,12 @@ static grub_err_t ventoy_cmd_chosen_img_path(grub_extcmd_context_t ctxt, int arg
grub_snprintf
(
value
,
sizeof
(
value
),
"%llu"
,
(
ulonglong
)(
cur
->
size
));
grub_snprintf
(
value
,
sizeof
(
value
),
"%llu"
,
(
ulonglong
)(
cur
->
size
));
grub_env_set
(
args
[
1
],
value
);
grub_env_set
(
args
[
1
],
value
);
}
}
if
(
argc
>
2
)
{
grub_snprintf
(
value
,
sizeof
(
value
),
"%llu"
,
(
ulonglong
)(
cur
->
size
));
grub_env_set
(
args
[
2
],
cur
->
name
);
}
end:
end:
g_svd_replace_offset
=
0
;
g_svd_replace_offset
=
0
;
...
...
INSTALL/grub/grub.cfg
View file @
7f2f845a
...
@@ -1301,7 +1301,7 @@ function iso_common_menuentry {
...
@@ -1301,7 +1301,7 @@ function iso_common_menuentry {
unset vt_system_id
unset vt_system_id
unset vt_volume_id
unset vt_volume_id
vt_chosen_img_path vt_chosen_path vt_chosen_size
vt_chosen_img_path vt_chosen_path vt_chosen_size
vt_chosen_name
vt_parse_iso_volume "${vtoy_iso_part}${vt_chosen_path}" vt_system_id vt_volume_id vt_volume_space
vt_parse_iso_volume "${vtoy_iso_part}${vt_chosen_path}" vt_system_id vt_volume_id vt_volume_space
if [ $vt_volume_space -ne $vt_chosen_size ]; then
if [ $vt_volume_space -ne $vt_chosen_size ]; then
...
@@ -1349,10 +1349,17 @@ function iso_common_menuentry {
...
@@ -1349,10 +1349,17 @@ function iso_common_menuentry {
elif vt_iso_vd_id_begin 0 1 "KolibriOS"; then
elif vt_iso_vd_id_begin 0 1 "KolibriOS"; then
set vtMemDiskBoot=1
set vtMemDiskBoot=1
fi
fi
fi
fi
#For iKuai8 (<64MB)
if [ $vt_chosen_size -le 67108864 ]; then
if vt_str_begin "$vt_chosen_name" "iKuai"; then
set vtMemDiskBoot=1
fi
fi
fi
fi
vt_iso_vd_id_clear
vt_iso_vd_id_clear
if [ "$grub_platform" = "pc" ]; then
if [ "$grub_platform" = "pc" ]; then
if [ -n "$vtMemDiskBoot" ]; then
if [ -n "$vtMemDiskBoot" ]; then
...
...
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