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

teoberi 01-28-2024 02:15 AM

Quote:

Originally Posted by chrisretusn (Post 6479769)
:scratch:
Installed it? I did. No issues.

Both Debian and OpenSUSE are using the same version in testing.

Those are commits toward the next version release, are you expecting Pat to make a package out of git?

How is grub so hard to maintain? Just install it and start using it. Perhaps you have a special use case that's in one of the commits?

There could be issues that Pat is aware of in Slackware that we are not aware of or it's like Didier Spaier stated.

I just tested it in a virtual machine with/without hardening flags and really I had no problems here.
OpenSUSE Tumbleweed is a rolling release that is constantly updated as Slackware64-current could be.:doh:
I don't expect a package from git, but what the hell are we doing with the hundreds of patches for GRUB existing in Debian, Fedora, OpenSUSE, etc. This is what I was referring to when I said that it is difficult to maintain.:banghead:
Those from Grub hardly cut a release and let the distribution maintainers deal with the necessary patches that appear after the release.
I still have a problem with the official SlackBuild for GRUB.
If I apply hardening flags, I have to use HOST_CFLAGS="-fstack-protector-strong" because the script builds 32/64 bit efi target, then builds regular build and overwrites the above option by disabling it for efi.
Code:

build_grub() {
  EFI_DO="$*"
  # Configure:
  CFLAGS="$SLKCFLAGS" \
  ./configure \
    --prefix=/usr \
    --libdir=/usr/lib${LIBDIRSUFFIX} \
    --sysconfdir=/etc \
    --localstatedir=/var \
    --infodir=/usr/info \
    --mandir=/usr/man \
    --disable-werror \
    $EFI_DO || exit 1

  # Build and install:
  make clean || exit 1
  make $NUMJOBS || make || exit 1
  make install DESTDIR=$PKG || exit 1

  # Clear $EFI_DO :
  unset EFI_DO
}

# Build 32bit and 64bit efi targets if requested:
if [ -n "$EFI32_FLAGS" ]; then
  build_grub $EFI32_FLAGS || exit 1
fi
if [ -n "$EFI_FLAGS" ]; then
  build_grub $EFI_FLAGS || exit 1
fi
# Always end with regular build:
build_grub || exit 1

The SlackBuild used by Didier solves the problem in a different way, although he disabled the respective section and removed $ENABLESTACKPROTECTOR from the compilation options.

chrisretusn 01-28-2024 03:31 AM

Thanks @teoberi for the reply. :hattip:

Well don't know or really care about Debian or OpenSUSE or the others, only Slackware. I don't apply any hardening so that probably helps. Not a lot of patches in the slackware64-current build. I also testing in a VM first. That how I got to learn grub after Pat announced lilo, elilo would be following the dodo bird. I'm 100% with grub now. Three slackware64-current installs, two BIOS, one EFI and one slackware64-15.0 BIOS install.

bigbadaboum 01-28-2024 11:16 AM

*maybe the problem is not related to Grub, maybe someone here has the answer.

Grub 2.12 bios without liblzma: 48.6 MB use at startup
Grub 2.12 bios with liblzma: 47.9 MB use at startup
*Grub 2.12 bios with liblzma after a 15-minute session on youtube(javascipt.enabled) and a reboot: 52MB to use when starting up.
Grub 2.12 bios with liblzma after a 15-minute session offline and a reboot: 47.9 MB use at startup.

USUARIONUEVO 02-06-2024 08:07 AM

Interesting article.

Working on TPM2 support and more.

https://www.phoronix.com/news/GRUB-2024-Plans

marav 02-06-2024 11:52 AM

Quote:

Originally Posted by bigbadaboum (Post 6479846)
*maybe the problem is not related to Grub, maybe someone here has the answer.

Grub 2.12 bios without liblzma: 48.6 MB use at startup
Grub 2.12 bios with liblzma: 47.9 MB use at startup
*Grub 2.12 bios with liblzma after a 15-minute session on youtube(javascipt.enabled) and a reboot: 52MB to use when starting up.
Grub 2.12 bios with liblzma after a 15-minute session offline and a reboot: 47.9 MB use at startup.

Probably nobody here in 2024, considers a 5MB RAM overload to be a problem

AlleyTrotter 03-21-2024 02:00 PM

poke me with a stick.
I never found this thread.
Thanks Marav et all
john

marav 03-21-2024 02:02 PM

Quote:

Originally Posted by AlleyTrotter (Post 6491076)
poke me with a stick.
I never found this thread.
Thanks Marav et all
john

/me slap John with a large trout :D

drumz 03-22-2024 12:05 PM

I recently installed Slackware 15.0 on a new machine. elilo didn't work (don't know why). I just previously switched from elilo to grub on a different machine to fix an nVidia problem, so I'm a brand new grub user. Anyway, I grabbed the SlackBuild for grub 2.12 and compiled it on Slackware 15.0 and am using it now.

I use an encrypted /, so I needed to make some modifications (after following README_CRYPT.txt). Here is my drive setup (not every drive is listed):
Code:

# lsblk
NAME              MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINTS
sr0                11:0    1 1024M  0 rom 
nvme2n1          259:0    0  1.9T  0 disk 
├─nvme2n1p1      259:1    0  850M  0 part  /boot/efi
├─nvme2n1p2      259:2    0  12G  0 part 
├─nvme2n1p3      259:3    0  61G  0 part 
├─nvme2n1p4      259:4    0    2G  0 part  /boot
├─nvme2n1p5      259:5    0  32G  0 part 
│ └─cryptswap    252:1    0  32G  0 crypt [SWAP]
└─nvme2n1p6      259:6    0  1.8T  0 part 
  └─luksSLACKROOT 252:0    0  1.8T  0 crypt /

Note that nvme2n1 was originally called nvme0n1 before I installed additional NVME drives in the PCIe slots. This motivated me to switch to using labels instead of raw device names (I replaced real UUIDs by "xx-xx" except for the raw root partition I replaced it with "0x-xx" and the decrypted LUKS / partition with "2x-xx"):

Code:

/dev/mapper/cryptswap: UUID="xx-xx" TYPE="swap"
/dev/nvme2n1p6: UUID="0x-xx" TYPE="crypto_LUKS" PARTLABEL="SLACKROOT" PARTUUID="xx-xx"
/dev/nvme2n1p4: UUID="xx-xx" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="xx-xx"
/dev/nvme2n1p2: LABEL="OS" UUID="xx-xx" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="Basic data partition" PARTUUID="xx-xx"
/dev/nvme2n1p5: UUID="xx-xx" TYPE="swap" PARTUUID="xx-xx"
/dev/nvme2n1p3: LABEL="UBUNTU" UUID="xx-xx" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="xx-xx"
/dev/nvme2n1p1: LABEL_FATBOOT="ESP" LABEL="ESP" UUID="xx-xx" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="xx-xx"
/dev/mapper/luksSLACKROOT: UUID="2x-xx" BLOCK_SIZE="4096" TYPE="ext4"

First I added the following line to /etc/default/grub:
Code:

GRUB_CMDLINE_LINUX_DEFAULT="cryptdevice=UUID=0x-xx:luksSLACKROOT:allow-discards preempt=voluntary delayacct mitigations=off"
Then after generating /boot/grub/grub.cfg I modified it like so to boot my custom kernel. Whenever I upgrade my kernel I also upgrade the symlinks in /boot.
Code:

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Slackware-15.0 GNU/Linux' --class slackware_15_0 --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-2x-xx' {
        load_video
        insmod gzio
        insmod part_gpt
        insmod ext2
        search --no-floppy --fs-uuid --set=root xx-xx
        echo        'Loading Linux current ...'
        linux        /vmlinuz-current root=UUID=2x-xx ro  cryptdevice=UUID=0x-xx:luksSLACKROOT:allow-discards preempt=voluntary delayacct mitigations=off
        echo        'Loading initial ramdisk ...'
        initrd        /initrd-current.gz
}
submenu 'Advanced options for Slackware-15.0 GNU/Linux' $menuentry_id_option 'gnulinux-advanced-2x-xx' {
        menuentry 'Slackware-15.0 GNU/Linux, with Linux current' --class slackware_15_0 --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-current-advanced-2x-xx' {
                load_video
                insmod gzio
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root xx-xx
                echo        'Loading Linux current ...'
                linux        /vmlinuz-current root=UUID=2x-xx ro  cryptdevice=UUID=0x-xx:luksSLACKROOT:allow-discards preempt=voluntary delayacct mitigations=off
                echo        'Loading initial ramdisk ...'
                initrd        /initrd-current.gz
        }
        menuentry 'Slackware-15.0 GNU/Linux, with Linux current (recovery mode)' --class slackware_15_0 --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-current-recovery-2x-xx' {
                load_video
                insmod gzio
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root xx-xx
                echo        'Loading Linux current ...'
                linux        /vmlinuz-current root=UUID=2x-xx ro single
                echo        'Loading initial ramdisk ...'
                initrd        /initrd-current.gz
        }
        menuentry 'Slackware-15.0 GNU/Linux, with Linux previous' --class slackware_15_0 --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-previous-advanced-2x-xx' {
                load_video
                insmod gzio
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root xx-xx
                echo        'Loading Linux previous ...'
                linux        /vmlinuz-previous root=UUID=2x-xx ro  cryptdevice=UUID=0x-xx:luksSLACKROOT:allow-discards preempt=voluntary delayacct mitigations=off
                echo        'Loading initial ramdisk ...'
                initrd        /initrd-previous.gz
        }
        menuentry 'Slackware-15.0 GNU/Linux, with Linux previous (recovery mode)' --class slackware_15_0 --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-previous-recovery-2x-xx' {
                load_video
                insmod gzio
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root xx-xx
                echo        'Loading Linux previous ...'
                linux        /vmlinuz-previous root=UUID=2x-xx ro single
                echo        'Loading initial ramdisk ...'
                initrd        /initrd-previous.gz
        }
        menuentry 'Slackware-15.0 GNU/Linux, with Linux 5.15.145' --class slackware_15_0 --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.15.145-advanced-2x-xx' {
                load_video
                insmod gzio
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root xx-xx
                echo        'Loading Linux 5.15.145 ...'
                linux        /vmlinuz-generic-5.15.145 root=UUID=2x-xx ro  cryptdevice=UUID=0x-xx:luksSLACKROOT:allow-discards preempt=voluntary delayacct mitigations=off
                echo        'Loading initial ramdisk ...'
                initrd        /initrd-5.5.145.gz
        }
        menuentry 'Slackware-15.0 GNU/Linux, with Linux 5.15.145 (recovery mode)' --class slackware_15_0 --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.15.145-recovery-2x-xx' {
                load_video
                insmod gzio
                insmod part_gpt
                insmod ext2
                search --no-floppy --fs-uuid --set=root xx-xx
                echo        'Loading Linux 5.15.145 ...'
                linux        /vmlinuz-generic-5.15.145 root=UUID=2x-xx ro single
                echo        'Loading initial ramdisk ...'
                initrd        /initrd-5.5.145.gz
        }

I also modified /etc/crypttab, /etc/fstab, and /etc/mkinitrd.conf to use the partition label SLACKROOT:
Code:

# grep SLACKROOT /etc/crypttab
luksSLACKROOT  /dev/disk/by-partlabel/SLACKROOT      none  discard
# grep SLACKROOT /etc/fstab
/dev/mapper/luksSLACKROOT    /                ext4        defaults,discard 1  1
# grep SLACKROOT /etc/mkinitrd.conf
LUKSDEV="/dev/disk/by-partlabel/SLACKROOT"
LUKSTRIM="/dev/disk/by-partlabel/SLACKROOT" # verify support with 'hdparm -I $dev | grep TRIM'
ROOTDEV="/dev/mapper/luksSLACKROOT"

Now when I add another drive (which I will next week...) it won't matter if the raw device name of / changes.


All times are GMT -5. The time now is 01:24 PM.