From ca431c14260778dcf67735980fab953be68a92fb Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Tue, 28 Dec 2010 16:08:27 +0100 Subject: cleanup target_configure_fstab(), correct exit codes --- src/core/libs/lib-blockdevices-filesystems.sh | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/core/libs') 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 } -- cgit v1.2.3-54-g00ecf