No need for that sed anymore

This commit is contained in:
Roy Marples 2007-09-25 19:18:09 +00:00
parent 6a14825e74
commit 15b703c6e4

View File

@ -7,7 +7,7 @@ and optionally repair them."
do_mtab() { do_mtab() {
# Don't create mtab if /etc is readonly # Don't create mtab if /etc is readonly
if ! echo 2>/dev/null >/etc/mtab ; then if ! printf "" 2>/dev/null >/etc/mtab ; then
ewarn "Skipping /etc/mtab initialization" "(ro root?)" ewarn "Skipping /etc/mtab initialization" "(ro root?)"
return 0 return 0
fi fi
@ -19,10 +19,9 @@ do_mtab() {
grep -v "^[^ ]* / " /proc/mounts >> /etc/mtab grep -v "^[^ ]* / " /proc/mounts >> /etc/mtab
# Now make sure /etc/mtab have additional info (gid, etc) in there # Now make sure /etc/mtab have additional info (gid, etc) in there
local mnt= mnts="$(mountinfo | sed -e "s/^/'/g" -e "s/$/'/g")" local mnt=
eval set -- ${mnts} mountinfo | while read mnt; do
for mnt in "$@" ; do if fstabinfo --quiet --mountcmd "${mnt}"; then
if fstabinfo --mountcmd "${mnt}" >/dev/null ; then
mount -f -o remount "${mnt}" mount -f -o remount "${mnt}"
fi fi
done done