Mind Dump, Tech And Life Blog
written by Ivan Alenko
published under license Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)copy! share!
posted in category Systems Software / GNU Linux
posted at 09. Aug '21

Howto Upgrade Slackware 14.02 (including nVidia driver)

Kernel upgrades in Slackware are manual. No DKMS, no automatic initrd. It’s even more complicated with nVidia driver, LUKS and LVM volumes.

Recently I moved to another distro not because of these manual updates, but KDE was really broken - lockscreen crashed and had to restart Xserver with Ctrl+Alt+Backspace, sometimes two times. Greeter fired virtual keyboard by default and had to close it and then write the password. Or sleep or shutdown buttons didn’t work from start menu. Seems like a small stuff, but very annoying and I don’t have time for this stuff.

Anyways. I promised instructions.

Upgrade the System

Add to ~/.bashrc - under root or user, depends if you use sudo or not. This will tell compiler to compile on almost all cores:

export MAKEOPTS="-j15"
export MAKEFLAGS="-j15"

Update the system and native packages:

slackpkg update
slackpkg upgrade-all

Upgrade packages from Slackbuilds - https://slackbuilds.org/ repository (these are compiled). Using sbo-tools:

sbocheck
sboupgrade --all

Properly Upgrade the Linux Kernel

While slackpkg installs new kernel and sources, you must not restart the system or it will be broken and have to load Ubuntu or any live distro and mount the system and fix the initrd and elilo with commands below.

If any of these packages are updated, you need to regenerate initrd and tell elilo: kernel-generic, kernel-headers, kernel-huge, kernel-modules, kernel-source. Not necessary for: kernel-firmware.

Mount EFI Partition

After so much pain and weirdness, I run pure EFI, GPT and no CSM. Need to mount EFI partition to /boot/efi, otherwise elilo will reinstall into the wrong directory and won’t boot:

mount /dev/sda1 /boot/efi/
mount: /boot/efi: /dev/sda1 already mounted on /boot/efi.

Reinstall nVidia Driver

No DKMS, need to reinstall manually. Export variable with new kernel version, so modules are added into correct directory and not the current kernel:

export KERNEL=5.13.4
sboremove nvidia-driver
sboinstall nvidia-driver

Update initrd

Slackware provides helper script to generate the correct command and I can only recommend.

Use -i as interactive mode if you have encrypted partitions, otherwise generated command will be incorrect (no LUKS). Specify new kernel version. Generally select yes and choose US keyboard. My LVM system volume is called manjaro/system, it’s fine, just a name:

$ /usr/share/mkinitrd/mkinitrd_command_generator.sh -k 5.13.4 -i
mkinitrd -c -k 5.13.4 -f ext4 -r /dev/manjaro/system -m usb-storage:xhci-hcd:xhci-pci:ohci-pci:ehci-pci:uhci-hcd:ehci-hcd:hid:usbhid:i2c-hid
:hid_generic:hid-asus:hid-cherry:hid-logitech:hid-logitech-dj:hid-logitech-hidpp:hid-lenovo:hid-microsoft:hid_multitouch:jbd2:mbcache:crc32c_intel:c
rc32c_generic:ext4 -C /dev/sda2 -L -u -o /boot/initrd.gz

Copy and paste the command to actually generate initrd:

$ mkinitrd -c -k 5.13.4 -f ext4 -r /dev/manjaro/system -m
xhci-pci:ohci-pci:ehci-pci:xhci-hcd:uhci-hcd:ehci-hcd:hid:usbhid:i2c-hid:hid_generic:hid-asus:hid-cherry:hid-logitech:hid-logitech-dj:hid-logitech-hidpp:hid-lenovo:hid-microsoft:hid_multitouch:jbd2:mbcache:crc32c_intel:crc32c_generic:ext4
-C /dev/sda2 -L -u -o /boot/initrd.gz

/dev/sda2 is LUKS root partition, initrd will be stored in /boot/initrd.gz.

Reinstall elilo

I’m not sure if elilo can choose between multiple kernels. I assume it works like LILO and can’t. Note that even though root partition is encrypted, the boot logic is stored unencrypted in EFI partition in initrd file which is less secure than with Grub 2. I think. Not sure about this, but the kernel (vmlinuz) is sitting unencrypted.

$ eliloconfig

install
install
remove old menu entry - yes

Check if the modification date of initrd.gz and elilo.conf are current. If not, mkinitrd failed or eliloconfig install failed.

root@rapthalia:~# ls -lah /boot/efi/EFI/Slackware/total 20M
drwxr-xr-x 2 root root 4.0K May 16 18:20 ./
drwxr-xr-x 7 root root 4.0K May  3 19:08 ../
-rwxr-xr-x 1 root root  177 Jul 25 14:18 elilo.conf*
-rwxr-xr-x 1 root root 233K Jun 12  2018 elilo.efi*
-rwxr-xr-x 1 root root  13M Jul 25 14:18 initrd.gz*
-rwxr-xr-x 1 root root 7.0M Jul 21 03:32 vmlinuz*

That’s all, pray and restart the system.

Add Comment