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

2023-06-28 Thread INVALID.NOREPLY
Follow-up Comment #1, bug #62719 (project grub):

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.


___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




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

2022-07-07 Thread Pysis
URL:
  

 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 
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

description: Desktop Computer