This commit is contained in:
teldra 2021-08-18 11:53:43 +02:00
parent 25fb3de821
commit 698ca255a1
4 changed files with 12 additions and 11 deletions

View File

@ -150,13 +150,11 @@ while input "Size in G? [$(( disk[size] - swapsize - bootsize ))|rest]" "rest";
done
setconf "add" "fde_key_store" "${cfg[fde_key_store]}"
setconf "add" "fde_keystore" "${cfg[fde_key_store]}"
setconf "add" "FDE_KEY_STORE" "${cfg[fde_key_store]}"
setconf "add" "diskid" "${disk[id]}"
setconf "add" "swapsize" "${swapsize}"
setconf "add" "rootfssize" "${rootfssize}"
setconf "add" "wipe" "${cfg[wipe]}"
setconf "add" "diskname" "${disk[name]}"
setconf "add" "bootsize" "4"
setconf "add" "target_part" "2"
#setconf "add" "target_part" "2"

View File

@ -25,7 +25,6 @@ if test -d /sys/firmware/efi; then
sleep $sleep
efipart="${dodiskid}-part${index}"
index=$(( index + 1 ))
mkfs.vfat "${efipart}" || exit 1
else
echo "BIOS Partition"
(echo "o";
@ -152,7 +151,8 @@ fi
if test -d /sys/firmware/efi; then
mkdir -p "${dest}/boot/efi"
mkfs.vfat -F32 "${efipart}"
mkfs.vfat "${efipart}"
sleep $sleep
mount "${efipart}" "${dest}/boot/efi"
fi

View File

@ -102,6 +102,9 @@ if [[ "${cfg[fde_key_store]}" == "once" ]]; then
{ echo "UUID=${cfg[bootuuid]} /boot btrfs defaults,subvol=bootfs 0 0";
echo "UUID=${cfg[bootuuid]} /var/lib/backup/quelle/bootfs btrfs defaults 0 0"; } >> /etc/fstab
fi
if test -d /sys/firmware/efi; then
echo "${efipart} /boot/efi vfat defaults 0 0" >> /etc/fstab
fi
echo "${cfg[hostname]}" > /etc/hostname
ln -sf "/usr/share/zoneinfo/${cfg[timezone]}" /etc/localtime

View File

@ -11,11 +11,13 @@ if [[ ! "${cfg[fde_key_store]}" == "none" ]]; then
fi
fi
if [[ ! -f /boot/volume.key ]] && [[ ! "${cfg[fde_key_store]}" == "twice" ]] && [[ ! "${cfg[fde_key_store]}" == "once" ]]; then
if [[ "${cfg[fde_key_store]}" == "initramfs" ]]; then
dd bs=1 count=64 if=/dev/urandom of=/boot/volume.key
echo -n "${cfg[diskpw]}" | cryptsetup luksAddKey "${cfg[diskname]}${cfg[target_part]}" /boot/volume.key -d -
echo -n "${cfg[diskpw]}" | cryptsetup luksAddKey "${target_partition}" /boot/volume.key -d -
chmod 000 /boot/volume.key
chmod -R g-rwx,o-rwx /boot
echo 'install_items+=" /boot/volume.key /etc/crypttab "' > /etc/dracut.conf.d/crypt-ssh.conf
echo "voidluks-${diskid} UUID=${cfg[partuuid]} /boot/volume.key luks" > /etc/crypttab
fi
fi
@ -32,10 +34,8 @@ if [[ "${cfg[hibernate]}" == "1" ]]; then
sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT/s/=\"/=\"resume=UUID=${cfg[swapuuid]} /" /etc/default/grub
fi
if [[ "${cfg[fde_key_store]}" == "initramfs" ]]; then
mkdir -p /etc/dracut.conf.d/
echo 'install_items+=" /boot/volume.key /etc/crypttab "' > /etc/dracut.conf.d/crypt-ssh.conf
echo "voidluks-${diskid} UUID=${cfg[partuuid]} /boot/volume.key luks" > /etc/crypttab
if [[ "${cfg[fde_key_store]}" == "twice" ]] || [[ "${cfg[fde_key_store]}" == "once" ]]; then
echo "voidluks-${diskid} UUID=${cfg[partuuid]} none luks" > /etc/crypttab
fi
if ! grep -q "dark-gray/black" /etc/default/grub; then