At one point live boot had support for fsck'ing persistent media before
mounting read/write.  This appeared to have been removed due to lack
of usage/interest. 

We do have a local use case and I was wondering if something like the
following would be accepted upstream (assuming it is vaguely close
to doing the right thing -- things have moved around a bit since
a974d9cd39ed0ed6490c7894056c7c0666855994).


Re-add experimental forcepersistentfsck bootoption

Similar to a974d9cd39ed0ed6490c7894056c7c0666855994.  Additionally,
allow the user to force a fsck via the command line.
---
 components/9990-misc-helpers.sh | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/components/9990-misc-helpers.sh b/components/9990-misc-helpers.sh
index 9318a4b..668d4d7 100755
--- a/components/9990-misc-helpers.sh
+++ b/components/9990-misc-helpers.sh
@@ -709,6 +709,34 @@ mount_persistence_media ()
                return 1
        fi
 
+       for _PARAMETER in ${LIVE_BOOT_CMDLINE}
+       do
+               case "${_PARAMETER}" in
+                       forcefsck)
+                               FORCEFSCK="Yes"
+                               ;;
+               esac
+       done
+
+       if [ "${PERSISTENT_FSCK}" = "Yes" ] || [ "${FORCEFSCK}" = "Yes" ]
+       then
+               if [ "$FORCEFSCK" = "Yes" ]
+               then
+                       force="-f"
+               else
+                       force=""
+               fi
+
+               if [ "$FSCKFIX" = yes ]
+               then
+                       fix="-y"
+               else
+                       fix="-a"
+               fi
+
+               fsck $fix $force ${device} >/dev/null
+       fi
+
        backing="/live/persistence/$(basename ${device})"
 
        mkdir -p "${backing}"
-- 
1.9.1


Reply via email to