restructure

This commit is contained in:
teldra 2021-03-12 18:09:57 +01:00
parent c4420b0ff9
commit 580526a428
2 changed files with 13 additions and 7 deletions

View File

@ -12,7 +12,7 @@ setconf add "lang_console" "de-latin1-nodeadkeys"
setconf add "timezone" "Europe/Berlin"
addpkg base-system void-repo-multilib void-repo-multilib-nonfree void-repo-nonfree btrfs-progs lvm2 cronie socklog-void ntp xtools sudo wireguard-tools gnupg2 progress pwgen net-tools ncdu nmap mtr iotop hdparm smartmontools htop git neovim pass
addpkg base-system void-repo-multilib void-repo-multilib-nonfree void-repo-nonfree btrfs-progs lvm2 cronie socklog-void ntp xtools sudo wireguard-tools gnupg2 progress pwgen net-tools ncdu nmap mtr iotop hdparm smartmontools htop git neovim
ignorepkg nvi
servicesenable acpid cronie socklog-unix nanoklogd uuidd
servicesdisable agetty-tty6 agetty-tty5

View File

@ -6,25 +6,31 @@ diskid="${cfg[diskid]//-/_}"
if [[ ! "${cfg[fde_key_store]}" == "none" ]] && [[ ! "${cfg[fde_key_store]}" == "once" ]]; then
if ! grep -q "GRUB_ENABLE_CRYPTODISK" "${dest}"/etc/default/grub; then
echo "GRUB_ENABLE_CRYPTODISK=y" >> "${dest}"/etc/default/grub
fi
if [[ ! -f "${dest}"/boot/volume.key ]]; then
if [[ ! -f "${dest}"/boot/volume.key ]] && [[ ! "${cfg[fde_key_store]}" == "twice" ]]; then
dd bs=1 count=64 if=/dev/urandom of="${dest}"/boot/volume.key
echo -n "${cfg[diskpw]}" | cryptsetup luksAddKey "${cfg[diskname]}${cfg[target_part]}" "${dest}"/boot/volume.key -d -
chmod 000 "${dest}"/boot/volume.key
chmod -R g-rwx,o-rwx "${dest}"/boot
fi
sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT/s/=\"/=\"rd.luks.uuid=${cfg[partuuid]} rd.vconsole.keymap=${cfg[lang_console]} /" "${dest}"/etc/default/grub
fi
if ! grep -q rd.lvm.vg "${dest}"/etc/default/grub; then
sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT/s/=\"/=\"rd.lvm.vg=voidvg.${diskid} rd.luks.uuid=${cfg[partuuid]} rd.vconsole.keymap=${cfg[lang_console]} /" "${dest}"/etc/default/grub
sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT/s/=\"/=\"rd.lvm.vg=voidvg.${diskid} rd.vconsole.keymap=${cfg[lang_console]} /" "${dest}"/etc/default/grub
fi
if [[ "${cfg[hibernate]}" == "1" ]]; then
sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT/s/=\"/=\"resume=${cfg[swapuuid]} /" "${dest}"/etc/default/grub
fi
if [[ "${cfg[fde_key_store]}" == "initramfs" ]]; then
mkdir -p "${dest}"/etc/dracut.conf.d/
echo 'install_items+=" /boot/volume.key /etc/crypttab "' > "${dest}"/etc/dracut.conf.d/crypt-ssh.conf
echo "voidluks-${diskid} UUID=${cfg[partuuid]} /boot/volume.key luks" > "${dest}"/etc/crypttab
echo 'install_items+=" /boot/volume.key /etc/crypttab "' > "${dest}"/etc/dracut.conf.d/crypt-ssh.conf
echo "voidluks-${diskid} UUID=${cfg[partuuid]} /boot/volume.key luks" > "${dest}"/etc/crypttab
fi
module end
module end