diff options
| author | Tails developers <amnesia@boum.org> | 2012-02-11 21:35:35 +0100 |
|---|---|---|
| committer | Daniel Baumann <daniel@debian.org> | 2012-04-01 22:13:47 +0200 |
| commit | 3b8017136669394c9e2c92aca2d917c98a186b34 (patch) | |
| tree | a7963179571f21fa19b8afb3d357f7958b5e0877 /scripts | |
| parent | 656155fcea1cc331306ec32c246209e0098efdc7 (diff) | |
| download | live-boot-3b8017136669394c9e2c92aca2d917c98a186b34.tar.gz live-boot-3b8017136669394c9e2c92aca2d917c98a186b34.zip | |
Close unused LUKS devices in all cases.
Previously LUKS partitions whose fs had the incorrect partition label
would be left open when using persistent-storage=partition.
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/live-helpers | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/scripts/live-helpers b/scripts/live-helpers index 43485ed..db1eb9f 100644 --- a/scripts/live-helpers +++ b/scripts/live-helpers @@ -409,11 +409,11 @@ find_persistent_media () done fi + overlay_on_dev="" + snapshot_on_dev="" if echo ${PERSISTENT_STORAGE} | grep -qe "\<file\>" then devfstype="$(get_fstype ${dev})" - overlay_on_dev="" - snapshot_on_dev="" backing="${persistent_backing}/$(basename ${dev})" mkdir -p "${backing}" if is_supported_fs ${devfstype} && try_mount "${dev}" "${backing}" "rw" "${devfstype}" @@ -441,15 +441,17 @@ find_persistent_media () done done fi - if [ -z "${overlay_on_dev}" ] + if [ -z "${overlay_on_dev}" ] && [ -z "${snapshot_on_dev}" ] then umount ${backing} > /dev/null 2>&1 || true - if [ -z "${snapshot_on_dev}" ] && [ -n "${luks_device}" ] && /sbin/cryptsetup status "${luks_device}" 1> /dev/null - then - /sbin/cryptsetup luksClose "${luks_device}" - fi fi fi + if [ -z "${overlay_on_dev}" ] && [ -z "${snapshot_on_dev}" ] && \ + [ -n "${luks_device}" ] && \ + /sbin/cryptsetup status "${luks_device}" 1> /dev/null 2>&1 + then + /sbin/cryptsetup luksClose "${luks_device}" + fi done } |
