-case $hostname in
- frodo)
- # the root .ssh needs to be like this,
- # because it\'s used to get the key to mount an encrypted filesystem
- # on top of itself.
- d=/mnt/q/root/.ssh
- rm -rf $d # for idempotency
- mkdir -p $d
- scp -oStrictHostKeyChecking=no ian@treetowl:/a/c/machine_specific/frodo/subdir_files/.ssh/* $d
- cp .ssh/* $d
- ln -s /q/root/.ssh /mnt/root
- # background: errors=remount-ro is a debian installer thing. seems like
- # not a bad idea. man mount says: The default is set in the filesystem
- # superblock, and can be changed using tune2fs(8)
-
- cat > /mnt/etc/fstab <<'EOF'
-UUID=e9ce7b46-9a21-4e79-b7f7-0b18acb57587 / ext4 noatime,errors=remount-ro 0 1
-UUID=dd67766f-93c5-4ce3-9877-a1d9841dd4a4 none swap sw 0 0
-/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0
-/dev/mapper/crypta7 /mnt/btrfs_root btrfs subvolid=0,noatime,noauto 0 2
-/dev/mapper/crypta7 /a btrfs subvol=a,noatime,noauto 0 2
-EOF
- ;;
- *)
- cp -r .ssh /mnt/root
- cp -r /root/distro-install-common /mnt/root
- ;;&
- treetowl)
- echo "UUID=a9e83bb7-d23d-4de6-ba9f-d88b887f7206 /a ext4 noatime 0 2" >> /mnt/etc/fstab
- ;;
-esac
-
-cp /root/arch-init-chroot /mnt/root
+cp /a/bin/fai/encrypt /mnt/usr/lib/initcpio/hooks
+
+cp -r /root/.ssh /mnt/root
+
+bindmount() {
+ local mountpoint=$2
+ local source=$1
+ mkdir -p $mountpoint
+ mount -o bind $source $mountpoint
+}
+bindmount /root/shadow /mnt/q/root/shadow
+bindmount /a /mnt/a
+
+mkdir -p /mnt/etc/ssh
+cp /etc/ssh/ssh_host_* /mnt/etc/ssh
+
+cp /a/bin/fai/arch-init-chroot /mnt/root