From ed5cc9cb9ba777e2fe0d73a65c66d304f118dffc Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sat, 26 Nov 2011 12:37:59 -0500 Subject: 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 Signed-off-by: Tom Gundersen --- rc.sysinit | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'rc.sysinit') diff --git a/rc.sysinit b/rc.sysinit index 6455566..746b0ad 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -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 -- cgit v1.2.3