2

Is it best to uninstall -vanilla kernel or leave and modify boot setup somehow - and if so, what's the best method which isn't lost when the OS updates the extlinux.cfg file?

A while ago I deployed an Alpine 3.12 edge VM to host a Wireguard server for my personal use. Recently I did an apk package update (periodic security patching, etc) and it installed a more recent version of linux-vanilla... Which broke the Wireguard support. Lots of RTNETLINK errors, modprobe wireguard wasn't happy, couldn't load the existing wireguard module from the package install. Very messy.

So, I decided to sidegrade to the linux-virt kernel to get a 5.4 build with Wireguard support included. Ran apk add linux-virt, it installed 5.4.38-0-virt (4th of May 2020 build), great. But how to change the boot default...?

When I updated the kernels and got Wireguard working, I manually overrode via console - then forgot that I'd not solved the boot order issue until I restarted the VM earlier today. I still can't figure out the best solution:

  • Overriding default boot and specifying the -virt kernel works fine. However if I ever reboot the VM for whatever reason, extlinux defaults to the -vanilla kernel, which is borked
  • Despite picking apart /boot/extlinux.cfg I'm don't really want to handtool a modified cfg that because it can be updated automatically by Alpine's update-extlinux program.
  • the default option in extlinux.cfg points to menu.c32, a syslinux module which renders the menu contained in the .cfg. I don't want to lose the GUI boot choice menu, but I can't see how else to update the default kernel without manually hacking the order in the config file (and later losing this whenever the OS updates the file).

I'd prefer to keep this Alpine VM as close to deployed spec as possible, I very rarely touch it so have to relearn each time I do stuff with it. I'd rather not change from extlinux unless necessary, but does extlinux even offer what I want to do?

Furthermore, in attempts to clean up the installed packages I ran apk del linux-vanilla which also uninstalled 87 firmware packages. Decided to reinstall and decide what to do...

I don't expect to need these as this is a VM, but I'm puzzled about whether I can actually ever remove the -vanilla kernel and these associative firmware packages without harming the install.

Should I leave the vanilla kernel installed for the additional firmware packages and override to the -virt kernel somehow at boot? Or as I suspect, is it OK to simply apk del linux-vanilla and the linux-virt 5.4 LTS kernel will work indefinitely with no other ill effects from the firmware packages not being installed? Having scanned the list, it doesn't appear any which would be removed would be used by my instance but I'm not sure what unintended consequences might occur as a result of removing them.

FWIW, in the course of fixing the original Wireguard problem, the system has had installed/been upgraded with

  • linux-vanilla-4.19.118-r0
  • linux-virt-4.19.118-r0
  • linux-vanilla-dev-4.19.118-r0
  • linux-virt-5.4.38-r0 (currently running)

Forgive the relatively newbie question regarding how best to modify the , I've hunted around the internet but documentation in particular for modifying the extlinux boot screens, specifically in a compatible way for update-extlinux, seems to be lacking. Or my Google fu has deserted me...

2 Answers 2

1

I guess the best approach depends on your requirements. I don't have a full answer since I'm not an Alpine user but here is how I approached a problem that sounds similar:

I have some embedded machines running Debian with a real-time kernel. Regular kernels tend to be available with a slightly higher version number so without any additional work they will become the default kernel that gets booted. Booting a regular kernel on my embedded computers might occasionally result in subtle timing problems in our industrial environment that might result in protection mechanisms shutting down our facility. There's a considerable risk that someone might be booting the wrong kernel without noticing their mistake. So in this case I decided to uninstall all regular kernel packages on these machines. Usually I like to have a second kernel available as a fallback in case I run into a problem after upgrading the primary one but in this case I also have the ability to automatically reinstall a messed up machine within a few minutes. So I decided that the risk of having a regular kernel installed on these machines outweighs the benefits.

I decided against messing with the bootloader configuration because I like it simple and reliable - and allowing your configuration management system to modify your bootloader configuration comes with its own risks.

In your virtual environment you are probably creating backups on a regular basis so I would probably lean towards simply uninstalling kernels you don't intend to use. Debian offers virtual packages called linux-image-rt-amd64 which always depend on the latest real-time kernel (e.g. linux-image-4.19.0-8-rt-amd64). I'm installing this virtual package and remove linux-image-amd64 (without "rt"). This is easy to automate/document. On Alpine wireguard-virt seems to depend on linux-virt but not on linux-vanilla. So I would recommend to do apk del linux-vanilla without worrying about the firmware packages that get removed along with it to much (make sure to create a snapshot of your VM just in case).

1

I know this is an old one, but it hasn't been answered yet and I've been running into this issue as well and I've finally solved it:

in /etc/update-extlinux.conf, change the line

default=<...>

into whatever you want the default to be, in my case, I had to change

default=virt

to

default=edge

then run update-extlinux.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .