3 # These are things we can do before package_config packages get installed.
5 # exit for any vm except demohost, or if we are doing a dirinstall
6 if ifclass VM
&& ! ifclass demohost || ifclass VOL_BULLSEYE_BOOTSTRAP ||
[[ ! $FAI_ACTION ||
$FAI_ACTION = dirinstall
]]; then
14 keyfile
=/var
/lib
/fai
/config
/distro-install-common
/luks
/host-
$HOSTNAME
15 f
=$target/root
/keyscript
25 # for hosts which don't have these data volumes, copy the specific
27 if ifclass demohost
; then
28 files
=(/var
/lib
/fai
/config
/distro-install-common
/luks
/host-demohost
)
30 files
=(/var
/lib
/fai
/config
/distro-install-common
/luks
/host-tp
)
32 if [[ ${files[0]} ]]; then
40 #### This bit is duplicated in rootsshsync, except we skip
41 #### update-initramfs and add $target
43 # We generally shouldn't need this, because we don't ssh in on the 1st
44 # reboot since we initially embed the luks key, and with distro-begin,
45 # we run rootsshsync around the same time as we remove it. However, it
46 # could be helpful in case of problems.
48 auth_dir
=$target/etc
/dropbear
/initramfs
/
49 candidate
=$
(apt-cache policy dropbear-initramfs |
awk '$1 == "Candidate:" { print $2 }' |
head -n1 ||
:)
50 if [[ $candidate ]] && dpkg
--compare-versions "$candidate" lt
2020.81-4; then
51 auth_dir
=$target/etc
/dropbear-initramfs
53 auth_file
=$auth_dir/authorized_keys
55 if [[ ! -e $auth_file ]] ||
! diff -q /root
/.ssh
/authorized_keys
$auth_file; then
56 cp -p /root
/.ssh
/authorized_keys
$auth_file