Skip to content

Kernelstub doesn't work with multiple kernels #26

@ayoungethan

Description

@ayoungethan

Distribution (run cat /etc/os-release):

NAME="Pop!_OS"
VERSION="19.04"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Pop!_OS 19.04"
VERSION_ID="19.04"
HOME_URL="https://system76.com/pop"
SUPPORT_URL="http://support.system76.com"
BUG_REPORT_URL="https://github.com/pop-os/pop/issues"
PRIVACY_POLICY_URL="https://system76.com/privacy"
VERSION_CODENAME=disco
UBUNTU_CODENAME=disco

Related Application and/or Package Version (run apt policy $PACKAGE NAME):

kernelstub:
Installed: 3.1.0153936005819.0464d0caf
Candidate: 3.1.0
153936005819.0464d0caf
Version table:
*** 3.1.0153936005819.04~64d0caf 1001
1001 http://ppa.launchpad.net/system76/pop/ubuntu disco/main amd64 Packages
1001 http://ppa.launchpad.net/system76/pop/ubuntu disco/main i386 Packages
100 /var/lib/dpkg/status

Issue/Bug Description:

Kernelstub does not handle more than one kernel installed at once. In my case, linux-lowlatency kernel. Instead, kernelstub treats the previously installed kernel as the old/backup kernel. This means that no reliable boot menu option for selecting which kernel to load at boot time can exist.

The whole point of installing more than one kernel is to be able to switch between them freely. Kernelstub does not currently allow this.

Steps to reproduce (if you know):
Install a second kernel line, such as linux-lowlatency. System will automatically boot into the new kernel, and the user won't have access to the linux-generic kernel until the linux-generic kernel updates, at which point, system will automatically boot into the linux-generic kernel until the linux-lowlatency kernel updates.

Expected behavior:
Kernelstub should create and maintain menus for kernel lines other than linux-generic as they are installed.

A clear policy for previous kernel versions should exist. Probably the safest is to allow for at least one previous kernel version for every kernel line in the boot menu. In my case, this would be:
linux-generic (current)
linux-generic (previous)
linux-lowlatency (current)
linux-lowlatency (previous)

Other Notes:
Current manual workaround:

1) Install the lowlatency kernel with apt/dpkg:

sudo apt install linux-image-lowlatency linux-tools-lowlatency

2) After you install or update the lowlatency kernel you need to copy it and the initrd for that kernel to the ESP partition (/boot/efi)

cp /boot/initrd.img*lowlatency /boot/efi/EFI/Pop_OS-627944f7-4f7b-4f47-80f7-2ca16e1d04a1/initrd-lowlatency.img

cp /boot/vmlinuz*lowlatency /boot/efi/EFI/Pop_OS-627944f7-4f7b-4f47-80f7-2ca16e1d04a1/vmlinuz-lowlatency.efi

3) Copy the loader entries created by kernelstub:

sudo cp /boot/efi/loader/entries/Pop_OS-current.conf /boot/efi/loader/entries/Pop_OS-lowlatency.conf

4) Edit the new entry so you see it as lowlatency:

sudo nano /boot/efi/loader/entries/Pop_OS-lowlatency.conf
edit "title" from "Pop!_OS" to "Pop!_OS-lowlatency"

5) Update the loader entry that you already created to point to the kernel and initramfs image you copied over (/boot/efi/loader/entries)

title Pop!_OS-lowlatency
linux /EFI/Pop_OS-627944f7-4f7b-4f47-80f7-2ca16e1d04a1/vmlinuz-lowlatency.efi
initrd /EFI/Pop_OS-627944f7-4f7b-4f47-80f7-2ca16e1d04a1/initrd-lowlatency.img

6) Edit the loader.conf file to add a timeout on boot so you can choose the kernel you want:

sudo bash -c "echo timeout 5 >> /boot/efi/loader/loader.conf"

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions