In case there are a lot of zfs snapshots, we end up with a huge delay
when navigating grub (eg 80 seconds, displaying a black screen, for 100
system snapshots).
Reduce the grub.cfg file size by moving the entries in a single
function with parameter instead of duplicating each entry.
Ensure the user can still easily edit them easily by naming the
parameters.
UBUNTU: efivar: Correctly handle boot order of multiple ESPs
Modify the code to insert the ESP mounted to /boot/efi (the *primary*
ESP) as the first item, but any other ESP after any other of _our_
ESPs.
So assume we have three ESPs A, B, C (_ours_), and three other
boot entries X, Y, Z. We configure A, B, and C in that order,
though some might already be in it, some examples:
XYZ -> ABCXYZ (A is added to front, B after it, C after B)
BXCYZ -> ABXCYZ (A is added to front, B and C remain unchanged)
AXCYZ -> AXCBYZ (the previously unconfigured ESP B is added after last ESP C)
Doing this requires us passing the path of the ESP directory down to
the code doing the install, so it can then check whether it was the
primary ESP - that is, mounted to /boot/efi - or not.
This is an ugly hack to get resilient boot somewhat working:
We pass in a list of all ESPS in _UBUNTU_ALTERNATIVE_ESPS, and
then we ignore those when looking for entries to change/remove.
ubuntu: Update the linux boot protocol version check.
The EFI implementation of grub_cmd_linux makes use of xloadflags which was
introduced in to version 2.12 of the kernel's boot protocol, so update the
check accordingly.
ubuntu: Make the linux command in EFI grub always try EFI handover
The previous implementation only boots via the EFI handover protocol when
secure boot is enabled. This means that disabling secure boot breaks some
features that depend on the kernel being booted via the EFI handover entry
point, such as retrieval of the TCG event log.
Update the linux command to always attempt to defer to linuxefi in EFI grub
builds, regardless of whether secure boot is enabled or not. This also allows
a fallback to the non-EFI handover path on kernels that don't support it, but
only if secure boot is disabled.
smbios: Add a --linux argument to apply linux modalias-like filtering
Linux creates modalias strings by filtering out non-ASCII, space,
and colon characters. Provide an option that does the same filtering
so people can create a modalias string in GRUB, and then match their
modalias patterns against it.
The device tree may passed by the firmware as UEFI configuration
table. Let lsefisystab display a short text and not only the GUID
for the device tree.