diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-03-07 08:26:51 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-03-07 08:26:51 +0000 |
commit | 3b4cece145993890ba8499f2af18f77c7ddea0e9 (patch) | |
tree | 12c3e79d80efe0f3602279561216230f3c874aa4 | |
parent | eb96e64b989ae7cf39cd0cdf849104ac1d5ee655 (diff) | |
download | mkinitfs-3b4cece145993890ba8499f2af18f77c7ddea0e9.tar.bz2 mkinitfs-3b4cece145993890ba8499f2af18f77c7ddea0e9.tar.xz |
init: avoid error message if /etc/fstab is missing in sysroot
-rwxr-xr-x | initramfs-init.in | 9 |
1 files 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 |