diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2021-06-29 10:15:54 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2021-06-29 10:15:54 +0100 |
commit | 9aa80713372911cec499b3adb2cd746790920916 (patch) | |
tree | b8e99dc5dd60ac2094a27cc52f74aada8df38f05 /sys-kernel/installkernel-systemd-boot/files | |
parent | b4d43e8c611df4a8061b6f88d9e9f6b1e3c83903 (diff) |
gentoo resync : 29.06.2021
Diffstat (limited to 'sys-kernel/installkernel-systemd-boot/files')
-rw-r--r-- | sys-kernel/installkernel-systemd-boot/files/00-00machineid-directory.install | 28 |
1 files changed, 28 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 100644 index 000000000000..70b966fbf4b3 --- /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 |