summaryrefslogtreecommitdiff
path: root/sys-kernel/installkernel-systemd-boot/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-06-22 13:21:57 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-06-22 13:21:57 +0100
commitf29f0d7da5f422c5491502ea0684163fa4471e6b (patch)
tree19b026c898bdd5cabce5c8c799e8c481d06b2ec4 /sys-kernel/installkernel-systemd-boot/files
parentf3fb638f09f376ec32bff303d5785b875a1c641f (diff)
gentoo auto-resync : 22:06:2023 - 13:21:57
Diffstat (limited to 'sys-kernel/installkernel-systemd-boot/files')
-rw-r--r--sys-kernel/installkernel-systemd-boot/files/installkernel-systemd-boot-2-r2-00-00machineid-directory.install32
1 files changed, 32 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