From 570beb338a1462854522c3d0dd6070986fbd35a0 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Wed, 12 Nov 2008 22:44:37 +0100 Subject: better patch for mount/umount order --- src/core/libs/lib-blockdevices-filesystems.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh index d6b8b03..aa7dd6f 100644 --- a/src/core/libs/lib-blockdevices-filesystems.sh +++ b/src/core/libs/lib-blockdevices-filesystems.sh @@ -389,12 +389,18 @@ fix_filesystems () { [ -z "$1" -o ! -f "$1" ] && die_error "Fix_filesystems needs a file with the setup structure in it" - for line in $(tac $1); do #TODO: we should probably do / as last because we can't umount it if other filesystems are mounted in it. for now we can be sure we do swap last and before that /. + # Umount all things first, umount / last. After that create/mount stuff again, with / first + # TODO: we now rely on the fact that the manual mountpoint selecter uses this order 'swap,/, /<*>'. It works for now but it's not the most solid + + for line in $(tac $1); do + MP=$(echo $line | cut -d: -f 3) + umount ${var_TARGET_DIR}${MP} + done + for line in $(cat $1); do PART=$(echo $line | cut -d: -f 1) FSTYPE=$(echo $line | cut -d: -f 2) MP=$(echo $line | cut -d: -f 3) DOMKFS=$(echo $line | cut -d: -f 4) - umount ${var_TARGET_DIR}${MP} if [ "$DOMKFS" = "yes" ]; then if [ "$FSTYPE" = "swap" ]; then infofy "Creating and activating swapspace on $PART" -- cgit v1.2.3-54-g00ecf