On Monday, 28 October 2019 12:52:35 GMT Peter Humphrey wrote:
> On Saturday, 26 October 2019 17:31:28 GMT Mick wrote:
> > If your intention is to use systemd- boot as the Boot Manager of choice, I
> > would try moving all kernels and associated files to your /boot/<machine-
> > id>/ subdirectory.
> > 
> > Then create corresponding /boot/loader/entries/*.conf files, which
> > according to the systemd boot loader specification should be named like
> > so:
> > 
> > /boot/loader/entries/4eec63dc92f83de25e1e2e485d7f6536-4.19.72-gentoo.conf
> > 
> > /boot/loader/entries/<machine-id>-<kernel_version>.<os-release-ID>.conf
> > 
> > For <kernel_version> use the output of 'uname -r'.
> > 
> > For <os-release-ID> use the ID field of /etc/os-release.  You may 'find
> > uname -r' and os-release-ID are the same on your Gentoo installation.
> > 
> > The contents of the file should look like so:
> > 
> > title        08-gentoo-4.19.72-rescue (My rescue kernel)
> > version      4.19.72-gentoo
> > machine-id   4eec63dc92f83de25e1e2e485d7f6536
> > options      root=/dev/nvme0n1p4 net.ifnames=0
> > architecture x64
> > linux        /4eec63dc92f83de25e1e2e485d7f6536/4.19.72-gentoo/linux
> > initrd       /4eec63dc92f83de25e1e2e485d7f6536/4.19.72-gentoo/initrd
> > 
> > For 'title' you can use the PRETTY_NAME in /etc/os-release, or whatever
> > you
> > want displayed in the boot menu to differentiate visibly this menu entry
> > from all others.
> > 
> > For 'version' you can use the kernel version you want to boot with, but it
> > is an optional field.
> > 
> > Machine-id is also optional, but it helps to differentiate between various
> > installations.
> > 
> > 'linux' and 'initrd' fields show the relative path(s) where your vmlinuz
> > and initrd.img files are stored.
> > 
> > I hope the above works for you with systemd-boot and helps customise its
> > boot menu to your liking.
> 
> Thanks for the advice. I've also read the Boot Loader Specification [1] :)
> 
> The scheme you and it outline seem not to allow me to create menu entries
> that use the same kernel but with different options, such as run level.
> That's one reason why I didn't use that approach.

As I understood when I read the same standard, you can add any options you 
need next to the "options" field in the respective entries/*.conf files.

Everything else, other than "title" can remain the same, booting the same 
kernel/initrd.

You should be able to boot:

The installation (machine-id: 4eec63dc92f83de25e1e2e485d7f6536) with the 
kernel specified in:

linux        /4eec63dc92f83de25e1e2e485d7f6536/4.19.72-gentoo/linux

or, some different fs installation (different machine-id) still with the same 
kernel line as above;

and/or, using the same "options" line or a different one.  You should be able 
to combine any fs installation, kernel and options you want to boot and have 
it listed in the systemd-boot menu using a title of your choice.

Of course it would make sense to use a different title for each boot menu.  
However, I think you could even use the same title for different kernel 
versions on the same installation, and the most recent version will be listed 
at the top.


> The other was its reader-
> unfriendliness - why use a simple, descriptive name when you could use a
> 32- digit hex string instead?

I suspect because systemd devs did not have at the forefront of their minds 
Peter's use case, but the kernel post-install scripts of binary distros.  I 
understand the intention of the systemd-boot creators was to allow any kernels 
to be dropped in /boot/<machine-id/, then parsed and added to the systemd-boot 
menu.

-- 
Regards,

Mick

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to