From 3b4cece145993890ba8499f2af18f77c7ddea0e9 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 7 Mar 2012 08:26:51 +0000 Subject: init: avoid error message if /etc/fstab is missing in sysroot --- initramfs-init.in | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/initramfs-init.in b/initramfs-init.in index 226872b..88f30f1 100755 --- a/initramfs-init.in +++ b/initramfs-init.in @@ -572,12 +572,13 @@ if ! [ -f "$sysroot"/etc/apk/repositories ]; then fi # respect mount options in fstab for ALPINE_MNT (e.g if user wants rw) -opts=$(awk "\$2 == \"$ALPINE_MNT\" {print \$4}" $sysroot/etc/fstab) -if [ -n "$opts" ]; then - mount -o remount,$opts "$ALPINE_MNT" +if [ -f "$sysroot"/etc/fstab ]; then + opts=$(awk "\$2 == \"$ALPINE_MNT\" {print \$4}" $sysroot/etc/fstab) + if [ -n "$opts" ]; then + mount -o remount,$opts "$ALPINE_MNT" + fi fi - # fix inittab if alternative console setup_inittab_console $CONSOLE -- cgit v1.2.3