# os into a multi-os system, if we see some basic hueristics, like the
# right amount of them. This overrides that.
#
+# REROOTFS: Don't reuse the root filesystem, even if we normally would
+#
+# NOWIPE: use existing subvolumes if they exist
+#
# PARTITION_PROMPT: If we don't see partitions to reuuse, prompt
# to make sure we really want to repartition and use a completely
# fresh install. I use this in case our repartition check has
-deb http://mirror.fsf.org/trisquel/ nabia main
-deb-src http://mirror.fsf.org/trisquel/ nabia main
+deb http://archive.trisquel.org/trisquel/ nabia main
+deb-src http://archive.trisquel.org/trisquel/ nabia main
-deb http://mirror.fsf.org/trisquel/ nabia-updates main
-deb-src http://mirror.fsf.org/trisquel/ nabia-updates main
+deb http://archive.trisquel.org/trisquel/ nabia-updates main
+deb-src http://archive.trisquel.org/trisquel/ nabia-updates main
deb http://archive.trisquel.info/trisquel/ nabia-security main
deb-src http://archive.trisquel.info/trisquel/ nabia-security main
-# Uncomment this lines to enable the backports optional repository
-deb http://mirror.fsf.org/trisquel/ nabia-backports main
-deb-src http://mirror.fsf.org/trisquel/ nabia-backports main
+deb http://archive.trisquel.org/trisquel/ nabia-backports main
+deb-src http://archive.trisquel.org/trisquel/ nabia-backports main
#
# 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
# 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
# -r = recursive
# -i = ignore non-matching class warnings, always exit 0
# -B = no backup files
-fcopy -riB /boot
+fcopy -riBM /boot
# this is also done by FABASE/10-misc by default (without B)
-fcopy -riB /root
-fcopy -riB /usr/local/bin
+fcopy -riBM /root
+fcopy -riBM /usr/local/bin
src=$FAI/distro-install-common/shadow
# this can fail if we need an apt update
chroot $FAI_ROOT /usr/bin/apt-cache policy >$tmpfile1 ||:
fcopy -riBM /etc/apt
+
+# vps that didnt start with fai need the key
+case $HOSTNAME in
+ je|bk|li)
+ apt-key add /a/bin/fai/fai/config/package_config/UBUNTU.asc
+ ;;
+esac
+
tmpfile2=$(mktemp)
chroot $FAI_ROOT /usr/bin/apt-cache policy >$tmpfile2
if ! diff -q $tmpfile1 $tmpfile2; then