summaryrefslogtreecommitdiff
path: root/eclass/kernel-install.eclass
diff options
context:
space:
mode:
authorNowa Ammerlaan <nowa@gentoo.org>2024-12-29 21:46:40 +0100
committerMichał Górny <mgorny@gentoo.org>2025-01-02 18:08:30 +0100
commit9af7e9d11ede9c823e2904a9cf387d5e1286a4d0 (patch)
treeba55eef6b9769e5e873a941e7feb7fe484701547 /eclass/kernel-install.eclass
parenta9b25945f57ea44213913ed4796582435d011b1a (diff)
downloadgentoo-9af7e9d11ede9c823e2904a9cf387d5e1286a4d0.tar.gz
gentoo-9af7e9d11ede9c823e2904a9cf387d5e1286a4d0.tar.bz2
gentoo-9af7e9d11ede9c823e2904a9cf387d5e1286a4d0.zip
dist-kernel-utils.eclass: implement basic support for install with ROOT
Before this change the kernel installation is silently skipped in all cases. Using sys-kernel/installkernel to generate an initramfs/uki will indeed be a huge mess so when an initramfs is requested we now print a helpful error message. If we do not want an initramfs, or the initramfs/uki was generated with portage using USE=generic-uki then we can safely try to install the kernel. Installkernel-50 is capable of dealing with this situation in most cases, but it will print a bunch of warnings since plugins are skipped. Bootloader configuration, for example, cannot be updated in this case. For kernel modules we can also safely make this change, all modules that can be in the initramfs have the initramfs flag and if it is enabled then we will also hit this error message. End result of this change is more verbosity when kernel installation is skipped and basic support for installing the kernel with --root set for simple configurations (no initramfs or generic-uki with compat layout or uki layout). Signed-off-by: Nowa Ammerlaan <nowa@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/38842 Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass/kernel-install.eclass')
-rw-r--r--eclass/kernel-install.eclass8
1 files changed, 2 insertions, 6 deletions
diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass
index 5b4f3b096c41..6ca39e551110 100644
--- a/eclass/kernel-install.eclass
+++ b/eclass/kernel-install.eclass
@@ -716,9 +716,7 @@ kernel-install_pkg_postinst() {
dist-kernel_compressed_module_cleanup \
"${EROOT}/lib/modules/${KV_FULL}"
- if [[ -z ${ROOT} ]]; then
- kernel-install_install_all "${KV_FULL}"
- fi
+ kernel-install_install_all "${KV_FULL}"
if [[ ${KERNEL_IUSE_GENERIC_UKI} ]] && use generic-uki; then
ewarn "The prebuilt initramfs and unified kernel image are highly experimental!"
@@ -740,7 +738,7 @@ kernel-install_pkg_postinst() {
kernel-install_pkg_postrm() {
debug-print-function ${FUNCNAME} "$@"
- if [[ -z ${ROOT} && ! ${KERNEL_IUSE_GENERIC_UKI} ]]; then
+ if [[ ! ${KERNEL_IUSE_GENERIC_UKI} ]]; then
local kernel_dir=${EROOT}/usr/src/linux-${KV_FULL}
local image_path=$(dist-kernel_get_image_path)
ebegin "Removing initramfs"
@@ -754,8 +752,6 @@ kernel-install_pkg_postrm() {
# @DESCRIPTION:
# Rebuild the initramfs and reinstall the kernel.
kernel-install_pkg_config() {
- [[ -z ${ROOT} ]] || die "ROOT!=/ not supported currently"
-
if [[ -z ${KV_FULL} ]]; then
KV_FULL=${PV}${KV_LOCALVERSION}
fi