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 || ifclass VOL_BOOKWORM_BOOTSTRAP ||
[[ ! $FAI_ACTION ||
$FAI_ACTION = dirinstall
]]; then
14 fcopy
-riB /etc
/apt
/preferences.d
15 # ian: i'm guessing fai does this already
16 #fcopy -riB /etc/apt/sources.list.d
19 keyfile
=/var
/lib
/fai
/config
/distro-install-common
/luks
/host-
$HOSTNAME
20 f
=$target/root
/keyscript
30 # for hosts which don't have these data volumes, copy the specific
32 if ifclass demohost
; then
33 files
=(/var
/lib
/fai
/config
/distro-install-common
/luks
/host-demohost
)
35 files
=(/var
/lib
/fai
/config
/distro-install-common
/luks
/host-tp
)
37 if [[ ${files[0]} ]]; then
45 #### This bit is duplicated in rootsshsync, except we skip
46 #### update-initramfs and add $target
48 # We generally shouldn't need this, because we don't ssh in on the 1st
49 # reboot since we initially embed the luks key, and with distro-begin,
50 # we run rootsshsync around the same time as we remove it. However, it
51 # could be helpful in case of problems.
53 auth_dir
=$target/etc
/dropbear
/initramfs
/
54 candidate
=$
(apt-cache policy dropbear-initramfs |
awk '$1 == "Candidate:" { print $2 }' |
head -n1 ||
:)
55 if [[ $candidate ]] && dpkg
--compare-versions "$candidate" lt
2020.81-4; then
56 auth_dir
=$target/etc
/dropbear-initramfs
58 auth_file
=$auth_dir/authorized_keys
60 if [[ ! -e $auth_file ]] ||
! diff -q /root
/.ssh
/authorized_keys
$auth_file; then
61 cp -p /root
/.ssh
/authorized_keys
$auth_file