Improve handling of missing /etc/fstab

cleanup-cruft
Sebastian Pipping 13 years ago
parent 3ca4d17874
commit adefd0fccc

@ -5,6 +5,10 @@
# Distributed under the GPL v2 # Distributed under the GPL v2
# $Id$ # $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: 16 Mar 2012; Sebastian Pipping <sping@gentoo.org> defaults/initrd.scripts:
No longer use parameter "-r" (for regex intervals) that busybox awk does not No longer use parameter "-r" (for regex intervals) that busybox awk does not
support support

@ -1205,6 +1205,7 @@ get_mounts_list()
get_mount_fstype() get_mount_fstype()
{ {
[ -e "${NEW_ROOT}"/etc/fstab ] || return 1
awk -v fs="$1" ' awk -v fs="$1" '
/^[[:blank:]]*#/ { next } /^[[:blank:]]*#/ { next }
$2 == fs { print $3 } $2 == fs { print $3 }
@ -1213,6 +1214,7 @@ get_mount_fstype()
get_mount_options() get_mount_options()
{ {
[ -e "${NEW_ROOT}"/etc/fstab ] || return 1
awk -v fs="$1" ' awk -v fs="$1" '
/^[[:blank:]]*#/ { next } /^[[:blank:]]*#/ { next }
$2 == fs { print $4 } $2 == fs { print $4 }
@ -1221,6 +1223,7 @@ get_mount_options()
get_mount_device() get_mount_device()
{ {
[ -e "${NEW_ROOT}"/etc/fstab ] || return 1
awk -v fs="$1" ' awk -v fs="$1" '
/^[[:blank:]]*#/ { next } /^[[:blank:]]*#/ { next }
$2 == fs { print $1 } $2 == fs { print $1 }

@ -776,6 +776,7 @@ fi
for fs in $fslist; do for fs in $fslist; do
dev=$(get_mount_device $fs) dev=$(get_mount_device $fs)
[ -z "${dev}" ] && continue
# Resolve it like util-linux mount does # Resolve it like util-linux mount does
[ -L ${dev} ] && dev=`readlink ${dev}` [ -L ${dev} ] && dev=`readlink ${dev}`
# In this case, it's probably part of the filesystem # In this case, it's probably part of the filesystem

Loading…
Cancel
Save