Skip to content

Commit

Permalink
grub: retitle grml boot menu entries
Browse files Browse the repository at this point in the history
The default menu entry now just reads "<grml-name> <version>", so for
example "grml-small-arm64 2024.12". The additional options are in a
menu entry just titled " -> Options".

To allow for removing the name/version for the options menu, grub.cfg
now sorts the %SHORTNAME%_options.cfg always directly after the
%SHORTNAME%_default.cfg.

Use unicode.pf2 to allow for Unicode characters in the Options and
Addons menu entries.

# Conflicts:
#	grml-live
  • Loading branch information
zeha committed Nov 26, 2024
1 parent 136531d commit d2927fb
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 9 deletions.
3 changes: 1 addition & 2 deletions grml-live
Original file line number Diff line number Diff line change
Expand Up @@ -1306,8 +1306,7 @@ if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] || [ "$ARCH" = arm64 ] ; then
fi

# arch independent files
cp -a "${CHROOT_OUTPUT}"/usr/share/grub/ascii.pf2 "${BUILD_OUTPUT}"/boot/grub/
cp -a "${CHROOT_OUTPUT}"/usr/share/grub/unicode.pf2 "${BUILD_OUTPUT}"/boot/grub/ # clarify
cp -a "${CHROOT_OUTPUT}"/usr/share/grub/unicode.pf2 "${BUILD_OUTPUT}"/boot/grub/

if ! [ -d "${TEMPLATE_DIRECTORY}"/GRML ] ; then
log "Error: ${TEMPLATE_DIRECTORY}/GRML does not exist. Exiting."
Expand Down
2 changes: 1 addition & 1 deletion templates/boot/grub/%SHORT_NAME%_default.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
menuentry "%GRML_NAME% - release %VERSION% (default)" {
menuentry "%GRML_NAME% %VERSION%" {
set gfxpayload=keep
echo 'Loading kernel...'
linux /boot/%SHORT_NAME%/vmlinuz apm=power-off boot=live live-media-path=/live/%GRML_NAME%/ bootid=%BOOTID% "${loopback}" ${kernelopts} nomce net.ifnames=0
Expand Down
2 changes: 1 addition & 1 deletion templates/boot/grub/%SHORT_NAME%_options.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
submenu "%GRML_NAME% - advanced options ->" --class=submenu {
submenu " ⇢ Options" --class=submenu {
menuentry "Enable Predictable Network Interface Names" {
set gfxpayload=keep
echo 'Loading kernel...'
Expand Down
2 changes: 1 addition & 1 deletion templates/boot/grub/addons.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
submenu "Addons ->" --class=submenu {
submenu "Addons " --class=submenu {

# EFI:
if [ "${grub_platform}" == "efi" ] ; then
Expand Down
16 changes: 13 additions & 3 deletions templates/boot/grub/grub.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,20 @@ source /boot/grub/header.cfg

insmod regexp

for config in /boot/grub/*_default.cfg ; do source "$config" ; done
for config in /boot/grub/*_options.cfg ; do source "$config" ; done
for config in /boot/grub/*_default.cfg ; do
source "$config"
regexp --set 1:config "(/boot/grub/.+)_default.cfg" "$config"
set config="${config}_options.cfg"
source "$config"
done

# separator entry, no action
menuentry "" {
true
}

if [ -f /boot/grub/addons.cfg ] ; then
source "/boot/grub/addons.cfg"
source "/boot/grub/addons.cfg"
fi

source /boot/grub/footer.cfg
Expand Down
2 changes: 1 addition & 1 deletion templates/boot/grub/header.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set default=0
set timeout=20

if loadfont /boot/grub/ascii.pf2 ; then
if loadfont /boot/grub/unicode.pf2 ; then
insmod png
set gfxmode=auto
insmod gfxterm
Expand Down

0 comments on commit d2927fb

Please sign in to comment.