bugGNU GRUB - Bugs: bug #62719, grub2-mkconfig generates invalid...


You are not allowed to post comments on this tracker with your current authentication level.

bug #62719: grub2-mkconfig generates invalid configuration with motherboards that do not support EFI.

Submitter:  Pysis <pysis>
Submitted:  Thu 07 Jul 2022 05:42:18 PM UTC
Category:  Configuration Severity:  Major
Priority:  5 - Normal Item Group:  Hardware-specific
Status:  None Privacy:  Public
Assigned to:  None Originator Name:  Pysis
Open/Closed:  Open Release:  other
Release:  Reproducibility:  Every Time
Planned Release:  None

Wed 28 Jun 2023 10:04:02 PM UTC, comment #1: 

It looks like you're on Fedora and so you have a GRUB modified by them. The official repo does not replect the contents of the uefi-firmware script. Please take this issue up with your distro.

Thu 07 Jul 2022 05:42:18 PM UTC, original submission:  

Want: To regenerate config for any reason, but also typically to remove excess Linux kernel version or duplicate Windows entries after partition boot flag or even entire data erasure cleaning.

⋊> sudo grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found Windows 10 on /dev/sdb3
Found Windows 10 on /dev/sdb3
Adding boot menu entry for UEFI Firmware Settings ...
Adding boot menu entry for UEFI Firmware Settings ...
Adding boot menu entry for UEFI Firmware Settings ...
error: ../grub-core/script/lexer.c:352:syntax error.
error: ../grub-core/script/lexer.c:352:Incorrect command.
error: ../grub-core/script/lexer.c:352:syntax error.
Syntax error at line 304
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub2/grub.cfg.new file attached.

⋊> sudo sed -n 300,308p /boot/grub2/grub.cfg.new
### BEGIN /etc/grub.d/31_uefi-firmware_proxy ###

if [ "$grub_platform" = "efi" ]; then

### END /etc/grub.d/31_uefi-firmware_proxy ###

### BEGIN /etc/grub.d/32_custom_proxy ###
menuentry "Fedora"{

⋊> sudo cat /etc/grub.d/31_uefi-firmware_proxy
'/etc/grub.d/proxifiedScripts/uefi-firmware' | /etc/grub.d/bin/grubcfg_proxy "+*
-'UEFI Firmware Settings'~f0280298810b0a1beb11fecc6c223c52~

⋊> sudo file /etc/grub.d/proxifiedScripts/uefi-firmware
/etc/grub.d/proxifiedScripts/uefi-firmware: a /usr/bin/sh script, ASCII text executable
⋊> sudo /etc/grub.d/proxifiedScripts/uefi-firmware
/etc/grub.d/proxifiedScripts/uefi-firmware: line 27: /grub-mkconfig_lib: No such file or directory
⋊> sudo sed -n 33,39p /etc/grub.d/proxifiedScripts/uefi-firmware
cat << EOF
if [ "\$grub_platform" = "efi" ]; then
menuentry '$LABEL' \$menuentry_id_option 'uefi-firmware' {

⋊> echo $pkgdatadir

⋊> sudo echo $pkgdatadir

⋊> ls -l /usr/share/grub/grub-mkconfig_lib
-rw-r--r--. 1 root root 10061 May  9 12:33 /usr/share/grub/grub-mkconfig_lib
⋊> env pkgdatadir='/usr/share/grub' sudo /etc/grub.d/proxifiedScripts/uefi-firmware
/etc/grub.d/proxifiedScripts/uefi-firmware: line 27: /grub-mkconfig_lib: No such file or directory
⋊> sudo env pkgdatadir='/usr/share/grub' /etc/grub.d/proxifiedScripts/uefi-firmware
Adding boot menu entry for UEFI Firmware Settings ...
if [ "$grub_platform" = "efi" ]; then
menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
⋊> echo $grub_platform

⋊> sudo file /etc/grub.d/bin/grubcfg_proxy
/etc/grub.d/bin/grubcfg_proxy: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=49545b71f5af2049b58cabf70603f7eafd0655a8, for GNU/Linux 3.2.0, stripped
⋊> sudo /etc/grub.d/bin/grubcfg_proxy
wrong argument count. You have to give the config as parameter 1!
⋊> sudo sed -n 25,29p /etc/grub.d/proxifiedScripts/uefi-firmware | sudo /etc/grub.d/bin/grubcfg_proxy
wrong argument count. You have to give the config as parameter 1!

⋊> env | grep -i (read)
read> grub
⋊> env | grep -i (read) | grep -vi (read)
read> efi
read> prefix

⋊> neofetch os kernel shell
os: Linux
kernel: 5.17.12-300.fc36.x86_64
shell: fish 3.4.1

Motherboard: ASUS M4N98TD EVO (2010)
https://www.asus.com/us/supportonly/M4N98TD%20EVO/ (dead)

⋊> rpm -q -a 'name=*'(read)'*' | sort
read> grub

⋊> lshw
    description: Desktop Computer
    product: System Product Name (To Be Filled By O.E.M.)
    vendor: System manufacturer
    version: System Version
    serial: System Serial Number
    width: 64 bits
    capabilities: smbios-2.5 dmi-2.5 smp vsyscall32
    configuration: boot=normal chassis=desktop family=To Be Filled By O.E.M. sku=To Be Filled By O.E.M. uuid=...
        description: Motherboard
        product: M4N98TD EVO
        vendor: ASUSTeK Computer INC.
        physical id: 0
        version: Rev 2.00
        serial: ...
        slot: To Be Filled By O.E.M.
           description: BIOS
           vendor: American Megatrends Inc.
           physical id: 0
           version: 1301
           date: 04/14/2011
           size: 64KiB
           capacity: 1MiB
           capabilities: isa pci pnp apm upgrade shadowing escd cdboot bootselect socketedrom edd int13floppy1200 int13floppy720 int13floppy2880 int5printscreen int9keyboard int14serial int17printer int10video acpi usb ls120boot zipboot biosbootspecification

⋊> test -e /sys/firmware/efi; and echo 'EFI Supported!'; or echo 'EFI not supported...'
EFI not supported...

Pysis <pysis>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by g10 (Posted a comment)
  • -email is unavailable- added by pysis (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.


    No changes have been made to this item

    Back to the top

    Powered by Savane 3.12