On Fri, 27 Sep 2019 at 09:13, Peter Humphrey <pe...@prh.myzen.co.uk> wrote:
>
> On Thursday, 26 September 2019 16:44:10 BST Mick wrote:
> > On Thu, 26 Sep 2019 at 15:47, Peter Humphrey <pe...@prh.myzen.co.uk> wrote:
> > > On Thursday, 26 September 2019 10:16:54 BST Adam Carter wrote:
>
> [Snip interesting stuff]
>
> > > > I got the impression that I would be able to UEFI boot from multiple
> > > > different devices, eg a USB drive with UEFI as well as the hard disk.
> >
> > I may be wrong, but I don't think this is possible (yet?).  You could
> > use a secondary bootloader, e.g. GRUB, other than the UEFI firmware to
> > load OS kernels wherever they might be positioned on the system.
>
> But see next:
>
> > > Oh yes, removable devices can be booted, but not secondary, internal hard
> > > drives. Apparently. On this system. Today.
>
> I can boot from USB or CD drives by entering the UEFI BIOS at boot and
> selecting the one I want to boot from - and this BIOS dates from 2014. I doubt
> this is unusual.

Sorry, my mistake - the following is what I meant to write, but in a
rush I failed to do so:

As long as you structure the ESP filesystem as per UEFI specification,
a sympathetic OEM UEFI firmware implementation will process the first
ESP on the first hard disk and list OS kernels it finds in its boot
manager menu for you to select from.  The latest UEFI specification
does not restrict the number of ESPs, or their location.  It is
unlikely the UEFI firmware will process additional ESPs on the same,
or other hard disks, or partitions which have anything other than
FAT(12,16,32) filesystems.  I seem to recall earlier OEM
implementations explicitly excluded more than one ESP on the primary
disk.  In the future the UEFI specification may evolve to include more
than one ESP or FAT partitions, perhaps even with/without the ESP GUID
being set.

Removable devices with an ESP structured as per UEFI specification
will also be probed and their primary (default) bootable kernel listed
by the UEFI firmware.  Selecting a listed removable device from within
the UEFI boot menu will boot it, as you observed.

If you want more than one kernel per OS subdirectory to be listed in
the UEFI boot manager's menu, you will need to add them in the desired
order using the efibootmgr command.  Otherwise, the UEFI firmware will
not behave predictably in which of these kernels it selects to list in
its boot menu.

As I understand it, 'bootctl --update' can be used to update
systemd-boot boot manager's menu and it is looking for bootable
kernels by scanning /efi, /boot, and /boot/efi, or the directory set
by passing the '--path' option to it.  Manual addition of bootable
kernels must be set via /loader/entries/*.conf (one file per kernel
image) and then setting the default kernel to be booted in
/loader/loader.conf.  I find all this to be unnecessary complication
for maintaining a boot manager manually, compared to using say
efibootmgr.  However, it is handy to be able to press 'e' to edit the
default entry at boot time, or if new kernels are always stored where
expected by the scripts of binary distros.

For Peter's use case, OS and kernel resides on secondary disk, the
solutions I can think are:

1. Use GRUB.  The UEFI firmware will load the GRUB efi image, which
will load the desired kernel and OS wherever it might reside.
Secondary disks and non-FAT filesystems are not a problem, because
GRUB has various fs drivers and will probe additional devices.
Following installation maintenance is minimal compared to other
options.

2. Use systemd-boot.  Copy each kernel from the secondary disk to
/boot/EFI/ creating the corresponding /loader/entries/*.conf, adding
the kernel .conf name and the OS root partition's path on the
secondary disk.  The root path can also/instead be included in the
kernel itself (CONFIG_CMDLINE).

3. Use some other boot manager (e.g. rEFInd, ELILO).

4. Use efibootmgr after you copy the kernel from the secondary disk to
the ESP in a corresponding OS subdirectory.  The root path should be
included in the kernel.

I hope the above clarifies my previous post.
--
Regards,
Mick

Reply via email to