/etc/mtab is now a true reflection on /proc/mounts. The only exception is that we punt any / on tmpfs entry, #194615.

This commit is contained in:
Roy Marples 2007-10-29 13:53:21 +00:00
parent e372729b8c
commit e2ba92f773
2 changed files with 8 additions and 13 deletions

View File

@ -3,6 +3,9 @@
29 Oct 2007; Roy Marples <uberlord@gentoo.org>: 29 Oct 2007; Roy Marples <uberlord@gentoo.org>:
/etc/mtab is now a true reflection on /proc/mounts.
The only exception is that we punt any / on tmpfs entry, #194615.
Network config arrays are now split by embedded new lines instead of Network config arrays are now split by embedded new lines instead of
being evaled into space separated values. This makes it easier to read, being evaled into space separated values. This makes it easier to read,
maintain and document as discussed on gentoo-dev. maintain and document as discussed on gentoo-dev.

View File

@ -13,19 +13,11 @@ do_mtab() {
fi fi
ebegin "Updating /etc/mtab" ebegin "Updating /etc/mtab"
# Add the entry for / to mtab # With / as tmpfs we cannot umount -at tmpfs in localmount as that
mount -f / # makes / readonly and dismounts all tmpfs even if in use which is
# not good. Luckily, umount uses /etc/mtab instead of /proc/mounts
# Don't list root more than once # which allows this hack to work.
grep -v "^[^ ]* / " /proc/mounts >> /etc/mtab grep -v "^[^ ]* / tmpfs" /proc/mounts > /etc/mtab
# Now make sure /etc/mtab have additional info (gid, etc) in there
local mnt=
mountinfo | while read mnt; do
if fstabinfo --quiet "${mnt}"; then
mount -f -o remount "${mnt}"
fi
done
# Remove stale backups # Remove stale backups
rm -f /etc/mtab~ /etc/mtab~~ rm -f /etc/mtab~ /etc/mtab~~