commit:     0a05585bfc3f37c69d8b694205339499860a0b42
Author:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 20 19:08:06 2023 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Thu Jun 22 06:28:02 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0a05585b

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 <AT> gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/31559
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>

 ...temd-boot-2-r2-00-00machineid-directory.install | 32 ++++++++++++++++++++
 .../installkernel-systemd-boot-2-r2.ebuild         | 34 ++++++++++++++++++++++
 2 files changed, 66 insertions(+)

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
+}

Reply via email to