small fix

This commit is contained in:
teldra 2021-03-12 22:04:53 +01:00
parent b5c8fbd0e5
commit 5c898563a8
1 changed files with 3 additions and 3 deletions

View File

@ -4,15 +4,15 @@ source "${vars}/disk"
diskid="${cfg[diskid]//-/_}"
if [[ ! "${cfg[fde_key_store]}" == "none" ]]; then
sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT/s/=\"/=\"rd.luks.uuid=${cfg[partuuid]} /" "${dest}"/etc/default/grub
if [[ ! "${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
fi
sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT/s/=\"/=\"rd.luks.uuid=${cfg[partuuid]} /" "${dest}"/etc/default/grub
if [[ ! -f "${dest}"/boot/volume.key ]] && [[ ! "${cfg[fde_key_store]}" == "twice" ]]; then
if [[ ! -f "${dest}"/boot/volume.key ]] && [[ ! "${cfg[fde_key_store]}" == "twice" ]] && [[ ! "${cfg[fde_key_store]}" == "once" ]]; 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