diff options
| author | Tails developers <amnesia@boum.org> | 2012-12-07 22:29:15 +0100 |
|---|---|---|
| committer | Daniel Baumann <mail@daniel-baumann.ch> | 2013-05-06 13:54:13 +0200 |
| commit | 0c19af3ab06b80595764a28331ca459e25075adf (patch) | |
| tree | 100b4f044d82cea06d238998397121aac486cbed /scripts | |
| parent | 63a94b2bfcc454b05ead6e06f08363e4f6ac3b71 (diff) | |
| download | live-boot-0c19af3ab06b80595764a28331ca459e25075adf.tar.gz live-boot-0c19af3ab06b80595764a28331ca459e25075adf.zip | |
Handling already mounted persistence backing media correctly.
I.e. treat the case where a backing media already had been mounted in
the expected place like a success (by printing the mount dir). This
doesn't fix any bug in live-boot, but it will come in handy for the
(soon-to-come) script for activating custom persistence in user-space.
While we're at it, document this function.
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/boot/9990-misc-helpers.sh | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/boot/9990-misc-helpers.sh b/scripts/boot/9990-misc-helpers.sh index c080d15..29f943c 100755 --- a/scripts/boot/9990-misc-helpers.sh +++ b/scripts/boot/9990-misc-helpers.sh @@ -714,6 +714,11 @@ try_mount () fi } +# Try to mount $device to the place expected by live-boot. If $device +# is already mounted somewhere, move it to the expected place. If +# we're only probing $device (to check if it has custom persistence) +# $probe should be set, which suppresses warnings upon failure. On +# success, print the mount point for $device. mount_persistence_media () { local device=${1} @@ -751,8 +756,12 @@ mount_persistence_media () rmdir "${backing}" return 1 fi + else + # This means that $device has already been mounted on + # the place expected by live-boot, so we're done. + echo ${backing} + return 0 fi - return 0 } close_persistence_media () |
