X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=fai%2Fconfig%2Fhooks%2Finstsoft.DEFAULT;h=9d8f0b77fbd51b1be686c97aeab206fe9d27034b;hb=14f283f82afc48d6cec1bb7498ec34ac2b0da77c;hp=d2a8f760244d1399caf0c662c858a71f26fa7e86;hpb=eae06d9028e4e70a211afef4a73b971067203da1;p=automated-distro-installer diff --git a/fai/config/hooks/instsoft.DEFAULT b/fai/config/hooks/instsoft.DEFAULT index d2a8f76..9d8f0b7 100755 --- a/fai/config/hooks/instsoft.DEFAULT +++ b/fai/config/hooks/instsoft.DEFAULT @@ -1,16 +1,53 @@ #!/bin/bash -# exit for any vm which is not our test vm -if ifclass VM && ! ifclass demohost; then - exit 0 +# These are things we can do before package_config packages get installed. + +# exit for any vm except demohost, or if we are doing a dirinstall +if ifclass VM && ! ifclass demohost || ifclass VOL_BULLSEYE_BOOTSTRAP || [[ ! $FAI_ACTION || $FAI_ACTION = dirinstall ]]; then + exit 0 +fi + +if ifclass FSF; then + exit 0 fi +keyfile=/var/lib/fai/config/distro-install-common/luks/host-$HOSTNAME f=$target/root/keyscript cat > $f </dev/null; then + mkdir -p $d/root/.ssh /etc/dropbear-initramfs + chmod 700 $d/root $d/root/.ssh + cp -p /root/.ssh/authorized_keys $d/root/.ssh/authorized_keys + cp -p /root/.ssh/authorized_keys /etc/dropbear-initramfs + if [[ -e /root/.ssh/authorized_keys2 ]]; then + cat /root/.ssh/authorized_keys2 >>/etc/dropbear-initramfs + fi +fi