Part of: https://github.com/gentoo/gentoo/pull/37292
This series builds on the previous patch: "kernel-build.eclass: identify
dist-kernels, and warn users"
Effectively, the change amounts to harmonizing the way ebuilds/eclasses
using "dist-kernel_reinstall_initramfs" re-install the dist-kernel with
how kernel-install.eclass installs the dist-kernel. Specifically in the
area's of a) checking mounting status of /boot and b) handeling failure
in /sbin/installkernel.
This addresses an annoying issue new users run into where linux-firmware
and intel-microcode packages are too strict in enforcing mounted /boot.
To achieve this:
- Error handling and mount-boot checking is moved from
kernel-install.eclass to dist-kerel-utils.eclass
- In the above we run into the problem that mount-boot.eclass exports
pkg_pretend and pkg_{pre,post}{inst,rm}. Whereas dist-kernel-utils
exports nothing. To resolved the problem the bulk of mount-boot.eclass
is moved into a new "inherit-safe" mount-boot-utils.eclass, which in
turn is inherited by mount-boot.eclass for backwards compatibility.
- The new mount-boot-utils.eclass is adjusted to check not only for
mounted /boot, but also for a mounted EFI System Partition on UEFI systems.
- linux-mod-r1.eclass is adjusted to perform the mount-boot check early
for packages that install modules into the initramfs (currently only
zfs-kmod). We use pkg_setup instead of the usual pkg_pretend to avoid
exporting a new phase. The check is nonfatal, i.e. only informative, the
same way it is when installing the kernel (via kernel-install.eclass)
- linux-firmware and intel-microcode ebuilds are adjusted to be less
strict about mounted /boot in the USE=dist-kernel case. This mirrors how
kernel (re-)installation works in
kernel-install.eclass/linux-mod-r1.eclass, i.e. nonfatal informative
warning early, and only hard fail in pkg_postinst with informative
message on how users can trigger kernel re-installation manually.