X-Git-Url: https://iankelling.org/git/?p=automated-distro-installer;a=blobdiff_plain;f=fai%2Fconfig%2Fhooks%2Fpartition.DEFAULT;h=b961e62ed2d7f98055204bfd1b0bd42066960fa8;hp=c2628e26def254be12ff62759eabe8e98af69d7e;hb=45a2a286083772abc0688e663a6ecc68af0a8d0e;hpb=d4f7a9349a08f60957ca544f3d68a9b97015f6b9 diff --git a/fai/config/hooks/partition.DEFAULT b/fai/config/hooks/partition.DEFAULT index c2628e2..b961e62 100755 --- a/fai/config/hooks/partition.DEFAULT +++ b/fai/config/hooks/partition.DEFAULT @@ -18,8 +18,11 @@ set -eE -o pipefail trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR -# for calling outside of FAI, first -# - source /a/bin/fai-wrapper +# for calling outside of FAI: +# # need to redep and set that location so that we get luks keys +# export FAI=/srv/fai/config +# fai-redep +# source /b/fai/fai-wrapper # - set any appropriate classes with: fai-setclass OPT1... which sets CLASS_OPT1=true... # or run eval-fai-classfile FILE # @@ -318,7 +321,7 @@ bpart() { # btrfs a partition # see README for docs about how to create these -luks_dir=${LUKS_DIR:-/var/lib/fai/config/distro-install-common/luks} +luks_dir=$FAI/distro-install-common/luks luks_file=$luks_dir/host-$HOSTNAME @@ -484,7 +487,9 @@ if $partition; then bpart ${boot_devs[@]} else for dev in ${devs[@]}; do - mkfs.ext2 $(grub_extdev) + if [[ -e /a/bin/fai/fai-wrapper && -e /dev/mapper/$(root-cryptname) ]]; then + continue + fi cryptsetup luksOpen $(rootdev) $(root-cryptname) \ --key-file $luks_file done @@ -507,7 +512,6 @@ if [[ $DISTRO != debianstretch_bootstrap ]]; then btrfs subvolume create root_$DISTRO - mkdir -p /mnt/root_$DISTRO/boot # could set default subvol like this, but no reason to. # btrfs subvolume set-default \ # $(btrfs subvolume list . | grep "root_$DISTRO$" | awk '{print $2}') . @@ -560,9 +564,10 @@ EOF else # note, fai creates the mountpoints listed here cat > /tmp/fai/fstab <