summaryrefslogtreecommitdiffstats
path: root/builder/modules.d/dnbd3-rootfs/hooks
diff options
context:
space:
mode:
authorJonathan Bauer2017-10-18 17:44:56 +0200
committerJonathan Bauer2017-10-18 17:44:56 +0200
commitb2b248899b0c1305b7b33849399ce468d5b8dce1 (patch)
tree032e7c738268cc3b16a9e1fe0ae372c23bf44d81 /builder/modules.d/dnbd3-rootfs/hooks
parent[dnbd3-rootfs] dump pxe net info to config (diff)
downloadsystemd-init-b2b248899b0c1305b7b33849399ce468d5b8dce1.tar.gz
systemd-init-b2b248899b0c1305b7b33849399ce468d5b8dce1.tar.xz
systemd-init-b2b248899b0c1305b7b33849399ce468d5b8dce1.zip
[dnbd3-rootfs] SLX_{ROOT,DEMO}_PASS
Diffstat (limited to 'builder/modules.d/dnbd3-rootfs/hooks')
-rwxr-xr-xbuilder/modules.d/dnbd3-rootfs/hooks/copy-openslx-configuration-into-newroot.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/builder/modules.d/dnbd3-rootfs/hooks/copy-openslx-configuration-into-newroot.sh b/builder/modules.d/dnbd3-rootfs/hooks/copy-openslx-configuration-into-newroot.sh
index 57b77f5a..4039440d 100755
--- a/builder/modules.d/dnbd3-rootfs/hooks/copy-openslx-configuration-into-newroot.sh
+++ b/builder/modules.d/dnbd3-rootfs/hooks/copy-openslx-configuration-into-newroot.sh
@@ -19,6 +19,15 @@ cp "/etc/openslx" "${NEWROOT}${SLX_CONFIGURATION_LOCATION}/config"
echo '## Generated by dracut in stage3' >> "${NEWROOT}${SLX_CONFIGURATION_LOCATION}/config"
cat "/run/openslx/pxe-network.conf" >> "${NEWROOT}${SLX_CONFIGURATION_LOCATION}/config"
+
+# Set root/demo password for stage4, if set
+if [ -n "${SLX_ROOT_PASS}" ]; then
+ sed -i "s#^root:[^:]*:#root:$SLX_ROOT_PASS:#" $NEWROOT/etc/shadow
+fi
+if [ -n "${SLX_DEMO_PASS}" ] && grep -q '^demo' $NEWROOT/etc/shadow; then
+ sed -i "s#^demo:[^:]*:#demo:$SLX_DEMO_PASS:#" $NEWROOT/etc/shadow
+fi
+
}
exceptions.catch
{