From 8306a9c45482c983c46594d104bf7415efd0a12f Mon Sep 17 00:00:00 2001 From: Gardouille Date: Mon, 14 Dec 2020 12:41:08 +0100 Subject: [PATCH] Manage crypttab only if LUKS is present --- debian/chroot.install | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/debian/chroot.install b/debian/chroot.install index 0449632..c806752 100755 --- a/debian/chroot.install +++ b/debian/chroot.install @@ -235,9 +235,11 @@ mountpoint -q /target/run/udev || mount --bind -- /run/udev /target/run/u ### }}} ## }}} ## Luks {{{ -luks_part_uuid=$(blkid | grep "${hdd}2.*TYPE=\"crypto_LUKS\"" | sed 's/.*UUID="\(.*\)" TYPE.*/\1/') -### Ensure crypttab file contains the LUKS informations -printf '%b\n' "${luks_pv_name} UUID=${luks_part_uuid} none luks,discard" >> /target/etc/crypttab +if [ "${manage_luks}" -eq 0 ]; then + luks_part_uuid=$(blkid | grep "${hdd}2.*TYPE=\"crypto_LUKS\"" | sed 's/.*UUID="\(.*\)" TYPE.*/\1/') + ### Ensure crypttab file contains the LUKS informations + printf '%b\n' "${luks_pv_name} UUID=${luks_part_uuid} none luks,discard" >> /target/etc/crypttab +fi ### Regenerate initramfs chroot /target update-initramfs -k all -u