[arch-projects] [mkinitcpio][PATCH 11/11] install/fsck: new install hook to add fsck and helpers

Dave Reisner d at falconindy.com
Fri Nov 11 21:55:21 EST 2011


Provides /sbin/fsck and any helper binaries to the image. If processed
after the autodetect hook, only the helper for the root FS is added.

Signed-off-by: Dave Reisner <dreisner at archlinux.org>
---
 install/fsck |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)
 create mode 100644 install/fsck

diff --git a/install/fsck b/install/fsck
new file mode 100644
index 0000000..a2f538d
--- /dev/null
+++ b/install/fsck
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+build() {
+    add_binary /sbin/fsck
+
+    if (( ! fs_autodetect_failed )) && [[ $rootfstype ]]; then
+        add_binary /sbin/fsck.$rootfstype
+    else
+        (
+            shopt -s nullglob
+            for fsck in "$BASEDIR"/sbin/fsck.*; do
+                add_binary "${fsck#$BASEDIR}"
+            done
+        )
+    fi
+}
+
+help() {
+    cat <<HELPEOF
+This hook provides fsck and filesystem specific helpers to perform an fsck
+operation on the root device prior to mounting. If the autodetect hook is used,
+only the fsck helper specific to your filesystem will be added to the image. It
+is highly recommended that if you include this hook that you also include any
+necessary modules to ensure your keyboard will work in early userspace.
+HELPEOF
+}
+
+# vim: set ft=sh ts=4 sw=4 et:
-- 
1.7.7.3



More information about the arch-projects mailing list