summaryrefslogtreecommitdiff
path: root/sys-kernel/installkernel
diff options
context:
space:
mode:
Diffstat (limited to 'sys-kernel/installkernel')
-rw-r--r--sys-kernel/installkernel/Manifest10
-rw-r--r--sys-kernel/installkernel/installkernel-39-r2.ebuild (renamed from sys-kernel/installkernel/installkernel-38.ebuild)28
-rw-r--r--sys-kernel/installkernel/installkernel-48-r1.ebuild (renamed from sys-kernel/installkernel/installkernel-28.ebuild)85
-rw-r--r--sys-kernel/installkernel/metadata.xml3
4 files changed, 111 insertions, 15 deletions
diff --git a/sys-kernel/installkernel/Manifest b/sys-kernel/installkernel/Manifest
index 0c4566aed9f0..cb5dc61f3d1f 100644
--- a/sys-kernel/installkernel/Manifest
+++ b/sys-kernel/installkernel/Manifest
@@ -1,5 +1,5 @@
-DIST installkernel-28.tar.gz 18922 BLAKE2B 26e7b073cd44896f830a8977efb9730b92d01074084a3cfc934719de87bbf6ec25ea865f8b1cd88613279dbb83bb9ad72eb2c90bc0f6152aa0cc11ca71a9963a SHA512 5a0ed452e131d85628c1cf6ecc2a6bb9fe3c9f20c999c9919b3e238d1aa09a114c6086cf5de8d3ecf63cfa80fd2804092ebb8ad6505b51df2786eb3037bdf3f0
-DIST installkernel-38.tar.gz 20987 BLAKE2B 64937dad646b4736555bd9cdeb575d37fb40764a97ba0429136172b268429d05c4df8317862fb8004538f0a3e6bba953123a30cd89fe67812a6624ff2d57b5c6 SHA512 2f6576bc04be7dd22a3c47460caa7b2da526ad7239cd99766756a03e74299d7d980a3cab2951713d7313af32fa58d1cb95d121617b091cfe9eac18d77c347c39
-EBUILD installkernel-28.ebuild 4902 BLAKE2B b2c7826d18637206cca65638290fdc43aa3ca1b6753005e8acbd6fe99a8c635730b07ab75b6e22cce2829720b2627b96bdbda72a1654ab0c3c3a335f60ee06eb SHA512 5adc536c0baadbcc2e8e17adfaffbd68a94219acf4989b8561b1433c1954fc0ab35457be9194390be9da71fd10ebd68595ff04c92ed30ffee8f9c79f8940ed6d
-EBUILD installkernel-38.ebuild 5637 BLAKE2B cf4ab530b6f57ab0fadf0d85ab4ddd349e6f3c9aa00bef165677da0d6c4b3460ccf34dcc557d5713444966dfe2bcda26e7bc4f4a05e77f56404b0eb8c90a7e0a SHA512 9fbff26240bd8e6fcca3c9456c786e8ab4f3fee697ba23ea91720d46f27b3807da370ed9aa1b7b855e18436ec6059b6411a8672c6f2afaddefc6123504503d88
-MISC metadata.xml 1288 BLAKE2B a80d5022072c362c1787723b7222638f01993675f5c3bbc87962d998497dcd1673664ef4802cb8b3bce7ad81825521be1747c00f6ef5f5e1c9e2d976b09c8d85 SHA512 d51a5b1c5977049a9a499c2f7edcd95ea5e2b47c4fb49fa76d3df9839b2ad7652bbfff41fae823da3b86a52f2b9cb120759a15e5e9967e7b1148ea3bc92ed793
+DIST installkernel-39.tar.gz 21689 BLAKE2B 22c76e735fb9849ff2b2daf44d428568435495251960e0f518ab12167d57c31bba670738fd51c4d564f95adcfcbf60b5324d048a1f6bd7ebf9d1b5258f0371b3 SHA512 5a5d2035fa737ede3aa9e668ac18d1777f77f15a38fb685e3e488cc06ef5da99d55789e8e5770e056025f224ff5a5ec57e75fa08cf6f3ec3a0b9dabdfe6fefaa
+DIST installkernel-48.tar.gz 25079 BLAKE2B 73bf66071dc7dd76afd1ee42d4c3528430f2b00e38c94ff274d6af78c302243fe33959b721c29435819feeed56d94fb1d6f9381b92d8718acee1d9934cfbf5b8 SHA512 302ec0657564dfe3f8d02f564f39a1d7203dcb81d9dd748d3b0b30b0c73b8e9d94758f53076d7b685f57f2a3beeec1a75ad5f807b91200a2f0a2de5510191cb1
+EBUILD installkernel-39-r2.ebuild 6609 BLAKE2B 3771de41d1b828f04606742669e2bc7b811526bb12edcf4757fb3111b469b72a538b3593045684c3cbefa7c4c9201630b7fe52cb0a0068c7018d282f587fcde8 SHA512 b53e9b3c7625cdce03490c57f38a7d62a78e253f732e57a2ec7249b2b40a0f268ba17dca33d36d385dae8aca4f07076fb449c4f60b28d3a157cd68686da336f5
+EBUILD installkernel-48-r1.ebuild 7384 BLAKE2B 3f354f706e32ffc31600c3e43d407282b1b651629af099d372e80349ba39301abd17d7ffc9eb5fca25ef38799cbf2f0a7d479ce22496414d4c95c4e59d7368ce SHA512 c32361903061ecac3a31325f8cd7032c260a93aafeb33d57c8c4a9e1979a3af5cb733f5b415f9a282748dbfdc1b607aec424c22d28c1f6750d535e3a921de040
+MISC metadata.xml 1379 BLAKE2B c141302cfe1dddf7d11d68cafdf97437f037caab171b1c1b071cc366b6a98acb5940c1ab73bcc49bf97fe9c852ad28c8923fbf00f0a51f2a02174a5d542f9edf SHA512 f5a20936b0b569fd2a8eadb76eeb8d7ec8c905b0e15ae285c351d82bef0c001e64d47a19774a6b958b845a20adc3df5e7cc583649dfcf9ef7c684132498e8bf8
diff --git a/sys-kernel/installkernel/installkernel-38.ebuild b/sys-kernel/installkernel/installkernel-39-r2.ebuild
index 293828ee0c57..2b11a30d57c5 100644
--- a/sys-kernel/installkernel/installkernel-38.ebuild
+++ b/sys-kernel/installkernel/installkernel-39-r2.ebuild
@@ -16,13 +16,32 @@ S="${WORKDIR}/${PN}-gentoo-${PV}"
LICENSE="GPL-2+"
SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x86-linux"
-IUSE="dracut efistub grub refind systemd systemd-boot uki ukify"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x86-linux"
+IUSE="dracut efistub grub refind systemd systemd-boot ugrd uki ukify"
REQUIRED_USE="
+ ?? ( efistub grub systemd-boot )
+ refind? ( !systemd-boot !grub )
systemd-boot? ( systemd )
ukify? ( uki )
- ?? ( efistub grub refind systemd-boot )
+ ?? ( dracut ugrd )
"
+# Only select one flag that sets "layout=", except for uki since grub,
+# systemd-boot, and efistub booting are all compatible with UKIs and
+# the uki layout.
+#
+# Refind does not set a layout=, it is compatible with the compat, uki
+# and efistub layout. So block against only grub and systemd-boot.
+#
+# systemd-boot could be made to work without the systemd flag, but this
+# makes no sense since in systemd(-utils) the boot flag already
+# requires the kernel-install flag.
+#
+# Ukify hooks do nothing if the layout is not uki, so force this here.
+#
+# Only one initramfs generator flag can be selected. Note that while
+# both dracut and ukify are UKI generators we don't block those because
+# enabling both results in building an initramfs only with dracut and
+# building an UKI with ukify, which is a valid configuration.
RDEPEND="
!<=sys-kernel/installkernel-systemd-3
@@ -59,6 +78,7 @@ RDEPEND="
sys-apps/systemd-utils[boot(-),ukify(-)]
)
)
+ ugrd? ( sys-kernel/ugrd )
!=sys-apps/systemd-255.2-r1
!=sys-apps/systemd-255.2-r0
!~sys-apps/systemd-255.1
@@ -123,6 +143,8 @@ src_install() {
echo "uki_generator=none" >> "${T}/install.conf" || die
fi
fi
+ elif use ugrd; then
+ echo "initrd_generator=ugrd" >> "${T}/install.conf" || die
else
echo "initrd_generator=none" >> "${T}/install.conf" || die
fi
diff --git a/sys-kernel/installkernel/installkernel-28.ebuild b/sys-kernel/installkernel/installkernel-48-r1.ebuild
index 3e1edca83f72..f41ce9300a2e 100644
--- a/sys-kernel/installkernel/installkernel-28.ebuild
+++ b/sys-kernel/installkernel/installkernel-48-r1.ebuild
@@ -3,6 +3,8 @@
EAPI=8
+inherit linux-info
+
DESCRIPTION="Gentoo fork of installkernel script from debianutils"
HOMEPAGE="
https://github.com/projg2/installkernel-gentoo
@@ -14,18 +16,37 @@ S="${WORKDIR}/${PN}-gentoo-${PV}"
LICENSE="GPL-2+"
SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x86-linux"
-IUSE="dracut grub refind systemd systemd-boot uki ukify"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x86-linux"
+IUSE="dracut efistub grub refind systemd systemd-boot ugrd uki ukify"
REQUIRED_USE="
+ ?? ( efistub grub systemd-boot )
+ refind? ( !systemd-boot !grub )
systemd-boot? ( systemd )
ukify? ( uki )
- ?? ( grub refind systemd-boot )
+ ?? ( dracut ugrd )
"
+# Only select one flag that sets "layout=", except for uki since grub,
+# systemd-boot, and efistub booting are all compatible with UKIs and
+# the uki layout.
+#
+# Refind does not set a layout=, it is compatible with the compat, uki
+# and efistub layout. So block against only grub and systemd-boot.
+#
+# systemd-boot could be made to work without the systemd flag, but this
+# makes no sense since in systemd(-utils) the boot flag already
+# requires the kernel-install flag.
+#
+# Ukify hooks do nothing if the layout is not uki, so force this here.
+#
+# Only one initramfs generator flag can be selected. Note that while
+# both dracut and ukify are UKI generators we don't block those because
+# enabling both results in building an initramfs only with dracut and
+# building an UKI with ukify, which is a valid configuration.
RDEPEND="
!<=sys-kernel/installkernel-systemd-3
dracut? (
- >=sys-kernel/dracut-060_pre20240104-r1
+ >=sys-kernel/dracut-060_pre20240104-r4
uki? (
|| (
sys-apps/systemd[boot(-)]
@@ -33,6 +54,10 @@ RDEPEND="
)
)
)
+ efistub? (
+ systemd? ( >=app-emulation/virt-firmware-24.2_p20240315-r2 )
+ !systemd? ( sys-boot/uefi-mkconfig )
+ )
grub? ( sys-boot/grub )
refind? ( sys-boot/refind )
systemd? (
@@ -53,6 +78,7 @@ RDEPEND="
sys-apps/systemd-utils[boot(-),ukify(-)]
)
)
+ ugrd? ( sys-kernel/ugrd )
!=sys-apps/systemd-255.2-r1
!=sys-apps/systemd-255.2-r0
!~sys-apps/systemd-255.1
@@ -63,24 +89,38 @@ RDEPEND="
!<=sys-apps/systemd-254.5-r1
" # Block against systemd that still installs dummy install.conf
+pkg_setup() {
+ use efistub && CONFIG_CHECK="EFI_STUB" linux-info_pkg_setup
+}
+
src_install() {
- keepdir /etc/kernel/postinst.d
+ keepdir /etc/kernel/install.d
keepdir /etc/kernel/preinst.d
+ keepdir /etc/kernel/postinst.d
+ keepdir /usr/lib/kernel/install.d
+ keepdir /usr/lib/kernel/preinst.d
+ keepdir /usr/lib/kernel/postinst.d
exeinto /usr/lib/kernel/preinst.d
+ doexe hooks/99-check-diskspace.install
use dracut && doexe hooks/50-dracut.install
use ukify && doexe hooks/60-ukify.install
exeinto /usr/lib/kernel/postinst.d
- use uki && doexe hooks/90-uki-copy.install
+ doexe hooks/99-write-log.install
use grub && doexe hooks/91-grub-mkconfig.install
+ use efistub && doexe hooks/95-efistub-uefi-mkconfig.install
use refind && doexe hooks/95-refind-copy-icon.install
exeinto /usr/lib/kernel/install.d
doexe hooks/systemd/00-00machineid-directory.install
doexe hooks/systemd/10-copy-prebuilt.install
+ doexe hooks/systemd/85-check-diskspace.install
doexe hooks/systemd/90-compat.install
+ doexe hooks/systemd/90-zz-update-static.install
+ doexe hooks/systemd/99-write-log.install
use grub && doexe hooks/systemd/91-grub-mkconfig.install
+ use efistub && doexe hooks/systemd/95-efistub-kernel-bootcfg.install
use refind && doexe hooks/systemd/95-refind-copy-icon.install
if use systemd; then
@@ -93,6 +133,8 @@ src_install() {
echo "# This file is managed by ${CATEGORY}/${PN}" >> "${T}/install.conf" || die
if use uki; then
echo "layout=uki" >> "${T}/install.conf" || die
+ elif use efistub; then
+ echo "layout=efistub" >> "${T}/install.conf" || die
elif use grub; then
echo "layout=grub" >> "${T}/install.conf" || die
elif use systemd-boot; then
@@ -110,6 +152,8 @@ src_install() {
echo "uki_generator=none" >> "${T}/install.conf" || die
fi
fi
+ elif use ugrd; then
+ echo "initrd_generator=ugrd" >> "${T}/install.conf" || die
else
echo "initrd_generator=none" >> "${T}/install.conf" || die
fi
@@ -125,6 +169,10 @@ src_install() {
insinto /usr/lib/kernel
doins "${T}/install.conf"
+ insinto /etc/logrotate.d
+ newins installkernel.logrotate installkernel
+ keepdir /var/lib/misc
+
into /
dosbin installkernel
doman installkernel.8
@@ -163,4 +211,29 @@ pkg_postinst() {
elog "update systemd-boot's configuration on each kernel install."
fi
fi
+
+ if use efistub; then
+ ewarn "Automated EFI Stub booting is highly experimental. UEFI implementations"
+ ewarn "often differ between vendors and as a result EFI stub booting is not"
+ ewarn "guaranteed to work for all UEFI systems. Ensure an alternative method"
+ ewarn "of booting the system is available before rebooting."
+ fi
+
+ # Initialize log file if there is none
+ local log=${ROOT}/var/log/installkernel.log
+ if [[ ! -f ${log} ]]; then
+ echo -e \
+"DATE\t"\
+"KI_VENDOR\t"\
+"VERSION\t"\
+"CONF_ROOT\t"\
+"LAYOUT\t"\
+"INITRD_GEN\t"\
+"UKI_GEN\t"\
+"BOOT_ROOT\t"\
+"KERNEL_REL_PATH\t"\
+"INITRD_REL_PATH\t"\
+"PLUGIN_OVERRIDE\t"\
+>> "${log}" || die
+ fi
}
diff --git a/sys-kernel/installkernel/metadata.xml b/sys-kernel/installkernel/metadata.xml
index ba5cbd9d6764..70634cd58829 100644
--- a/sys-kernel/installkernel/metadata.xml
+++ b/sys-kernel/installkernel/metadata.xml
@@ -6,12 +6,13 @@
<name>Distribution Kernel Project</name>
</maintainer>
<use>
- <flag name="dracut">Generate an initrd or UKI on each kernel installation</flag>
+ <flag name="dracut">Generate an initramfs or UKI on each kernel installation</flag>
<flag name="efistub">EXPERIMENTAL: Update UEFI configuration on each kernel installation</flag>
<flag name="grub">Re-generate grub.cfg on each kernel installation, used grub.cfg is overridable with GRUB_CFG env var</flag>
<flag name="refind">Install a Gentoo icon for rEFInd alongside the (unified) kernel image, used icon is overridable with REFIND_ICON env var</flag>
<flag name="systemd">Use systemd's kernel-install to install kernels, overridable with SYSTEMD_KERNEL_INSTALL env var</flag>
<flag name="systemd-boot">Use systemd-boot's native layout by default</flag>
+ <flag name="ugrd">Generate an initramfs using UGRD on each kernel installation</flag>
<flag name="uki">Install UKIs to ESP/EFI/Linux for EFI stub booting and/or bootloaders with support for auto-discovering UKIs</flag>
<flag name="ukify">Build an UKI with systemd's ukify on each kernel installation</flag>
</use>