Skip to content

Commit

Permalink
resin_update_state_probe: add support for dm-crypt encryption
Browse files Browse the repository at this point in the history
Partition can be encrypted either directly with dm-crypt or with LUKS.
Check for LUKS and if not used use the partition device as passed to
the udev rule as it will be a DM device.

Signed-off-by: Alex Gonzalez <[email protected]>
  • Loading branch information
alexgg committed Sep 23, 2024
1 parent ade58b5 commit 5b6669f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ for cand in $(lsblk -nlo pkname,uuid | grep "${ruuid}" | cut -d " " -f1); do
done

if [ -n "${rpdev}" ]; then
if is_part_encrypted "/dev/${rpdev}"; then
if is_part_encrypted "${rpdev}"; then
if ! is_luks "${rpdev}"; then
rpdev="${part#/dev/}"
fi
cryptdev_uuid=$(lsblk -nlo uuid,kname | grep "${rpdev}" | cut -d " " -f1) || true
if [ -n "${cryptdev_uuid}" ]; then
rpdev=$(lsblk -nlo pkname,uuid | grep "${cryptdev_uuid}" | cut -d " " -f1) || true
Expand Down

0 comments on commit 5b6669f

Please sign in to comment.