From adefd0fccc3f2820da63a2044b202262583fb16a Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Fri, 16 Mar 2012 23:36:30 +0100 Subject: [PATCH] Improve handling of missing /etc/fstab --- ChangeLog | 4 ++++ defaults/initrd.scripts | 3 +++ defaults/linuxrc | 1 + 3 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 55f5569..4a306ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ # Distributed under the GPL v2 # $Id$ + 16 Mar 2012; Sebastian Pipping defaults/initrd.scripts, + defaults/linuxrc: + Improve handling of missing /etc/fstab + 16 Mar 2012; Sebastian Pipping defaults/initrd.scripts: No longer use parameter "-r" (for regex intervals) that busybox awk does not support diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index f504c3f..296b150 100755 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -1205,6 +1205,7 @@ get_mounts_list() get_mount_fstype() { + [ -e "${NEW_ROOT}"/etc/fstab ] || return 1 awk -v fs="$1" ' /^[[:blank:]]*#/ { next } $2 == fs { print $3 } @@ -1213,6 +1214,7 @@ get_mount_fstype() get_mount_options() { + [ -e "${NEW_ROOT}"/etc/fstab ] || return 1 awk -v fs="$1" ' /^[[:blank:]]*#/ { next } $2 == fs { print $4 } @@ -1221,6 +1223,7 @@ get_mount_options() get_mount_device() { + [ -e "${NEW_ROOT}"/etc/fstab ] || return 1 awk -v fs="$1" ' /^[[:blank:]]*#/ { next } $2 == fs { print $1 } diff --git a/defaults/linuxrc b/defaults/linuxrc index b883155..34f1d69 100755 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -776,6 +776,7 @@ fi for fs in $fslist; do dev=$(get_mount_device $fs) + [ -z "${dev}" ] && continue # Resolve it like util-linux mount does [ -L ${dev} ] && dev=`readlink ${dev}` # In this case, it's probably part of the filesystem -- 2.26.2