diff options
| author | Tails developers <amnesia@boum.org> | 2012-03-02 15:26:03 +0100 |
|---|---|---|
| committer | Daniel Baumann <daniel@debian.org> | 2012-04-05 07:48:21 +0200 |
| commit | 642591226c57f1902e6d159c0dea5bbee2afc572 (patch) | |
| tree | e16b4c70ed611d869cd90afa0aab52814c684d8a /scripts/live | |
| parent | 11492e8c656455a7d7ba0219d0018b282792a9d4 (diff) | |
| download | live-boot-642591226c57f1902e6d159c0dea5bbee2afc572.tar.gz live-boot-642591226c57f1902e6d159c0dea5bbee2afc572.zip | |
Refactor closing of persistent devices upon failure.
Errors can occur at various places so it's best to just do it once in
a consistent manner.
Diffstat (limited to 'scripts/live')
| -rwxr-xr-x | scripts/live | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/scripts/live b/scripts/live index a24da07..e248937 100755 --- a/scripts/live +++ b/scripts/live @@ -1228,9 +1228,19 @@ setup_unionfs () [ -n "${DEBUG}" ] && cp ${custom_mounts} "${rootmnt}/live/persistent" # Now we do the actual mounting (and symlinking) - do_custom_mounts ${custom_mounts} + local used_overlays="" + used_overlays=$(activate_custom_mounts ${custom_mounts}) rm ${custom_mounts} + # Close unused overlays (e.g. due to missing $persistence_list) + for overlay in ${overlay_devices} + do + if echo ${used_overlays} | grep -qve "^\(.* \)\?${device}\( .*\)\?$" + then + close_persistent_media ${overlay} + fi + done + # Look for other snapshots to copy in try_snap "${root_snapdata}" "${rootmnt}" "ROOT" # This second type should be removed when snapshot grow smarter |
