summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgy Yakovlev <gyakovlev@gentoo.org>2021-06-10 21:35:06 -0700
committerGeorgy Yakovlev <gyakovlev@gentoo.org>2021-06-26 15:02:30 -0700
commit41da652a218b9413cb24174f03c812d04b138c9e (patch)
tree5d548e743af742959cbe2aa74fe67547d0c7b1b4
parentdev-perl/LWP-Protocol-https: Version bump 6.10 (diff)
downloadgentoo-41da652a218b9413cb24174f03c812d04b138c9e.tar.gz
gentoo-41da652a218b9413cb24174f03c812d04b138c9e.tar.bz2
gentoo-41da652a218b9413cb24174f03c812d04b138c9e.zip
sys-kernel/installkernel-systemd-boot: bump, create machine-id dir
add a plugin to create proper directory for kernels. without it /usr/lib/kernel/install.d/00-entry-directory.install will silently exit and kernel will not be installed at all. Closes: https://github.com/gentoo/gentoo/pull/21195 Closes: https://bugs.gentoo.org/794646 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
-rwxr-xr-xsys-kernel/installkernel-systemd-boot/files/00-00machineid-directory.install28
-rw-r--r--sys-kernel/installkernel-systemd-boot/installkernel-systemd-boot-1.ebuild29
2 files changed, 57 insertions, 0 deletions
diff --git a/sys-kernel/installkernel-systemd-boot/files/00-00machineid-directory.install b/sys-kernel/installkernel-systemd-boot/files/00-00machineid-directory.install
new file mode 100755
index 00000000000..70b966fbf4b
--- /dev/null
+++ b/sys-kernel/installkernel-systemd-boot/files/00-00machineid-directory.install
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+
+# this file is installed by sys-kernel/installkernel-systemd-boot
+
+COMMAND="${1}"
+ENTRY_DIR_ABS="${3}"
+
+# this is exported by kernel-install
+if ! [[ $KERNEL_INSTALL_MACHINE_ID ]]; 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}" -gt 0 ]]; 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-1.ebuild b/sys-kernel/installkernel-systemd-boot/installkernel-systemd-boot-1.ebuild
new file mode 100644
index 00000000000..ebc400e603b
--- /dev/null
+++ b/sys-kernel/installkernel-systemd-boot/installkernel-systemd-boot-1.ebuild
@@ -0,0 +1,29 @@
+# Copyright 2019-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+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-apps/systemd sys-boot/systemd-boot )
+ !<sys-apps/debianutils-4.9-r1[installkernel(+)]
+ !sys-kernel/installkernel-gentoo"
+
+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/
+ doexe "${FILESDIR}/00-00machineid-directory.install"
+}