iankelling.org
/
git
/
automated-distro-installer
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
various fixes for bullseye and new ssh key changes
[automated-distro-installer]
/
fai
/
config
/
hooks
/
partition.DEFAULT
diff --git
a/fai/config/hooks/partition.DEFAULT
b/fai/config/hooks/partition.DEFAULT
index 0dc4c7d144450870c63eb1931ad736ff95058d26..80f0d7c4a70afd9dfb86f616c7830089bb06bcc3 100755
(executable)
--- a/
fai/config/hooks/partition.DEFAULT
+++ b/
fai/config/hooks/partition.DEFAULT
@@
-65,16
+65,17
@@
fi
# RAID1: forces raid1 filesystem.
mkroot2=false
# RAID1: forces raid1 filesystem.
mkroot2=false
-case $1 in
- mkroot2)
- mkroot2=true
- ;;
- *)
- echo "$0: error: unsupported arg: $1" >&2
- exit 1
- ;;
-esac
-
+if [[ $1 ]]; then
+ case $1 in
+ mkroot2)
+ mkroot2=true
+ ;;
+ *)
+ echo "$0: error: unsupported arg: $1" >&2
+ exit 1
+ ;;
+ esac
+fi
if [[ $SPECIAL_DISK ]]; then
if [[ $SPECIAL_DISK ]]; then
@@
-185,8
+186,7
@@
luks-setup() {
# cryptsetup luksAddKey --pbkdf pbkdf2
# then remove the new format keys with cryptsetup luksRemoveKey
# then cryptsetup convert DEV --type luks1, then readd old keys and remove temp.
# cryptsetup luksAddKey --pbkdf pbkdf2
# then remove the new format keys with cryptsetup luksRemoveKey
# then cryptsetup convert DEV --type luks1, then readd old keys and remove temp.
- yes YES | cryptsetup luksFormat $luksdev $luks_file \
- --type luks1 -c aes-cbc-essiv:sha256 -s 256 || [[ $? == 141 ]]
+ yes YES | cryptsetup luksFormat $luksdev $luks_file || [[ $? == 141 ]]
yes "$lukspw" | \
cryptsetup luksAddKey --key-file $luks_file \
$luksdev || [[ $? == 141 ]]
yes "$lukspw" | \
cryptsetup luksAddKey --key-file $luks_file \
$luksdev || [[ $? == 141 ]]
@@
-361,8
+361,8
@@
if (( boot_space > 60000 )); then
# recovery needs and for doing pxe-kexec.
boot_mib=10000
root2_mib=200000
# recovery needs and for doing pxe-kexec.
boot_mib=10000
root2_mib=200000
- boot2_mib=
5
00
-elif (( boot_space > 30000 )); then
+ boot2_mib=
20
00
+elif (( boot_spa
_
ce > 30000 )); then
boot_mib=$(( 5000 + (boot_space - 30000) / 2 ))
root2_mib=100
boot2_mib=100
boot_mib=$(( 5000 + (boot_space - 30000) / 2 ))
root2_mib=100
boot2_mib=100
@@
-386,14
+386,16
@@
esac
if [[ ! $DISTRO ]]; then
if [[ ! $DISTRO ]]; then
- if ifclass VOL_BU
STER
_BOOTSTRAP; then
- DISTRO=debianbu
ster
_bootstrap
+ if ifclass VOL_BU
LLSEYE
_BOOTSTRAP; then
+ DISTRO=debianbu
llseye
_bootstrap
elif ifclass VOL_STRETCH; then
DISTRO=debianstretch
elif ifclass VOL_BUSTER; then
DISTRO=debianbuster
elif ifclass VOL_BULLSEYE; then
DISTRO=debianbullseye
elif ifclass VOL_STRETCH; then
DISTRO=debianstretch
elif ifclass VOL_BUSTER; then
DISTRO=debianbuster
elif ifclass VOL_BULLSEYE; then
DISTRO=debianbullseye
+ elif ifclass VOL_BOOKWORM; then
+ DISTRO=debianbookworm
elif ifclass VOL_TESTING; then
DISTRO=debiantesting
elif ifclass VOL_XENIAL; then
elif ifclass VOL_TESTING; then
DISTRO=debiantesting
elif ifclass VOL_XENIAL; then
@@
-474,6
+476,9
@@
for dev in ${devs[@]}; do
done
shopt -s nullglob
done
shopt -s nullglob
+# We write to these files instead of just /etc/fstab, /etc/crypttab,
+# because these are filesystems created after our current root, and so
+# this allows us to update other root filesystems too.
rm -f /mnt/root/root2-{fs,crypt}tab
if $mkroot2; then
if $partition; then
rm -f /mnt/root/root2-{fs,crypt}tab
if $mkroot2; then
if $partition; then
@@
-668,7
+673,7
@@
else
fi
fi
-if $wipe && [[ $DISTRO != debianbu
ster
_bootstrap ]]; then
+if $wipe && [[ $DISTRO != debianbu
llseye
_bootstrap ]]; then
# bootstrap distro doesn't use separate encrypted root.
mount -o subvolid=0 $first_root_crypt /mnt
# systemd creates subvolumes we want to delete.
# bootstrap distro doesn't use separate encrypted root.
mount -o subvolid=0 $first_root_crypt /mnt
# systemd creates subvolumes we want to delete.
@@
-708,7
+713,7
@@
btrfs subvolume set-default 0 /mnt # already default, just ensuring it.
mkdir -p /mnt/grub2
cp $FAI/distro-install-common/libreboot_grub.cfg /mnt/grub2
mkdir -p /mnt/grub2
cp $FAI/distro-install-common/libreboot_grub.cfg /mnt/grub2
-if [[ $DISTRO == debianbu
ster
_bootstrap ]]; then
+if [[ $DISTRO == debianbu
llseye
_bootstrap ]]; then
# this is just convenience for the libreboot_grub config
# so we can glob the other ones easier.
boot_vol=$DISTRO
# this is just convenience for the libreboot_grub config
# so we can glob the other ones easier.
boot_vol=$DISTRO
@@
-732,7
+737,7
@@
grub-editenv /mnt/grubenv set last_boot=/$boot_vol
umount /mnt
fstabstd=x-systemd.device-timeout=30s,x-systemd.mount-timeout=30s
umount /mnt
fstabstd=x-systemd.device-timeout=30s,x-systemd.mount-timeout=30s
-if [[ $DISTRO == debianbu
ster
_bootstrap ]]; then
+if [[ $DISTRO == debianbu
llseye
_bootstrap ]]; then
cat > /tmp/fai/fstab <<EOF
$first_boot_dev / btrfs noatime,subvol=$boot_vol 0 0
$first_efi /boot/efi vfat nofail,$fstabstd 0 0
cat > /tmp/fai/fstab <<EOF
$first_boot_dev / btrfs noatime,subvol=$boot_vol 0 0
$first_efi /boot/efi vfat nofail,$fstabstd 0 0