[arch-projects] [initscripts] [PATCH 03/20] rc.sysinit: refactor /etc/mtab symlink detection to avoid empty if clause
Kurt J. Bosch
kjb-temp-2009 at alpenjodel.de
Mon Jun 27 18:32:44 EDT 2011
---
rc.sysinit | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/rc.sysinit b/rc.sysinit
index c665787..2596fc1 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -197,12 +197,12 @@ 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
- :
-elif [[ -x $(type -P findmnt) && -e /proc/self/mountinfo ]]; then
- findmnt -rnu -o SOURCE,TARGET,FSTYPE,OPTIONS >| /etc/mtab
-else
- cat /proc/mounts >| /etc/mtab
+if [[ ! -L /etc/mtab ]]; then
+ 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
fi
# now mount all the local filesystems
--
1.7.1
More information about the arch-projects
mailing list