iankelling.org
/
git
/
automated-distro-installer
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
765bf1b
)
mostly fixes, one new partition option
author
Ian Kelling
<iank@fsf.org>
Fri, 25 Mar 2022 06:26:18 +0000
(
02:26
-0400)
committer
Ian Kelling
<iank@fsf.org>
Fri, 25 Mar 2022 06:26:18 +0000
(
02:26
-0400)
fai/config/class/50-host-classes
patch
|
blob
|
history
fai/config/files/etc/apt/sources.list.d/aaa-nabia.list/NABIA
patch
|
blob
|
history
fai/config/hooks/partition.DEFAULT
patch
|
blob
|
history
fai/config/scripts/GRUB_PC/11-iank
patch
|
blob
|
history
mymk-basefile
patch
|
blob
|
history
diff --git
a/fai/config/class/50-host-classes
b/fai/config/class/50-host-classes
index 8fc4cfbb00eb96f9c36a2f07ddca068fad1c8ad6..84efa3677c4445f70b3d9ad7c5f257c834b0c991 100755
(executable)
--- 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.
#
# 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
# 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 85bf23cc1bc7935d5bbb7520462f088badc7a333..1a03fd48ba201d18b3426f17cf7d2c605deb8bb1 100644
(file)
--- 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
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 fc6da117fcd01cc2aafb91784c11a8fb7175961c..d702351a38178de41b5ed2e6395af241ab9035dc 100755
(executable)
--- a/
fai/config/hooks/partition.DEFAULT
+++ b/
fai/config/hooks/partition.DEFAULT
@@
-75,6
+75,8
@@
fi
#
# NOWIPE: use existing subvolumes if they exist
#
#
# 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.
#
# 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
# 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
even_bign=9
lastn=$bios_grubn
@@
-252,15
+255,18
@@
luks-setup() {
##### begin variable setup
##### begin variable setup
+partition=false
if ifclass REPARTITION; then
partition=true # force a full wipe
if ifclass REPARTITION; then
partition=true # force a full wipe
-else
- partition=false # change to true to force a full wipe
fi
fi
+wipe=true
if ifclass NOWIPE; then
wipe=false
if ifclass NOWIPE; then
wipe=false
-else
- wipe=true
+fi
+
+rerootfs=false
+if ifclass REROOTFS; then
+ rerootfs=true
fi
if (($(nproc) > 2)); then
fi
if (($(nproc) > 2)); then
@@
-380,7
+386,7
@@
for dev in ${devs[@]}; do
boot_devs+=("$(bootdev)")
boot2_devs+=("$(boot2dev)")
fi
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
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 <<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 <<EOF
-crypt_dev_ata-Samsung_SSD_870_QVO_8TB_S5VUNG0N900656V-part${even_bign} /dev/disk/by-id/ata-Samsung_SSD_870_QVO_8TB_S5VUNG0N900656V-part
7
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
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
@@
-820,9
+826,20
@@
else
if [[ -e /dev/mapper/$(root-cryptname) ]]; then
continue
fi
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
done
+
+ if $rerootfs; then
+ sleep 1
+ bpart $(for dev in ${devs[@]}; do root-cryptdev; done)
+ fi
sleep 1
fi
sleep 1
fi
diff --git
a/fai/config/scripts/GRUB_PC/11-iank
b/fai/config/scripts/GRUB_PC/11-iank
index fc51d591cde799eaab50565a9c5ac44cc6f2e1d8..deab6797c5e5ca4c225d35f2438a426dc01083d8 100755
(executable)
--- a/
fai/config/scripts/GRUB_PC/11-iank
+++ b/
fai/config/scripts/GRUB_PC/11-iank
@@
-24,10
+24,10
@@
fi
# -r = recursive
# -i = ignore non-matching class warnings, always exit 0
# -B = no backup files
# -r = recursive
# -i = ignore non-matching class warnings, always exit 0
# -B = no backup files
-fcopy -riB /boot
+fcopy -riB
M
/boot
# this is also done by FABASE/10-misc by default (without B)
# this is also done by FABASE/10-misc by default (without B)
-fcopy -riB /root
-fcopy -riB /usr/local/bin
+fcopy -riB
M
/root
+fcopy -riB
M
/usr/local/bin
src=$FAI/distro-install-common/shadow
src=$FAI/distro-install-common/shadow
@@
-49,6
+49,14
@@
tmpfile1=$(mktemp)
# this can fail if we need an apt update
chroot $FAI_ROOT /usr/bin/apt-cache policy >$tmpfile1 ||:
fcopy -riBM /etc/apt
# 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
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 b572ccdf27268f1c38e9ce8186a139d60c7362e4..7e165032628618c082124d5ee0ac37031906a3d6 100755
(executable)
--- 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
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 "$@"
$s $script_dir/fai/config/basefiles/mk-basefile "$@"