@@ -127,12 +127,17 @@ fi
for partition_set in $partition_sets; do
partition_label="$(awk -v var="$partition_set" 'BEGIN{split(var,a,":"); print a[1]}')"
+ partition_mountpoint="$(awk -v var="$partition_set" 'BEGIN{split(var,a,":"); print a[2]}')"
partition_format="$(awk -v var="$partition_set" 'BEGIN{split(var,a,":"); print a[3]}')"
partition=/dev/disk/by-partlabel/"$partition_label"
crypt_mount_name="encrypted_$partition_label"
decrypted_part=/dev/mapper/"$crypt_mount_name"
# clevis does not work with links in /dev/disk*
part_device=$(readlink -f "$partition")
+ # check if we are trying to mount root
+ if [ "$partition_mountpoint" = "/" ]; then
+ echo "ROOT=$decrypted_part" >/conf/param.conf
+ fi
if /usr/sbin/cryptsetup luksDump --batch-mode "$partition" \
| grep -q "clevis"; then
@@ -169,6 +174,7 @@ for partition_set in $partition_sets; do
;;
esac
+
# delete initial key
# afterwards no new keys can be enrolled
cryptsetup -v luksKillSlot -q "$part_device" 0
@@ -125,12 +125,17 @@ fi
for partition_set in $partition_sets; do
partition_label="$(awk -v var="$partition_set" 'BEGIN{split(var,a,":"); print a[1]}')"
+ partition_mountpoint="$(awk -v var="$partition_set" 'BEGIN{split(var,a,":"); print a[2]}')"
partition_format="$(awk -v var="$partition_set" 'BEGIN{split(var,a,":"); print a[3]}')"
partition=/dev/disk/by-partlabel/"$partition_label"
crypt_mount_name="encrypted_$partition_label"
decrypted_part=/dev/mapper/"$crypt_mount_name"
part_device=$(readlink -f "$partition")
+ # check if we are trying to mount root
+ if [ "$partition_mountpoint" = "/" ]; then
+ echo "ROOT=$decrypted_part" >/conf/param.conf
+ fi
# check if partition is already encrypted with systemd-tpm2
if /usr/sbin/cryptsetup luksDump --batch-mode "$partition" \
| grep -q "systemd-tpm2"; then