Skip to content

Commit 52aaad6

Browse files
authored
Merge pull request #1394 from vojtechtrefny/main_check-luks-persistent-flags
Check that allow-discards flag is set by default on LUKS2 devices
2 parents 00bfd50 + cb21740 commit 52aaad6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

autopart-luks-2.ks.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ if [[ "$result" != "2" ]] ; then
3636
exit 1
3737
fi
3838

39+
# Check if the 'allow-discards' flag is set.
40+
result=$(cryptsetup luksDump ${crypted} | grep "Flags" | cut -d: -f2 | tr -d "\t\n ")
41+
42+
if [[ "$result" != "allow-discards" ]] ; then
43+
echo "*** unexpected flags set for ${crypted}: ${result}" > /root/RESULT
44+
exit 1
45+
fi
46+
3947
# Try to use the passphrase.
4048
echo "passphrase" | cryptsetup luksOpen --test-passphrase "${crypted}"
4149

0 commit comments

Comments
 (0)