LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Grub 2.12 feedbacks (https://www.linuxquestions.org/questions/slackware-14/grub-2-12-feedbacks-4175732263/)

marav 12-29-2023 04:51 PM

Grub 2.12 feedbacks
 
Grub 2.12 has been added in Salckware current /testing tree
Code:

testing/packages/grub-2.12-x86_64-1.txz:  Added.
Here, it doesn't boot correctly
It just cycles to my BIOS

Didier Spaier 12-29-2023 05:55 PM

I couldn't run the package on Slint64-15.0 (SO libs mismatch) but built it, installed it and it works here (TM) with a few caveats about the menu. At least I could type:
Code:

grub-install /dev/sdb
grub-mkconfig -o /boot/grub/grub.cfg

then reboot and I am back to post this finding.
This is with UEFI.

reddog83 12-29-2023 06:07 PM

Could you post diff's of the files that you modified?

marav 12-29-2023 06:58 PM

Quote:

Originally Posted by Didier Spaier (Post 6473451)
I couldn't run the package on Slint64-15.0 (SO libs mismatch) but built it, installed it and it works here (TM) with a few caveats about the menu. At least I could type:
Code:

grub-install /dev/sdb
grub-mkconfig -o /boot/grub/grub.cfg

then reboot and I am back to post this finding.
This is with UEFI.

This release 2.12 needs a reinstall ?

marav 12-29-2023 07:00 PM

According to Arch PKGBUILD:
Code:

post_upgrade() {
  # We used to package /boot/grub/grub.cfg, but there is no reason to.
  # Remove the file from package, but move real file back in place.
  if [ ! -f /boot/grub/grub.cfg -a -f /boot/grub/grub.cfg.pacsave ]; then
    mv /boot/grub/grub.cfg.pacsave /boot/grub/grub.cfg
  fi

  # Give a hint to update installation and configuration one after another.
  cat <<EOM
:: To use the new features provided in this GRUB update, it is recommended
  to install it to the MBR or UEFI. Due to potential configuration
  incompatibilities, it is advised to run both, installation and generation
  of configuration:
    # grub-install ...
    # grub-mkconfig -o /boot/grub/grub.cfg
EOM

https://gitlab.archlinux.org/archlin...ref_type=heads

marav 12-29-2023 07:22 PM

Quote:

Originally Posted by Daedra (Post 6473442)
After testing in a VM first I installed 2.12 on my main machine and all is good. I did have to tweak Richard Cranium's 09_slackware_linux script that I like to use, I disable 10_linux since his script gives a cleaner menu IMO. The script still worked but was giving some deprecation warnings. After a small tweak the script works fine again with no warnings.

Could you provide your tweaks?

Daedra 12-29-2023 07:52 PM

Quote:

Originally Posted by marav (Post 6473473)
Could you provide your tweaks?

Sure, here is the 09_slackware_linux file I use.
https://raw.githubusercontent.com/md...lackware_linux

Daedra 12-29-2023 07:58 PM

I have been using the os-prober to find my Windows Partition which worked perfectly fine. but I have noticed that a few weeks back all of the sudden the os-prober is now finding the Slackware kernels. This is creating duplicate entries which is really annoying. My work around is to disable os-prober and just create a custom entry for my Windows partition in /etc/grub.d/40_custom. This workaround is acceptable but I was just wondering if anyone else is seeing this behavior. Here is the output grub-mkconfig -o /boot/grub/grub.cfg with os-prober enabled.

Code:

Generating grub configuration file ...
Found background: /mnt/backup/wallpaper/slackware_3d_grey.png
Found linux image: /boot/vmlinuz-generic-6.6.8
Found linux image: /boot/vmlinuz-huge-6.6.8
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Found Slackware 15.0 x86_64 (post 15.0 -current) on /dev/nvme1n1p1

Adding boot menu entry for UEFI Firmware Settings ...
done


Didier Spaier 12-30-2023 02:44 AM

Quote:

Originally Posted by marav (Post 6473466)
This release 2.12 needs a reinstall ?

Probably not, even more so as I built and installed the EFI OS loader previously using the grub 2.12 shipped in Slint with a similar command, but it won't hurt.

Didier Spaier 12-30-2023 03:15 AM

Quote:

Originally Posted by reddog83 (Post 6473454)
Could you post diff's of the files that you modified?

To build the Slackware package I just ran the SlackBuild in /testing as is. Other than that, sources of the Slint package (only tested on 15.0).

3rensho 12-30-2023 03:51 AM

I just built grub 2.12 using the SlackBuild in /testing. Installed it, ran my mkinird script and then grub-mkconfig -o /boot/grub/grub.cfg and rebooted and all is good. Did have a couple of warnings about parts being deprecated but it all works just fine.

Edit: Started playing with the .new files and managed to get to a state where it wouldn't boot, just black screen and reboot. Booted Knoppix and restored grub backup files with version 2.06. Will have to try again and reinstall Grub 2.12

Edit1: OK, got it installed and booting. In /etc/grub.d I moved all of the new files to their old counterparts. Did not use the /etc/default/grub.new file since I had done customizing to the existing grub file and my customizing was the only difference. Ran grub-install and it complained that /boot/efi was not a fat partition. Ran lsblk to get efi partition. Mounted my uefi partition /dev/nvme0n1p1 on /boot/efi. Install went fine. Recreated my initrd and rebooted. Everything went swimmingly. Good way to finish 2023.

Didier Spaier 12-30-2023 04:26 AM

Caveat: if you keep .orig files in /etc/grub.d/ (like 10_linux alongside 10_linux.orig), grub-mkconfig will run them, leading to duplicate boot entries. So(re)move any .orig or make it non executable.

Post edited, see the reason below.

Didier Spaier 12-30-2023 05:05 AM

Please run grub-install just after having upgarded grub.
 
I just got a bug report in the Slint mailing list, quoted below:
Quote:

yesterday I upgraded grub on my laptop and now I'm not able to boot. The message on the screen is so fast that my son was obliged to take a video and it appears that it complains about a file that it can't find :

/boot/grub/x86_64-efi/bli.mod

Some help please ?
My second answer (the first was not complete):
Code:

Please boot the installer, then as soon as you get the prompt mount the root
partition as /mnt, then type (I assume that the disk is named /dev/sda, else
adapt accordingly):
mount -B /dev /mnt/dev
mount -B /proc /mnt/proc
mount -B /sys /mnt/sys
chroot /mnt
mount -a
mount -t efivarfs none /sys/firmware/efi/efivars
# the command above only needed and successful if you booted
# in EFI mode but else won't hurt
grub-install /dev/sda

Running grub-install should solve the issue as it copies all needed files under /boot/grub, including the new bli module.

PS digging a little more the bli module was added to make happy systemd as stated in this log lines 1942-1970 :mad:

Didier Spaier 12-30-2023 07:01 AM

How to run grub-install in doinst.sh
 
If we want to run grub-install in a post-install script like doinst.sh after a grub upgrade and if we assume that grub is installed on the drive hosting the root partition this code snippet could help:
Code:

ROOTPART=$(findmnt -lno source /|sed 's;[[].*;;')
ROOTDEVICENAME=$(lsblk -lno pkname $ROOTPART)
grub-install /dev/$ROOTDEVICENAME
grub-mkconfig -o /boot/grub/grub.cfg #Just in case GRUB was installed previously in another drive or not at all.

The sed command removes [sub-volume name] from the output of of findmnt, case occurring. For instance here:
Code:

findmnt -lno source /
/dev/sdb13[/@]

But:
Code:

findmnt -lno source /|sed 's;[[].*;;'
/dev/sdb13

We could as well scan /etc/fstab, but it's a bit more tricky as the root partition can be named several ways.

rizitis 12-30-2023 09:28 AM

Quote:

Originally Posted by Didier Spaier (Post 6473552)
If we want to run grub-install in a post-install script like doinst.sh after a grub upgrade and if we assume that grub is installed on the drive hosting the root partition this code snippet could help:
Code:

ROOTPART=$(findmnt -lno source /|sed 's;[[].*;;')
ROOTDEVICENAME=$(lsblk -lno pkname $ROOTPART)
grub-install /dev/$ROOTDEVICENAME
grub-mkconfig -o /boot/grub/grub.cfg #Just in case GRUB was installed previously in another drive or not at all.

The sed command removes [sub-volume name] from the output of of findmnt, case occurring. For instance here:
Code:

findmnt -lno source /
/dev/sdb13[/@]

But:
Code:

findmnt -lno source /|sed 's;[[].*;;'
/dev/sdb13

We could as well scan /etc/fstab, but it's a bit more tricky as the root partition can be named several ways.

typo ;)


All times are GMT -5. The time now is 10:23 PM.