Monday, August 12, 2024

How to install LTS kernel on Arch linux and show it in systemd-boot

I'm using "systemd-boot" instead of grub.

1) Install LTS kernel with headers:
sudo pacman -S linux-lts linux-lts-headers nvidia-lts

2) Rebuild Initramfs and reboot (choose still the default kernel, latest):
sudo mkinitcpio -P

3) Duplicate existing entry (check yours)
sudo cp /boot/loader/entries/2023-11-30_18-19-41_linux.conf /boot/loader/entries/2023-11-30_18-19-41_linux-lts.conf

4) Edit the new entry (save with Control+O and Control+X):
sudo nano /boot/loader/entries/2023-11-30_18-19-41_linux-lts.conf
Replace the lines:
title Arch Linux (linux)
linux /vmlinuz-linux
initrd /intel-ucode.img
initrd /initramfs-linux.img
with
title Arch Linux (linux-lts)
linux /vmlinuz-linux-lts
initrd /intel-ucode.img
initrd /initramfs-linux-lts.img

5) Edit the default kernel and timeout
sudo nano /boot/loader/loader.conf
like this, replace "arch" with "2023-11-30_18-19-41_linux-lts" to change:
timeout 5
default arch
You can also rename the conf files to "linux.conf" and "linux-lts.conf" instead of default naming scheme, the idea is that the name in "/boot/loader/loader.conf" matches the name of the conf file.

6) Reboot to test new entry and kernel

7) Check that module is loaded, and the screen resolution is native (1080p). Without "nvidia-lts" the resolution is 800x600.
lsmod | grep nvidia
nvidia_drm            122880  18
nvidia_modeset       1617920  57 nvidia_drm
video                  77824  2 msi_wmi,nvidia_modeset
nvidia_uvm           6680576  2
nvidia              61001728  645 nvidia_uvm,nvidia_modeset
nvidia-smi
journalctl -b | grep -i nvidia

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.