--nomdadmconf Do not include local /etc/mdadm.conf
--lvmconf Include local /etc/lvm/lvm.conf
--nolvmconf Do not include local /etc/lvm/lvm.conf
+ --fscks [LIST] Add a space-separated list of fsck helpers.
+ --nofscks Inhibit installation of any fsck helpers.
-h, --help This message
--debug Output debug information of the build process
--profile Output profile information of the build process
--filesystems) push_arg filesystems_l "$@" || shift;;
-I|--install) push_arg install_items "$@" || shift;;
--fwdir) push_arg fw_dir_l "$@" || shift;;
+ --fscks) push_arg fscks_l "$@" || shift;;
+ --nofscks) nofscks_l="yes";;
-k|--kmoddir) read_arg drivers_dir_l "$@" || shift;;
-c|--conf) read_arg conffile "$@" || shift;;
--confdir) read_arg confdir "$@" || shift;;
done
fi
+if (( ${#fscks_l[@]} )); then
+ while pop fscks_l val; do
+ fscks+=" $val "
+ done
+fi
+
# these options override the stuff in the config file
if (( ${#dracutmodules_l[@]} )); then
dracutmodules=''
[[ $do_strip ]] || do_strip=no
[[ $compress_l ]] && compress=$compress_l
[[ $show_modules_l ]] && show_modules=$show_modules_l
+[[ $nofscks_l ]] && nofscks="yes"
# eliminate IFS hackery when messing with fw_dir
fw_dir=${fw_dir//:/ }
export initdir dracutbasedir dracutmodules drivers \
fw_dir drivers_dir debug no_kernel kernel_only \
add_drivers mdadmconf lvmconf filesystems \
- use_fstab libdir usrlibdir \
+ use_fstab libdir usrlibdir fscks nofscks \
stdloglvl sysloglvl fileloglvl kmsgloglvl logfile \
debug
# install local /etc/lvm/lvm.conf
lvmconf="yes"
+
+# A list of fsck tools to install. If it's not specified, module's hardcoded
+# default is used, currently: "umount mount /sbin/fsck* xfs_db xfs_check
+# xfs_repair e2fsck jfs_fsck reiserfsck btrfsck". The installation is
+# opportunistic, so non-existing tools are just ignored.
+#fscks=""
+
+# inhibit installation of any fsck tools
+#nofscks="yes"
# returns 255 if filesystem wasn't checked at all (e.g. due to lack of
# necessary tools or insufficient options)
fsck_single() {
- local FSTAB_FILE=/etc/fstab.fslib
+ local FSTAB_FILE=/etc/fstab.empty
local _dev="$1"
local _fs="${2:-auto}"
local _fop="$3"
# takes list of filesystems to check in parallel; we don't rely on automatic
# checking based on fstab, so empty one is passed
fsck_batch() {
- local FSTAB_FILE=/etc/fstab.fslib
+ local FSTAB_FILE=/etc/fstab.empty
local _drv=fsck
local _dev
local _ret
local _out
- [ $# -eq 0 ] && return 255
+ [ $# -eq 0 ] || ! type fsck >/dev/null 2>&1 && return 255
info "Checking filesystems (fsck -M -T -a):"
for _dev in "$@"; do
}
install() {
- dracut_install -o umount mount xfs_db xfs_check xfs_repair
- dracut_install -o e2fsck
- dracut_install -o jfs_fsck
- dracut_install -o reiserfsck
- dracut_install -o btrfsck
- dracut_install -o /sbin/fsck*
+ local _helpers
inst "$moddir/fs-lib.sh" "/lib/fs-lib.sh"
- touch ${initdir}/etc/fstab.fslib
+ touch ${initdir}/etc/fstab.empty
+
+ [[ "$nofscks" = "yes" ]] && return
+
+ if [[ "$fscks" = "${fscks#*[^ ]*}" ]]; then
+ _helpers="\
+ umount mount /sbin/fsck*
+ xfs_db xfs_check xfs_repair
+ e2fsck jfs_fsck reiserfsck btrfsck
+ "
+ else
+ _helpers="$fscks"
+ fi
+
+ dracut_install -o $_helpers
}