aboutsummaryrefslogtreecommitdiff
path: root/rc.sysinit
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2011-11-26 17:37:59 (GMT)
committerTom Gundersen <teg@jklm.no>2011-11-26 17:57:16 (GMT)
commited5cc9cb9ba777e2fe0d73a65c66d304f118dffc (patch)
treeaad126e347757230ccdf97b272b06012078f7b09 /rc.sysinit
parentf1f103daccdd73c019edcf21f0059e5d3d5e2336 (diff)
downloadinitscripts-ed5cc9cb9ba777e2fe0d73a65c66d304f118dffc.tar.xz
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-xrc.sysinit13
1 files changed, 2 insertions, 11 deletions
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