summaryrefslogtreecommitdiffstats
path: root/builder/modules.d/slx-uuid/module-setup.sh
diff options
context:
space:
mode:
authorJonathan Bauer2018-11-12 12:17:19 +0100
committerJonathan Bauer2018-11-12 17:30:33 +0100
commitcd1b40ba72c2165b799e8adce871d0b8be76aec6 (patch)
treecdd4b7688bbf28c5c7606ecde134d4361debd3b7 /builder/modules.d/slx-uuid/module-setup.sh
parentin bridge mode, do not copy the physical interface configuration (diff)
downloadsystemd-init-cd1b40ba72c2165b799e8adce871d0b8be76aec6.tar.gz
systemd-init-cd1b40ba72c2165b799e8adce871d0b8be76aec6.tar.xz
systemd-init-cd1b40ba72c2165b799e8adce871d0b8be76aec6.zip
[slx-uuid] Detects and exposes system UUID
for various openslx-related scripts
Diffstat (limited to 'builder/modules.d/slx-uuid/module-setup.sh')
-rwxr-xr-xbuilder/modules.d/slx-uuid/module-setup.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/builder/modules.d/slx-uuid/module-setup.sh b/builder/modules.d/slx-uuid/module-setup.sh
new file mode 100755
index 00000000..875c9f77
--- /dev/null
+++ b/builder/modules.d/slx-uuid/module-setup.sh
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+check() {
+ # Tell dracut that this module should only be included if it is required
+ # explicitly.
+ if ! hash dmidecode; then
+ echo "dmidecode is missing from this system, please install it."
+ return 1
+ fi
+ return 255
+}
+depends() {
+ echo dnbd3-rootfs
+}
+install() {
+ mkdir -p "$initdir/etc/bad-uuid.d"
+ inst_simple "$moddir/bad-uuid-defaults.conf" "/etc/bad-uuid.d/bad-uuid-defaults.conf"
+ inst_multiple dmidecode head
+ inst_hook pre-mount 05 "$moddir/scripts/get-system-uuid.sh"
+ inst_hook pre-pivot 10 "$moddir/scripts/copy-system-uuid-to-newroot.sh"
+}