# Distributed under the GPL v2
# $Id$
+ 16 Mar 2012; Sebastian Pipping <sping@gentoo.org> defaults/initrd.scripts,
+ defaults/linuxrc:
+ Improve handling of missing /etc/fstab
+
16 Mar 2012; Sebastian Pipping <sping@gentoo.org> defaults/initrd.scripts:
No longer use parameter "-r" (for regex intervals) that busybox awk does not
support
get_mount_fstype()
{
+ [ -e "${NEW_ROOT}"/etc/fstab ] || return 1
awk -v fs="$1" '
/^[[:blank:]]*#/ { next }
$2 == fs { print $3 }
get_mount_options()
{
+ [ -e "${NEW_ROOT}"/etc/fstab ] || return 1
awk -v fs="$1" '
/^[[:blank:]]*#/ { next }
$2 == fs { print $4 }
get_mount_device()
{
+ [ -e "${NEW_ROOT}"/etc/fstab ] || return 1
awk -v fs="$1" '
/^[[:blank:]]*#/ { next }
$2 == fs { print $1 }
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