diff options
author | Michał Górny <mgorny@gentoo.org> | 2020-06-17 11:16:30 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2020-06-24 10:00:10 +0200 |
commit | 7da40ba722084b85cf3136fdc8b2c38fb9e1fb2b (patch) | |
tree | e0da99ae5b7e84b52ac42fe503d04ab53a9cb983 /eclass/kernel-install.eclass | |
parent | dev-python/django-otp: Bump to 0.9.3 (diff) | |
download | gentoo-7da40ba722084b85cf3136fdc8b2c38fb9e1fb2b.tar.gz gentoo-7da40ba722084b85cf3136fdc8b2c38fb9e1fb2b.tar.bz2 gentoo-7da40ba722084b85cf3136fdc8b2c38fb9e1fb2b.zip |
kernel-install.eclass: Add pkg_config() to reinstall
Add a pkg_config() phase that can be used to rebuild the initramfs
and reinstall the kernel without rebuilding the whole package.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass/kernel-install.eclass')
-rw-r--r-- | eclass/kernel-install.eclass | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass index efccd70608c0..b3ef186a74eb 100644 --- a/eclass/kernel-install.eclass +++ b/eclass/kernel-install.eclass @@ -330,7 +330,30 @@ kernel-install_pkg_postrm() { fi } +# @FUNCTION: kernel-install_pkg_config +# @DESCRIPTION: +# Rebuild the initramfs and reinstall the kernel. +kernel-install_pkg_config() { + [[ -z ${ROOT} ]] || die "ROOT!=/ not supported currently" + + mount-boot_pkg_preinst + + local image_path=$(kernel-install_get_image_path) + if use initramfs; then + # putting it alongside kernel image as 'initrd' makes + # kernel-install happier + kernel-install_build_initramfs \ + "${EROOT}/usr/src/linux-${PV}/${image_path%/*}/initrd" \ + "${PV}" + fi + + kernel-install_install_kernel "${PV}" \ + "${EROOT}/usr/src/linux-${PV}/${image_path}" \ + "${EROOT}/usr/src/linux-${PV}/System.map" +} + _KERNEL_INSTALL_ECLASS=1 fi EXPORT_FUNCTIONS src_test pkg_preinst pkg_postinst pkg_prerm pkg_postrm +EXPORT_FUNCTIONS pkg_config |