#!/bin/bash build() { local fsck= added=0 add_fsck() { if [[ $1 = ext[234] ]]; then add_binary fsck.ext4 add_symlink /usr/bin/fsck.ext2 fsck.ext4 add_symlink /usr/bin/fsck.ext3 fsck.ext4 else add_binary "fsck.$1" fi } if (( ! fs_autodetect_failed )) && [[ $rootfstype$usrfstype ]]; then if [[ $rootfstype ]]; then add_fsck $rootfstype && (( ++added )) fi if [[ $usrfstype && $usrfstype != $rootfstype ]]; then add_fsck $usrfstype && (( ++added )) fi else for fsck in /{usr/,}{s,}bin/fsck.*; do [[ -f $fsck ]] || continue add_binary "$fsck" && (( ++added )) done fi if (( added )); then add_binary fsck else warning "No fsck helpers found. fsck will not be run on boot." fi } help() { cat <