diff options
author | Dave Reisner <dreisner@archlinux.org> | 2011-11-26 12:37:59 -0500 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2011-11-26 18:57:16 +0100 |
commit | ed5cc9cb9ba777e2fe0d73a65c66d304f118dffc (patch) | |
tree | aad126e347757230ccdf97b272b06012078f7b09 /rc.sysinit | |
parent | f1f103daccdd73c019edcf21f0059e5d3d5e2336 (diff) |
rc.sysinit: force linking of /etc/mtab to /proc/self/mounts
At this point, libmount powered mount does the right thing in 99% of
cases. util-linux tools all behave in a much more expected manner when
this symlink exists, particularly when parsing /etc/mtab.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Tom Gundersen <teg@jklm.no>
Diffstat (limited to 'rc.sysinit')
-rwxr-xr-x | rc.sysinit | 13 |
1 files changed, 2 insertions, 11 deletions
@@ -198,17 +198,8 @@ fsck_reboot $fsckret status "Remounting Root Read/Write" \ mount -n -o remount,rw / -# don't touch /etc/mtab if it is a symlink to /proc/self/mounts -if [[ ! -L /etc/mtab ]]; then - stat_busy "Creating mtab" - rm -f /etc/mtab~* # delete any stale locks - if [[ -x $(type -P findmnt) && -e /proc/self/mountinfo ]]; then - findmnt -rnu -o SOURCE,TARGET,FSTYPE,OPTIONS >| /etc/mtab - else - cat /proc/mounts >| /etc/mtab - fi - (( $? == 0 )) && stat_done || stat_fail -fi +# force linkage of /etc/mtab to the kernel +[[ -L /etc/mtab ]] || ln -sf /proc/self/mounts /etc/mtab # now mount all the local filesystems run_hook sysinit_premount |