Bug#993284: grub-efi-amd64: grub-install: using the option "--bootloader-id='custom name'" boots into the GRUB console instead of the menu

L. Manuel Arrieta lumanarav at gmail.com
Mon Aug 30 04:49:54 BST 2021


Package: grub-efi-amd64
Version: 2.04-20
Severity: normal

I am in the process of making a diagnose & manteinance Debian setup onto a
USB stick that can boot in whatever PC drops in my hands. Working on
having a custom EFI boot entry I encountered that adding the --bootloade-id
option in grub-install makes the system boot into the GRUB console
instead of the usual GRUB menu. Not GRUB rescue, the regular GRUB
console.

I can get in there by manually bring it
up with the following GRUB commands:

set prefix=(hd1,gpt3)/boot #or whenever /boot/grub resides
insmod normal
normal

I tried almost all combinations of adding --recheck, --no-nvram and
--removable, but it seems that it the route isn't EFI/debian or EFI/BOOT
the system won't boot on the menu.

Weird enought I copied grub.cfg into EFI/[custom-name] and it seems to
work, but the frame of the menu is compsided of the unknown square
unicode character

Currently testing on a MacBook Pro 9,2, did some test on a brand-new
Lenovo L340

-- Package-specific info:

*********************** BEGIN /proc/mounts
/dev/sda4 / btrfs rw,relatime,ssd,space_cache,subvolid=256,subvol=/@rootfs 0 0
/dev/sda3 /boot ext4 rw,relatime 0 0
/dev/sda2 /boot/efi vfat rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 0
*********************** END /proc/mounts

*********************** BEGIN /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}
function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod btrfs
set root='hd0,gpt4'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --hint-baremetal=ahci0,gpt4  f54db690-2754-45a1-99f9-89dd272a4268
else
  search --no-floppy --fs-uuid --set=root f54db690-2754-45a1-99f9-89dd272a4268
fi
    font="/@rootfs/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=es_MX
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
  set timeout=30
else
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=menu
    set timeout=5
  # Fallback normal timeout code in case the timeout_style feature is
  # unavailable.
  else
    set timeout=5
  fi
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_gpt
insmod btrfs
set root='hd0,gpt4'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --hint-baremetal=ahci0,gpt4  f54db690-2754-45a1-99f9-89dd272a4268
else
  search --no-floppy --fs-uuid --set=root f54db690-2754-45a1-99f9-89dd272a4268
fi
insmod png
if background_image /@rootfs/usr/share/desktop-base/homeworld-theme/grub/grub-4x3.png; then
  set color_normal=white/black
  set color_highlight=black/white
else
  set menu_color_normal=cyan/blue
  set menu_color_highlight=white/blue
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
	set gfxpayload="${1}"
}
set linux_gfx_mode=
export linux_gfx_mode
menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-f54db690-2754-45a1-99f9-89dd272a4268' {
	load_video
	insmod gzio
	if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
	insmod part_gpt
	insmod ext2
	set root='hd0,gpt3'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3  fb944508-a5a3-48b4-b4df-8037ae333f1d
	else
	  search --no-floppy --fs-uuid --set=root fb944508-a5a3-48b4-b4df-8037ae333f1d
	fi
	echo	'Loading Linux 5.10.0-8-amd64 ...'
	linux	/vmlinuz-5.10.0-8-amd64 root=UUID=f54db690-2754-45a1-99f9-89dd272a4268 ro rootflags=subvol=@rootfs  quiet
	echo	'Loading initial ramdisk ...'
	initrd	/initrd.img-5.10.0-8-amd64
}
submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option 'gnulinux-advanced-f54db690-2754-45a1-99f9-89dd272a4268' {
	menuentry 'Debian GNU/Linux, with Linux 5.10.0-8-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.10.0-8-amd64-advanced-f54db690-2754-45a1-99f9-89dd272a4268' {
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_gpt
		insmod ext2
		set root='hd0,gpt3'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3  fb944508-a5a3-48b4-b4df-8037ae333f1d
		else
		  search --no-floppy --fs-uuid --set=root fb944508-a5a3-48b4-b4df-8037ae333f1d
		fi
		echo	'Loading Linux 5.10.0-8-amd64 ...'
		linux	/vmlinuz-5.10.0-8-amd64 root=UUID=f54db690-2754-45a1-99f9-89dd272a4268 ro rootflags=subvol=@rootfs  quiet
		echo	'Loading initial ramdisk ...'
		initrd	/initrd.img-5.10.0-8-amd64
	}
	menuentry 'Debian GNU/Linux, with Linux 5.10.0-8-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.10.0-8-amd64-recovery-f54db690-2754-45a1-99f9-89dd272a4268' {
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_gpt
		insmod ext2
		set root='hd0,gpt3'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3  fb944508-a5a3-48b4-b4df-8037ae333f1d
		else
		  search --no-floppy --fs-uuid --set=root fb944508-a5a3-48b4-b4df-8037ae333f1d
		fi
		echo	'Loading Linux 5.10.0-8-amd64 ...'
		linux	/vmlinuz-5.10.0-8-amd64 root=UUID=f54db690-2754-45a1-99f9-89dd272a4268 ro single rootflags=subvol=@rootfs 
		echo	'Loading initial ramdisk ...'
		initrd	/initrd.img-5.10.0-8-amd64
	}
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
*********************** END /boot/grub/grub.cfg

*********************** BEGIN /proc/mdstat
cat: /proc/mdstat: No such file or directory
*********************** END /proc/mdstat

*********************** BEGIN /dev/disk/by-id
total 0
lrwxrwxrwx 1 root root  9 Aug 29 22:01 ata-KINGSTON_SA400S37240G_50026B7783AF6CD5 -> ../../sda
lrwxrwxrwx 1 root root 10 Aug 29 22:01 ata-KINGSTON_SA400S37240G_50026B7783AF6CD5-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Aug 29 22:01 ata-KINGSTON_SA400S37240G_50026B7783AF6CD5-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Aug 29 22:01 ata-KINGSTON_SA400S37240G_50026B7783AF6CD5-part3 -> ../../sda3
lrwxrwxrwx 1 root root 10 Aug 29 22:01 ata-KINGSTON_SA400S37240G_50026B7783AF6CD5-part4 -> ../../sda4
lrwxrwxrwx 1 root root  9 Aug 29 22:01 ata-MATSHITADVD-R_UJ-8A8_D0224460F2EDTL7CR -> ../../sr0
lrwxrwxrwx 1 root root  9 Aug 29 22:01 wwn-0x50026b7783af6cd5 -> ../../sda
lrwxrwxrwx 1 root root 10 Aug 29 22:01 wwn-0x50026b7783af6cd5-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Aug 29 22:01 wwn-0x50026b7783af6cd5-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Aug 29 22:01 wwn-0x50026b7783af6cd5-part3 -> ../../sda3
lrwxrwxrwx 1 root root 10 Aug 29 22:01 wwn-0x50026b7783af6cd5-part4 -> ../../sda4
*********************** END /dev/disk/by-id

*********************** BEGIN /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 10 Aug 29 22:01 1A17-C32B -> ../../sda1
lrwxrwxrwx 1 root root 10 Aug 29 22:01 D5E2-7A0C -> ../../sda2
lrwxrwxrwx 1 root root 10 Aug 29 22:01 f54db690-2754-45a1-99f9-89dd272a4268 -> ../../sda4
lrwxrwxrwx 1 root root 10 Aug 29 22:01 fb944508-a5a3-48b4-b4df-8037ae333f1d -> ../../sda3
*********************** END /dev/disk/by-uuid

-- System Information:
Debian Release: 11.0
  APT prefers stable-security
  APT policy: (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-8-amd64 (SMP w/4 CPU threads)
Locale: LANG=es_MX.UTF-8, LC_CTYPE=es_MX.UTF-8 (charmap=UTF-8), LANGUAGE=es_MX:es
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages grub-efi-amd64 depends on:
ii  debconf [debconf-2.0]  1.5.77
ii  grub-common            2.04-20
ii  grub-efi-amd64-bin     2.04-20
ii  grub2-common           2.04-20
ii  ucf                    3.0043

grub-efi-amd64 recommends no packages.

grub-efi-amd64 suggests no packages.

-- debconf information:
  grub2/update_nvram: true
  grub2/kfreebsd_cmdline_default: quiet
* grub2/linux_cmdline_default: quiet
* grub2/linux_cmdline:
  grub2/kfreebsd_cmdline:
* grub2/force_efi_extra_removable: true



More information about the Pkg-grub-devel mailing list