diff options
author | Dave Reisner <dreisner@archlinux.org> | 2011-11-06 18:32:22 +0100 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2011-11-15 04:48:36 +0100 |
commit | 00eefc36ae7c8f5f893b2c184fd8f32a3629031b (patch) | |
tree | dfa841ef6ed0e3495caf85c12d906bdd87a6a0d4 /install | |
parent | 5ee994c10029786947dc495e7078bbb30ab4a130 (diff) | |
download | mkinitcpio-00eefc36ae7c8f5f893b2c184fd8f32a3629031b.tar.gz mkinitcpio-00eefc36ae7c8f5f893b2c184fd8f32a3629031b.tar.xz |
install/fsck: new install hook to add fsck and helpers
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@archlinux.org>
Diffstat (limited to 'install')
-rw-r--r-- | install/fsck | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/install/fsck b/install/fsck new file mode 100644 index 0000000..852ae6a --- /dev/null +++ b/install/fsck @@ -0,0 +1,32 @@ +#!/bin/bash + +build() { + local added=0 + + if (( ! fs_autodetect_failed )) && [[ $rootfstype ]]; then + add_binary /sbin/fsck.$rootfstype && (( ++added )) + else + for fsck in "$BASEDIR"/sbin/fsck.*; do + [[ -f $fsck ]] || continue + add_binary "${fsck#$BASEDIR}" && (( ++added )) + done + fi + + if (( added )); then + add_binary /sbin/fsck + else + warning "No fsck helpers found. fsck will not be run on boot." + 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: |