summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <williamh@gentoo.org>2011-11-22 12:56:29 -0600
committerWilliam Hubbs <williamh@gentoo.org>2011-11-22 12:56:29 -0600
commit815952a65a9cf41d3d1f353e6bee5cef4de4805a (patch)
treeb4eb88ea666c8316808d50f1c4b253d55850ab18
parent76fec586336775ef8e313df3f8c3981c6b4fdfa8 (diff)
downloadopenrc-815952a65a9cf41d3d1f353e6bee5cef4de4805a.tar.gz
openrc-815952a65a9cf41d3d1f353e6bee5cef4de4805a.tar.bz2
openrc-815952a65a9cf41d3d1f353e6bee5cef4de4805a.tar.xz
Revert "Revert "fsck: add the ability to specify mount points to check""
This reverts commit 5a3599df8a15b1212857335101c9d31fb19e87e2. After review, I am bringing this back to the tree.
-rw-r--r--conf.d/fsck7
-rw-r--r--init.d/fsck.in13
2 files changed, 19 insertions, 1 deletions
diff --git a/conf.d/fsck b/conf.d/fsck
index 5d42c9d..16aa575 100644
--- a/conf.d/fsck
+++ b/conf.d/fsck
@@ -13,6 +13,13 @@
#fsck_passno=">1"
#fsck_passno="<2"
+# If passno is not enough granularity, you can also specify mountpoints to
+# check. This should NOT be used for the default non-multiplexed fsck, or your
+# system might not be checked. Additionally, it is mutually exclusive with
+# the fsck_passno setting.
+#fsck_mnt=""
+#fsck_mnt="/home"
+
# Most modern fs's don't require a full fsck on boot, but for those that do
# it may be advisable to skip this when running on battery.
# WARNING: Do not turn this off if you have any JFS partitions.
diff --git a/init.d/fsck.in b/init.d/fsck.in
index 54537f6..03b2939 100644
--- a/init.d/fsck.in
+++ b/init.d/fsck.in
@@ -48,8 +48,13 @@ start()
if [ -n "$fsck_passno" ]; then
check_extra="[passno $fsck_passno] $check_extra"
+ if -n "$fsck_mnt" ]; then
+ eerror "Only 1 of fsck_passno and fsck_mnt must be set!"
+ return 1
+ fi
fi
ebegin "Checking local filesystems $check_extra"
+ # Append passno mounts
for p in $fsck_passno; do
local IFS="$_IFS"
case "$p" in
@@ -58,10 +63,16 @@ start()
set -- "$@" $(fstabinfo --passno "$p")
unset IFS
done
+ # Append custom mounts
+ for m in $fsck_mnt ; do
+ local IFS="$_IFS"
+ set -- "$@" "$m"
+ unset IFS
+ done
if [ "$RC_UNAME" = Linux ]; then
fsck_opts="$fsck_opts -C0 -T"
- if [ -z "$fsck_passno" ]; then
+ if [ -z "$fsck_passno" -a -z "$fsck_mnt" ]; then
fsck_args=${fsck_args--A -p}
if echo 2>/dev/null >/.test.$$; then
rm -f /.test.$$