summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Ammerlaan <andrewammerlaan@gentoo.org>2023-06-20 21:08:06 +0200
committerAndrew Ammerlaan <andrewammerlaan@gentoo.org>2023-06-22 08:28:02 +0200
commit0a05585bfc3f37c69d8b694205339499860a0b42 (patch)
tree42c7a232644c6955cd6dcc6b166a04e05cfebaea /sys-kernel/installkernel-systemd-boot
parentvirtual/perl-Module-CoreList: Stabilize 5.202.304.230 sparc, #908983 (diff)
downloadgentoo-0a05585bfc3f37c69d8b694205339499860a0b42.tar.gz
gentoo-0a05585bfc3f37c69d8b694205339499860a0b42.tar.bz2
gentoo-0a05585bfc3f37c69d8b694205339499860a0b42.zip
sys-kernel/installkernel-systemd-boot: no mkdir machineid if using uki
Uki's are installed to ESP/Linux, we don't need this empty directory Plus an EAPI bump while we are touching the package Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/31559 Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
Diffstat (limited to 'sys-kernel/installkernel-systemd-boot')
-rw-r--r--sys-kernel/installkernel-systemd-boot/files/installkernel-systemd-boot-2-r2-00-00machineid-directory.install32
-rw-r--r--sys-kernel/installkernel-systemd-boot/installkernel-systemd-boot-2-r2.ebuild34
2 files changed, 66 insertions, 0 deletions
diff --git a/sys-kernel/installkernel-systemd-boot/files/installkernel-systemd-boot-2-r2-00-00machineid-directory.install b/sys-kernel/installkernel-systemd-boot/files/installkernel-systemd-boot-2-r2-00-00machineid-directory.install
new file mode 100644
index 000000000000..5fa3bbeffc04
--- /dev/null
+++ b/sys-kernel/installkernel-systemd-boot/files/installkernel-systemd-boot-2-r2-00-00machineid-directory.install
@@ -0,0 +1,32 @@
+#!/usr/bin/env sh
+
+# this file is installed by sys-kernel/installkernel-systemd-boot
+
+COMMAND="${1}"
+ENTRY_DIR_ABS="${3}"
+
+# this is exported by kernel-install
+if [ -z "${KERNEL_INSTALL_MACHINE_ID}" ]; then
+ exit 0
+fi
+
+if [ "${KERNEL_INSTALL_LAYOUT}" = "uki" ]; then
+ exit 0
+fi
+
+if [ "${COMMAND}" != "add" ]; then
+ exit 0
+fi
+
+# If the machine-id dir does not exist (e.g. $ESP/<machine-id>)
+# create it. It receives values directly from kernel-install.
+# This is the only function of this plugin.
+MACHINE_ID_DIR="${ENTRY_DIR_ABS%/*}"
+if ! [ -d "${MACHINE_ID_DIR}" ]; then
+ if [ "${KERNEL_INSTALL_VERBOSE}" = "1" ]; then
+ echo "+mkdir -v -p ${MACHINE_ID_DIR}"
+ mkdir -v -p "${MACHINE_ID_DIR}"
+ else
+ mkdir -p "${MACHINE_ID_DIR}"
+ fi
+fi
diff --git a/sys-kernel/installkernel-systemd-boot/installkernel-systemd-boot-2-r2.ebuild b/sys-kernel/installkernel-systemd-boot/installkernel-systemd-boot-2-r2.ebuild
new file mode 100644
index 000000000000..ddf32065d8d1
--- /dev/null
+++ b/sys-kernel/installkernel-systemd-boot/installkernel-systemd-boot-2-r2.ebuild
@@ -0,0 +1,34 @@
+# Copyright 2019-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Wrap kernel-install from systemd-boot as installkernel"
+HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage"
+S="${WORKDIR}"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
+
+RDEPEND="
+ !sys-kernel/installkernel-gentoo
+ || (
+ sys-apps/systemd
+ sys-apps/systemd-utils[boot]
+ )
+"
+
+src_install() {
+ # we could technically use a symlink here but it would require
+ # us to know the correct path, and that implies /usr merge problems
+ into /
+ newsbin - installkernel <<-EOF
+ #!/usr/bin/env sh
+ exec kernel-install add "\${1}" "\${2}"
+ EOF
+
+ exeinto /usr/lib/kernel/install.d/
+ newexe "${FILESDIR}/${PF}-00-00machineid-directory.install" \
+ 00-00machineid-directory.install
+}