99fs-lib/module-setup.sh: only include fsck helper needed for hostonly
for the host-only initramfs, check all relevant disks for the filesystem type and only include those fsck tools, which are needed.master
parent
470ee2d214
commit
1133b5e07a
|
@ -24,6 +24,35 @@ install() {
|
||||||
xfs_db xfs_check xfs_repair
|
xfs_db xfs_check xfs_repair
|
||||||
e2fsck jfs_fsck reiserfsck btrfsck
|
e2fsck jfs_fsck reiserfsck btrfsck
|
||||||
"
|
"
|
||||||
|
if [[ $hostonly ]]; then
|
||||||
|
print_fs_type() { get_fs_type /dev/block/$1; }
|
||||||
|
_rootdev=$(find_root_block_device)
|
||||||
|
if [[ $_rootdev ]]; then
|
||||||
|
_helpers="umount mount "
|
||||||
|
for fs in $(check_block_and_slaves print_fs_type "$_rootdev"); do
|
||||||
|
case "$fs" in
|
||||||
|
xfs)
|
||||||
|
_helpers+=" xfs_db xfs_repair xfs_check "
|
||||||
|
;;
|
||||||
|
ext?)
|
||||||
|
_helpers+=" e2fsck "
|
||||||
|
;;
|
||||||
|
jfs)
|
||||||
|
_helpers+=" jfs_fsck "
|
||||||
|
;;
|
||||||
|
reiserfs)
|
||||||
|
_helpers+=" reiserfsck "
|
||||||
|
;;
|
||||||
|
btrfs)
|
||||||
|
_helpers+=" btrfsck "
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
[[ -x fsck.$fs ]] && _helpers+= " fsck.$fs "
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
_helpers="$fscks"
|
_helpers="$fscks"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue