From 4d23584c79e6c519f24042b11bc2cb5cd04ea284 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Fri, 25 Mar 2022 02:26:18 -0400 Subject: [PATCH] mostly fixes, one new partition option --- fai/config/class/50-host-classes | 4 +++ .../apt/sources.list.d/aaa-nabia.list/NABIA | 13 ++++---- fai/config/hooks/partition.DEFAULT | 33 ++++++++++++++----- fai/config/scripts/GRUB_PC/11-iank | 14 ++++++-- mymk-basefile | 2 +- 5 files changed, 47 insertions(+), 19 deletions(-) diff --git a/fai/config/class/50-host-classes b/fai/config/class/50-host-classes index 8fc4cfb..84efa36 100755 --- a/fai/config/class/50-host-classes +++ b/fai/config/class/50-host-classes @@ -67,6 +67,10 @@ echo FAIBASE STANDARD DEBIAN # 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 diff --git a/fai/config/files/etc/apt/sources.list.d/aaa-nabia.list/NABIA b/fai/config/files/etc/apt/sources.list.d/aaa-nabia.list/NABIA index 85bf23c..1a03fd4 100644 --- a/fai/config/files/etc/apt/sources.list.d/aaa-nabia.list/NABIA +++ b/fai/config/files/etc/apt/sources.list.d/aaa-nabia.list/NABIA @@ -1,12 +1,11 @@ -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 diff --git a/fai/config/hooks/partition.DEFAULT b/fai/config/hooks/partition.DEFAULT index fc6da11..d702351 100755 --- a/fai/config/hooks/partition.DEFAULT +++ b/fai/config/hooks/partition.DEFAULT @@ -75,6 +75,8 @@ fi # # 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. # @@ -168,6 +170,7 @@ grub_extn=7 # 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 @@ -252,15 +255,18 @@ luks-setup() { ##### 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 @@ -380,7 +386,7 @@ for dev in ${devs[@]}; do 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 @@ -556,7 +562,7 @@ EOF # 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 <$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 diff --git a/mymk-basefile b/mymk-basefile index b572ccd..7e16503 100755 --- a/mymk-basefile +++ b/mymk-basefile @@ -63,5 +63,5 @@ fi if awk '$2 == "/tmp" && $4 ~ /nodev/' /proc/mounts | grep -q . || [[ $? == 141 ]]; then $s mount -o remount,dev /tmp - fi +fi $s $script_dir/fai/config/basefiles/mk-basefile "$@" -- 2.30.2