I set up a triple boot system on btrfs
, and have arch, xenial, and bionic like so:
- encrypted
btrfs
container - each has a dedicated
btrfs subvol
for it's own root - shared unencrypted
/boot
between the three
I've een using this setup for arch and xenial for more than a year and it's been great. Now that I've added bionic, I have slight worries about the naming of the kernel and initrd. For example:
$ ls /boot
initramfs-linux.img # arch; no problems here
initrd.img-4.13.0-39-generic # xenial
initrd.img-4.15.0-20-generic # bionic
vmlinuz-linux # arch
vmlinuz-4.13.0-39-generic # xenial
vmlinuz-4.15.0-20-generic # bionic
Maybe bionic names will never conflict with xenial, but maybe they will.
I'm wondering if there's a hook or config file somewhere that could set the default name of these files without me having to compile my own. Basically, some way to act like CONFIG_LOCALVERSION
or EXTRAVERSION
was passed? Or a hook that could intercept the default file names and append something else?
I maintain my own bootloader (rEFInd
now), I don't have worries about that aspect (some may foresee concerns syncing up what I'm asking with grub
, for example).
As an aside, I'm open to other solutions. I think the general case is "How do I have several distro boot files co-exist in one partition?" I mention this as I just stumbled on this post, which is about setting a subdirectory, not changing the names. Using paths to separate these would work great as well. Maybe that's described in initramfs-tools, but it's not clear to me [yet].
I can't post a comment that gets at the primary answer well enough, so I'm adding this to address the primary response so far:
You can't change the names for Ubuntu kernels because so many programs refers back to the original names.
This is followed by the use of locate
to show how many times in the filesystem the kernel version string is used.
I'm writing from Ubuntu xenial booted with the following refind.conf
entry:
$ cat /boot/efi/EFI/refind/refind.conf
menuentry "xenial" {
icon /EFI/refind/icons/os_ubuntu.png
volume 4bdcd743-9d09-2f41-9379-e5491e79ae9d
loader /vmlinuz-foo
initrd /initrd-foo
options "root=UUID=xxxx rootflags=compress=lzo,discard,ssd,subvol=xenial nomodeset $vt_handoff add_efi_memmap ro"
}
To do this, I did:
$ cd /boot
$ sudo mv initrd.img-4.13.0-39-generic initrd-foo
$ sudo mv vmlinuz-4.13.0-39-generic vmlinuz-foo
The filename itself doesn't matter, as the kernel version is in the kernel:
$ uname -a
Linux roboxenial 4.13.0-39-generic #44~16.04.1-Ubuntu SMP Thu Apr 5 16:43:10 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
So... I can run from any filename I want. The questions still remains if there is a way to have every kernel name changed in some way during installation/upgrade (like a hook). This could be a convention (e.g. initrd-xenial
), suffix (initrd.img-4.13.0-39-generic_xenial
) or otherwise.
/boot/vmlinuz-xenial
to it's most recent versioned instance, for example. If it always wasfoo-xenial
that would avoid me having to do that. – Hendy Apr 30 '18 at 15:31