diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2009-07-26 16:07:59 +0200 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2009-07-26 16:07:59 +0200 |
commit | 5fe9c9f753a9ad40e17cc5647e07ae7c4df2ac26 (patch) | |
tree | 842f3fb75dc815f8e773815edb57b1ff02cd6675 /src/core/libs/lib-blockdevices-filesystems.sh | |
parent | d1325ad96fa3ae27e74c192b36d858353f751d0c (diff) |
cleaner separation of concerns: remove $PART_ROOT hack in favor of more useful partion finding function
Diffstat (limited to 'src/core/libs/lib-blockdevices-filesystems.sh')
-rw-r--r-- | src/core/libs/lib-blockdevices-filesystems.sh | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh index a8a7dcf..abf728f 100644 --- a/src/core/libs/lib-blockdevices-filesystems.sh +++ b/src/core/libs/lib-blockdevices-filesystems.sh @@ -4,6 +4,8 @@ # FORMAT DEFINITIONS: # -- formats used to interface with this library -- +# these files will persist during the entire aif session (and even after stopping aif) +# so you can use them to retrieve data from them (or use functions in this library to do that for you) # $TMP_PARTITIONS # one line per partition, blockdevice + partioning string for sfdisk. See docs for function partition for more info. # $TMP_BLOCKDEVICES @@ -76,6 +78,13 @@ target_umountall() done } +# tells you which blockdevice is configured for the specific mountpoint +# $1 mountpoint +get_device_with_mount () { + ANSWER_DEVICE=`grep ";$1;" $TMP_BLOCKDEVICES 2>/dev/null | cut -d ' ' -f1` + [ -n "$ANSWER_DEVICE" ] # set correct exit code +} + # taken from setup script, modified for separator control # $1 set to 1 to echo a newline after device instead of a space (optional) @@ -487,11 +496,6 @@ rollback_filesystems () if umount $part_real >$LOG then done_umounts+=("$part_real") - if [ "$fs_mount" = target -a "$fs_mountpoint" = '/' ] - then - debug FS "clearing \$PART_ROOT (was: $PART_ROOT)" - PART_ROOT= - fi else warnings="$warnings\nCould not umount umount $part_real . Probably device is still busy. See $LOG" show_warning "Umount failure" "Could not umount umount $part_real . Probably device is still busy. See $LOG" #TODO: fix device busy things @@ -706,11 +710,6 @@ process_filesystem () debug 'FS' "mounting $part on $dst" mkdir -p $dst &>/dev/null # directories may or may not already exist mount -t $fs_type $part $dst >$LOG 2>&1 || ( show_warning 'Mount' "Error mounting $part on $dst" ; return 1 ) - if [ "$fs_mount" = target -a $fs_mountpoint = '/' ] - then - debug FS "setting \$PART_ROOT to $part" - PART_ROOT=$part - fi fi fi |