Skip to content

Commit

Permalink
Merge pull request #2154 from petroniusniger/issue-2151
Browse files Browse the repository at this point in the history
Fix for issue 2151: only the first 2 parameters in /etc/crypttab are …
  • Loading branch information
gdha committed Jun 5, 2019
2 parents e832882 + 73f5a4b commit b3de549
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion usr/share/rear/layout/save/GNU/Linux/260_crypt_layout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ while read target_name junk ; do
key_size=$(cryptsetup luksDump $source_device | grep "MK bits" | sed -r 's/^.+:\s*(.+)$/\1/')
hash=$(cryptsetup luksDump $source_device | grep "Hash spec" | sed -r 's/^.+:\s*(.+)$/\1/')
uuid=$(cryptsetup luksDump $source_device | grep "UUID" | sed -r 's/^.+:\s*(.+)$/\1/')
keyfile_option=$([ -f /etc/crypttab ] && awk '$1 == "'"$target_name"'" && $3 != "none" && $3 != "-" { print "keyfile=" $3; }' /etc/crypttab)
keyfile_option=$([ -f /etc/crypttab ] && awk '$1 == "'"$target_name"'" && $3 != "none" && $3 != "-" && $3 != "" { print "keyfile=" $3; }' /etc/crypttab)

echo "crypt /dev/mapper/$target_name $source_device cipher=$cipher-$mode key_size=$key_size hash=$hash uuid=$uuid $keyfile_option" >> $DISKLAYOUT_FILE
done < <( dmsetup ls --target crypt )
Expand Down

0 comments on commit b3de549

Please sign in to comment.