#
# NOWIPE: use existing subvolumes if they exist
#
+# REROOTFS: Don't reuse the root filesystem, even if we normally would
+#
# ROTATIONAL: forces to install onto hdds instead of sdds. normally sdds
# are chosen if they exist.
#
# bios boot partition,
# https://wiki.archlinux.org/index.php/GRUB
bios_grubn=8
+# for an even raid (raid 1), when one disk is bigger, this partition goes on the big disk
even_bign=9
lastn=$bios_grubn
##### begin variable setup
+partition=false
if ifclass REPARTITION; then
partition=true # force a full wipe
-else
- partition=false # change to true to force a full wipe
fi
+wipe=true
if ifclass NOWIPE; then
wipe=false
-else
- wipe=true
+fi
+
+rerootfs=false
+if ifclass REROOTFS; then
+ rerootfs=true
fi
if (($(nproc) > 2)); then
boot_devs+=("$(bootdev)")
boot2_devs+=("$(boot2dev)")
fi
- if $first && (( ${boot_devs[@]} >= 1 )) ; then
+ if $first && (( ${#boot_devs[@]} >= 1 )) ; then
first_efi=$(efidev)
first_grub_extdev=$(grub_extdev)
first=false
DISTRO=ubuntubionic
elif ifclass VOL_FOCAL; then
DISTRO=ubuntufocal
+ elif ifclass VOL_JAMMY; then
+ DISTRO=ubuntujammy
elif ifclass VOL_FLIDAS; then
DISTRO=trisquelflidas
elif ifclass VOL_ETIONA; then
DISTRO=trisqueletiona
elif ifclass VOL_NABIA; then
DISTRO=trisquelnabia
+ elif ifclass VOL_ARAMO; then
+ DISTRO=trisquelaramo
elif $mkroot2 || $mkroot2tab; then
:
else
# but it is safely ignorable and gets us the ability to just type our password
# in once at boot. A downside is that they are probably needed to be plugged in to boot.
cat >>/tmp/fai/crypttab <<EOF
-crypt_dev_ata-Samsung_SSD_870_QVO_8TB_S5VUNG0N900656V-part${even_bign} /dev/disk/by-id/ata-Samsung_SSD_870_QVO_8TB_S5VUNG0N900656V-part7 none keyscript=decrypt_keyctl,discard,luks,initramfs
+crypt_dev_ata-Samsung_SSD_870_QVO_8TB_S5VUNG0N900656V-part${even_bign} /dev/disk/by-id/ata-Samsung_SSD_870_QVO_8TB_S5VUNG0N900656V-part${even_bign} none keyscript=decrypt_keyctl,discard,luks,initramfs
crypt_dev_ata-TOSHIBA_MD04ACA500_84R2K773FS9A-part1 /dev/disk/by-id/ata-TOSHIBA_MD04ACA500_84R2K773FS9A-part1 none keyscript=decrypt_keyctl,discard,luks,initramfs
crypt_dev_ata-ST6000DM001-1XY17Z_Z4D29EBL-part1 /dev/disk/by-id/ata-ST6000DM001-1XY17Z_Z4D29EBL-part1 none keyscript=decrypt_keyctl,discard,luks,initramfs
EOF
if [[ -e /dev/mapper/$(root-cryptname) ]]; then
continue
fi
- cryptsetup luksOpen $(rootdev) $(root-cryptname) \
- --key-file $luks_file
+ if $rerootfs; then
+ luks-setup $(rootdev)
+ sleep 1
+ bpart $(for dev in ${devs[@]}; do root-cryptdev; done)
+ else
+ cryptsetup luksOpen $(rootdev) $(root-cryptname) \
+ --key-file $luks_file
+ fi
done
+
+ if $rerootfs; then
+ sleep 1
+ bpart $(for dev in ${devs[@]}; do root-cryptdev; done)
+ fi
sleep 1
fi