URL: <https://savannah.gnu.org/bugs/?62719>
Summary: grub2-mkconfig generates invalid configuration with motherboards that do not support EFI. Project: GNU GRUB Submitter: pysis Submitted: Thu 07 Jul 2022 01:42:18 PM EDT Category: Configuration Severity: Major Priority: 5 - Normal Item Group: Hardware-specific Status: None Privacy: Public Assigned to: None Originator Name: Pysis Originator Email: pysis...@gmail.com Open/Closed: Open Release: other Release: Discussion Lock: Any Reproducibility: Every Time Planned Release: None _______________________________________________________ Follow-up Comments: ------------------------------------------------------- Date: Thu 07 Jul 2022 01:42:18 PM EDT By: Pysis <pysis> 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 fi ### 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 #!/bin/sh #THIS IS A GRUB PROXY SCRIPT '/etc/grub.d/proxifiedScripts/uefi-firmware' | /etc/grub.d/bin/grubcfg_proxy "+* +#text -'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' { fwsetup } fi EOF ⋊> 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' { fwsetup } fi ⋊> 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) https://www.asus.com/us/supportonly/M4N98TD%20EVO/HelpDesk_Knowledge/ ⋊> rpm -q -a 'name=*'(read)'*' | sort read> grub grub2-common-2.06-42.fc36.noarch grub2-efi-ia32-2.06-42.fc36.x86_64 grub2-efi-ia32-cdboot-2.06-42.fc36.x86_64 grub2-efi-x64-2.06-42.fc36.x86_64 grub2-efi-x64-cdboot-2.06-42.fc36.x86_64 grub2-pc-2.06-42.fc36.x86_64 grub2-pc-modules-2.06-42.fc36.noarch grub2-tools-2.06-42.fc36.x86_64 grub2-tools-efi-2.06-42.fc36.x86_64 grub2-tools-extra-2.06-42.fc36.x86_64 grub2-tools-minimal-2.06-42.fc36.x86_64 grubby-8.40-57.fc36.x86_64 ⋊> lshw <hostname> 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=... *-core 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. *-firmware 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... _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?62719> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/