From 580526a428c34a14c5aad28760054565bda92656 Mon Sep 17 00:00:00 2001 From: teldra Date: Fri, 12 Mar 2021 18:09:57 +0100 Subject: [PATCH] restructure --- modules/40-basesystem/pre | 2 +- modules/50-bootloader/install | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/modules/40-basesystem/pre b/modules/40-basesystem/pre index 4e97c90..52334ca 100644 --- a/modules/40-basesystem/pre +++ b/modules/40-basesystem/pre @@ -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 diff --git a/modules/50-bootloader/install b/modules/50-bootloader/install index b295a1c..fe87487 100644 --- a/modules/50-bootloader/install +++ b/modules/50-bootloader/install @@ -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 \ No newline at end of file +module end