diff options
author | Andrew Ammerlaan <andrewammerlaan@gentoo.org> | 2024-01-13 08:43:23 +0100 |
---|---|---|
committer | Andrew Ammerlaan <andrewammerlaan@gentoo.org> | 2024-01-13 08:43:23 +0100 |
commit | 107adc53bf7ee8319dab6c2b6724556b68e2f0fd (patch) | |
tree | b0eaaabe0c02e69885512396b06a655dc32db671 /sys-kernel | |
parent | profiles/arch: mask installkernel[grub] where there is no grub (diff) | |
download | gentoo-107adc53bf7ee8319dab6c2b6724556b68e2f0fd.tar.gz gentoo-107adc53bf7ee8319dab6c2b6724556b68e2f0fd.tar.bz2 gentoo-107adc53bf7ee8319dab6c2b6724556b68e2f0fd.zip |
sys-kernel/installkernel: add 15
Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
Diffstat (limited to 'sys-kernel')
-rw-r--r-- | sys-kernel/installkernel/Manifest | 1 | ||||
-rw-r--r-- | sys-kernel/installkernel/installkernel-15.ebuild | 113 |
2 files changed, 114 insertions, 0 deletions
diff --git a/sys-kernel/installkernel/Manifest b/sys-kernel/installkernel/Manifest index fd2621827d37..dd6aaa2ea683 100644 --- a/sys-kernel/installkernel/Manifest +++ b/sys-kernel/installkernel/Manifest @@ -1,2 +1,3 @@ DIST installkernel-12.tar.gz 4385 BLAKE2B 2f55442d76020cfcd42fb83f14ff1f517dcbbd102c338e84f092d56ba513c02644401b3b75ee7c45c8e763eb0e27225bbfe6576bc4e34841694076d935328c9a SHA512 b5620bf7a36081da929645d112a9160f89f1de09c00d3b6093efbe57d8ff1a5ebcd0b65e68491d225f61b7732bce8f76ff8baecd24969715f40dc818e4302de2 DIST installkernel-14.tar.gz 5501 BLAKE2B cf7b47483440ec84f8aa17e1c6e585259ff13cf9ff76c89a262799c5143f3f994c0babe5f6ab0abf25f1a359ba3ea39e0027eb2df6c6b2c7a8627dab550f6504 SHA512 f6af5ee009738fa503b575d3464494c8296b3b986ac9b8fab074f38f98159209b4d2ce0cf555890d5bfcfa506ab08d334af97798f695d895863bcb68b3ecea66 +DIST installkernel-15.tar.gz 5485 BLAKE2B c80aaf96c74eed23f13f2825839daeb9d44d1f721b35270ed4dd587858a9b43edaa958965a97b6381f58c24d137094c4b80f880b4e114dff621bdc6dc51f47d6 SHA512 352478323d76ec9b74e4ff1a42555a65292e9a262907dc3dfe08ee0c8613fa1d9618d2f3c1de9ab02551be67fc107d8c0212e462e46b6d6ce065c2f1628067f0 diff --git a/sys-kernel/installkernel/installkernel-15.ebuild b/sys-kernel/installkernel/installkernel-15.ebuild new file mode 100644 index 000000000000..99a5eec37735 --- /dev/null +++ b/sys-kernel/installkernel/installkernel-15.ebuild @@ -0,0 +1,113 @@ +# Copyright 2019-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="Gentoo fork of installkernel script from debianutils" +HOMEPAGE="https://github.com/projg2/installkernel-gentoo" +SRC_URI="https://github.com/projg2/installkernel-gentoo/archive/v${PV}.tar.gz + -> ${P}.tar.gz" +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 systemd uki ukify" + +RDEPEND=" + !<=sys-kernel/installkernel-systemd-3 + >=sys-apps/debianutils-4.9-r1 + dracut? ( >=sys-kernel/dracut-059-r4 ) + grub? ( sys-boot/grub ) + systemd? ( + || ( + sys-apps/systemd[kernel-install(-)] + sys-apps/systemd-utils[kernel-install(-)] + ) + ) + ukify? ( + || ( + sys-apps/systemd[ukify(-)] + sys-apps/systemd-utils[ukify(-)] + ) + ) +" + +src_install() { + keepdir /etc/kernel/postinst.d + keepdir /etc/kernel/preinst.d + + if use dracut; then + exeinto /etc/kernel/preinst.d + doexe hooks/50-dracut.install + fi + + if use grub; then + exeinto /etc/kernel/postinst.d + doexe hooks/91-grub-mkconfig.install + fi + + if use uki; then + exeinto /etc/kernel/postinst.d + doexe hooks/90-uki-copy.install + fi + + if use ukify; then + exeinto /etc/kernel/preinst.d + doexe hooks/60-ukify.install + fi + + if use systemd; then + sed -e 's/${SYSTEMD_KERNEL_INSTALL:=0}/${SYSTEMD_KERNEL_INSTALL:=1}/g' -i installkernel || + die "enabling systemd's kernel-install failed" + fi + + # set some default config using the flags we have anyway + touch "${T}/install.conf" || die + if use uki; then + echo "layout=uki" >> "${T}/install.conf" || die + elif use grub; then + echo "layout=grub" >> "${T}/install.conf" || die + else + echo "layout=bls" >> "${T}/install.conf" || die + fi + + if use dracut; then + echo "initrd_generator=dracut" >> "${T}/install.conf" || die + if ! use ukify; then + echo "uki_generator=dracut" >> "${T}/install.conf" || die + fi + else + echo "initrd_generator=none" >> "${T}/install.conf" || die + fi + + if use ukify; then + echo "uki_generator=ukify" >> "${T}/install.conf" || die + else + if ! use dracut; then + echo "uki_generator=none" >> "${T}/install.conf" || die + fi + fi + + insinto /etc/kernel + doins "${T}/install.conf" + + exeinto /usr/lib/kernel/install.d + doexe hooks/systemd/*.install + + into / + dosbin installkernel + doman installkernel.8 +} + +pkg_postinst() { + elog "Version 14 and up of ${PN} effectively merges" + elog "${PN}-gentoo and ${PN}-systemd." + elog "Switching between the traditional installkernel and systemd's" + elog "kernel-install is controlled with the systemd USE flag or the" + elog "SYSTEMD_KERNEL_INSTALL environment variable." + elog + elog "See the installkernel wiki page[1] for more details." + elog + elog "https://wiki.gentoo.org/wiki/Installkernel" +} |