Skip to content

Instantly share code, notes, and snippets.

@metius
Last active December 24, 2024 01:57
Show Gist options
  • Save metius/d0254eed81bee8055836910ec24cb84e to your computer and use it in GitHub Desktop.
Save metius/d0254eed81bee8055836910ec24cb84e to your computer and use it in GitHub Desktop.
GUIDE - How to select a specific kernel version at boot in Pop_OS!

GUIDE - How to select a specific kernel version at boot in Pop_OS!

Pop OS uses their own implementation named kernelstub to handle the kernels, they did so to make it faster on load times (at least that's what their blog post says).

Their README page show certain information of how to use it, but there are some other things that are required to do, specially if you want to have a menu on boot, similar to grub.

Update a kernel

In case you just want to use a specific kernel and forget about other ones, you can execute this command to update the current configuration

sudo kernelstub -v -k <vmlinuz_path> -i <initrd.img_path>

Optionally you can test it will work correctly by adding the -c flag or --dry-run.

Using multiple kernels

If you are planning on switching kernels regularly, this is your option:

  1. Download the kernel you want to use: This will depend on the specific kernel you want to download. In some cases, you can use sudo apt install , but that can vary.

  2. Write down the names of the vmlinuz and initrd.img files wherever is easier for you to copy and paste it.

  3. Become root, I prefer using sudo -i, but you can execute the rest of the steps prefixing sudo.

  4. Copy the vmlinuz and initrd.img file to /boot/efi/EFI/Pop_OS- using the cp command. The value will vary according to your system, so there is no universal path. For example cp /boot/vmlinuz-5.6.14-xanmod1 /boot/efi/EFI/Pop_OS-7cd110a9-f7d5-4a39-b47f-e5056b80e7a1/ and cp /boot/initrd.img-5.6.14-xanmod1 /boot/efi/EFI/Pop_OS-7cd110a9-f7d5-4a39-b47f-e5056b80e7a1/

  5. Check the copied files have the same permissions as the existing ones by running ls -l /boot/efi/EFI/Pop_OS-7cd110a9-f7d5-4a39-b47f-e5056b80e7a1/ this will vary according to your system. If the permissions are different you can access to the folder using cd /boot/efi/EFI/... and then run chmod --reference=vmlinuz.efi <your_kernel>, repeat it with the initrd.img file too.

  6. Access to the loader folder using cd /boot/efi/loader.

  7. Edit loader.conf file, using your preferred editor. I like to use nano, so you will need to run nano loader.conf.

  8. Add this line timeout . This will stop the boot system the time you have set, allowing the user to select the kernel to use. In case nothing is selected in the specified time, it will choose the default.

  9. Close your editor. In case of nano, press Ctrl + X and later Y to write your changes, else press N to discard them.

  10. Duplicate the current configuration located inside the entries folder, using cd ./entries, after run cp Pop_OS-current.conf Pop_OS-.conf.

  11. Edit the created file.

  12. In the line starting with linux modify the vmlinuz name (not the directory) as it should be in the same directory as the current kernel.

  13. In the line starting with initrd, modify the initrd name.

  14. Save the files and it should be done.

  15. Reboot and test that it's working.

Original Reddit post here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment