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
62033660
Commit
62033660
authored
Dec 10, 2022
by
longpanda
Browse files
grub2 mode support KNOPPIX
parent
a5c6859f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
29 deletions
+36
-29
GRUB2/MOD_SRC/grub-2.04/grub-core/lib/syslinux_parse.c
GRUB2/MOD_SRC/grub-2.04/grub-core/lib/syslinux_parse.c
+2
-1
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h
+13
-0
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_linux.c
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_linux.c
+7
-28
INSTALL/grub/grub.cfg
INSTALL/grub/grub.cfg
+14
-0
No files found.
GRUB2/MOD_SRC/grub-2.04/grub-core/lib/syslinux_parse.c
View file @
62033660
...
@@ -362,7 +362,8 @@ static grub_err_t
...
@@ -362,7 +362,8 @@ static grub_err_t
cmd_append
(
const
char
*
line
,
struct
syslinux_menu
*
menu
)
cmd_append
(
const
char
*
line
,
struct
syslinux_menu
*
menu
)
{
{
if
(
!
menu
->
entries
)
if
(
!
menu
->
entries
)
return
grub_error
(
GRUB_ERR_BAD_ARGUMENT
,
"kernel without label"
);
return
GRUB_ERR_NONE
;
//return grub_error (GRUB_ERR_BAD_ARGUMENT, "kernel without label");
menu
->
entries
->
append
=
grub_strdup
(
line
);
menu
->
entries
->
append
=
grub_strdup
(
line
);
if
(
!
menu
->
entries
->
append
)
if
(
!
menu
->
entries
->
append
)
...
...
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h
View file @
62033660
...
@@ -99,6 +99,19 @@
...
@@ -99,6 +99,19 @@
}\
}\
}
}
#define VTOY_SKIP_SPACE(s) \
while (ventoy_isspace(*s)) \
{\
s++;\
}
#define VTOY_SKIP_SPACE_NEXT(s, initial) \
s += initial;\
while (ventoy_isspace(*s)) \
{\
s++;\
}
typedef
enum
VTOY_FILE_FLT
typedef
enum
VTOY_FILE_FLT
{
{
VTOY_FILE_FLT_ISO
=
0
,
/* .iso */
VTOY_FILE_FLT_ISO
=
0
,
/* .iso */
...
...
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_linux.c
View file @
62033660
...
@@ -177,10 +177,7 @@ static grub_err_t ventoy_isolinux_initrd_collect(grub_file_t file, const char *p
...
@@ -177,10 +177,7 @@ static grub_err_t ventoy_isolinux_initrd_collect(grub_file_t file, const char *p
{
{
nextline
=
ventoy_get_line
(
start
);
nextline
=
ventoy_get_line
(
start
);
while
(
ventoy_isspace
(
*
start
))
VTOY_SKIP_SPACE
(
start
);
{
start
++
;
}
offset
=
7
;
// strlen("initrd=") or "INITRD " or "initrd "
offset
=
7
;
// strlen("initrd=") or "INITRD " or "initrd "
pos
=
grub_strstr
(
start
,
"initrd="
);
pos
=
grub_strstr
(
start
,
"initrd="
);
...
@@ -438,10 +435,7 @@ static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName)
...
@@ -438,10 +435,7 @@ static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName)
{
{
nextline
=
ventoy_get_line
(
start
);
nextline
=
ventoy_get_line
(
start
);
while
(
ventoy_isspace
(
*
start
))
VTOY_SKIP_SPACE
(
start
);
{
start
++
;
}
if
(
grub_strncmp
(
start
,
"initrd"
,
6
)
!=
0
)
if
(
grub_strncmp
(
start
,
"initrd"
,
6
)
!=
0
)
{
{
...
@@ -454,10 +448,7 @@ static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName)
...
@@ -454,10 +448,7 @@ static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName)
start
++
;
start
++
;
}
}
while
(
ventoy_isspace
(
*
start
))
VTOY_SKIP_SPACE
(
start
);
{
start
++
;
}
if
(
*
start
==
'"'
)
if
(
*
start
==
'"'
)
{
{
...
@@ -528,10 +519,7 @@ static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName)
...
@@ -528,10 +519,7 @@ static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName)
if
(
*
start
==
' '
||
*
start
==
'\t'
)
if
(
*
start
==
' '
||
*
start
==
'\t'
)
{
{
while
(
ventoy_isspace
(
*
start
))
VTOY_SKIP_SPACE
(
start
);
{
start
++
;
}
}
}
else
else
{
{
...
@@ -1813,18 +1801,12 @@ static char *ventoy_systemd_conf_tag(char *buf, const char *tag, int optional)
...
@@ -1813,18 +1801,12 @@ static char *ventoy_systemd_conf_tag(char *buf, const char *tag, int optional)
for
(
start
=
buf
;
start
;
start
=
nextline
)
for
(
start
=
buf
;
start
;
start
=
nextline
)
{
{
nextline
=
ventoy_get_line
(
start
);
nextline
=
ventoy_get_line
(
start
);
while
(
ventoy_isspace
(
*
start
))
VTOY_SKIP_SPACE
(
start
);
{
start
++
;
}
if
(
grub_strncmp
(
start
,
tag
,
taglen
)
==
0
&&
(
start
[
taglen
]
==
' '
||
start
[
taglen
]
==
'\t'
))
if
(
grub_strncmp
(
start
,
tag
,
taglen
)
==
0
&&
(
start
[
taglen
]
==
' '
||
start
[
taglen
]
==
'\t'
))
{
{
start
+=
taglen
;
start
+=
taglen
;
while
(
ventoy_isspace
(
*
start
))
VTOY_SKIP_SPACE
(
start
);
{
start
++
;
}
return
start
;
return
start
;
}
}
}
}
...
@@ -2038,10 +2020,7 @@ grub_err_t ventoy_cmd_linux_limine_menu(grub_extcmd_context_t ctxt, int argc, ch
...
@@ -2038,10 +2020,7 @@ grub_err_t ventoy_cmd_linux_limine_menu(grub_extcmd_context_t ctxt, int argc, ch
for
(
start
=
filebuf
;
start
;
start
=
nextline
)
for
(
start
=
filebuf
;
start
;
start
=
nextline
)
{
{
nextline
=
ventoy_get_line
(
start
);
nextline
=
ventoy_get_line
(
start
);
while
(
ventoy_isspace
(
*
start
))
VTOY_SKIP_SPACE
(
start
);
{
start
++
;
}
if
(
start
[
0
]
==
':'
)
if
(
start
[
0
]
==
':'
)
{
{
...
...
INSTALL/grub/grub.cfg
View file @
62033660
...
@@ -853,6 +853,13 @@ function uefi_linux_menu_func {
...
@@ -853,6 +853,13 @@ function uefi_linux_menu_func {
fi
fi
fi
fi
if [ $vtback_cfg_find -eq 0 ]; then
if [ -f (loop)/boot/isolinux/syslnx64.cfg ]; then
syslinux_configfile (loop)/boot/isolinux/syslnx64.cfg
set vtback_cfg_find=1
fi
fi
if [ "$vtback_cfg_find" = "0" ]; then
if [ "$vtback_cfg_find" = "0" ]; then
echo " "
echo " "
echo "No bootfile found for UEFI!"
echo "No bootfile found for UEFI!"
...
@@ -1320,6 +1327,13 @@ function legacy_linux_menu_func {
...
@@ -1320,6 +1327,13 @@ function legacy_linux_menu_func {
fi
fi
fi
fi
if [ $vtback_cfg_find -eq 0 ]; then
if [ -f (loop)/boot/isolinux/syslnx64.cfg ]; then
syslinux_configfile (loop)/boot/isolinux/syslnx64.cfg
set vtback_cfg_find=1
fi
fi
vt_unset_boot_opt
vt_unset_boot_opt
set root=$vtback_root
set root=$vtback_root
set theme=$vtback_theme
set theme=$vtback_theme
...
...
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