X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=fai%2Fconfig%2Fhooks%2Finstsoft.DEFAULT;h=a2a61007eec8230245a70b554bb279a3ab8916cf;hb=bacafbabe07c9edc86eaa75c24887d6fac0c310a;hp=1879648b73a71afd0d705ce2efe78c55c2be67cb;hpb=a129832a849aa87163b866982c214bbdd7314a52;p=automated-distro-installer diff --git a/fai/config/hooks/instsoft.DEFAULT b/fai/config/hooks/instsoft.DEFAULT index 1879648..a2a6100 100755 --- a/fai/config/hooks/instsoft.DEFAULT +++ b/fai/config/hooks/instsoft.DEFAULT @@ -1,23 +1,44 @@ #!/bin/bash # exit for any vm which is not our test vm -if ifclass VM && ! ifclass demohost; then +if ifclass VM && ! ifclass demohost || ifclass VOL_STRETCH_BOOTSTRAP; then exit 0 fi +keyfile=/var/lib/fai/config/distro-install-common/luks/host-$HOSTNAME f=$target/root/keyscript cat > $f <$f <<'EOF' +#!/bin/sh +if ! [ -e /tmp/key ]; then + stty -echo + read pass + printf '%s' "$pass" > /tmp/key +fi +cat /tmp/key +EOF chmod +x $f -if ifclass tp; then - d=$target/root/shadow + +# for hosts which don't have these data volumes, copy the specific +# files we need. +if ifclass demohost; then + files=(/var/lib/fai/config/distro-install-common/luks/host-demohost) +elif ifclass tp; then + files=(/var/lib/fai/config/distro-install-common/luks/host-{tp,demohost}) +fi +if [[ ${files[0]} ]]; then + d=$target/q/root/luks mkdir -p $d - ls -la /var/lib/fai/config/distro-install-common - cp /var/lib/fai/config/distro-install-common/traci{-simple} $d + cp ${files[@]} $d + chmod -R o-rwx $d fi