summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2010-12-28 16:08:27 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2010-12-28 16:08:27 +0100
commitca431c14260778dcf67735980fab953be68a92fb (patch)
treeae4b081162a3fa4e7ed475c942660ba0e20a0785
parent4d8aea9a74d78f15708dc9ea6dbfaf4bcac9b279 (diff)
cleanup target_configure_fstab(), correct exit codes
-rw-r--r--src/core/libs/lib-blockdevices-filesystems.sh15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh
index f092bd1..d98a056 100644
--- a/src/core/libs/lib-blockdevices-filesystems.sh
+++ b/src/core/libs/lib-blockdevices-filesystems.sh
@@ -353,20 +353,15 @@ mapdev() {
-# auto_fstab(). taken from setup
# preprocess fstab file
# comments out old fields and inserts new ones
-# according to partitioning/formatting stage
-#
+# according to $TMP_FSTAB, set through process_filesystem calls
target_configure_fstab()
{
- if [ -f $TMP_FSTAB ]
- then
- # comment out stray /dev entries
- sed -i 's/^\/dev/#\/dev/g' $var_TARGET_DIR/etc/fstab
- # append entries from new configuration
- sort $TMP_FSTAB >>$var_TARGET_DIR/etc/fstab
- fi
+ [ -f $TMP_FSTAB ] || return 0 # we can't do anything, but not really a failure
+ sed -i 's/^\/dev/#\/dev/g' $var_TARGET_DIR/etc/fstab || return 1
+ sort $TMP_FSTAB >> $var_TARGET_DIR/etc/fstab || return 1
+ return 0
}