blob: 2b81b0c452af80b177e790222c2b1f02d0ff9f4a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
#!/bin/bash
# called by dracut
check() {
return 0
}
# called by dracut
depends() {
return 0
}
echo_fs_helper() {
local fs=$2
case "$fs" in
xfs)
echo -n " xfs_db xfs_repair xfs_check xfs_metadump "
;;
ext?)
echo -n " e2fsck "
;;
jfs)
echo -n " jfs_fsck "
;;
reiserfs)
echo -n " reiserfsck "
;;
btrfs)
echo -n " btrfsck "
;;
esac
echo -n " fsck.$fs "
return 0
}
include_fs_helper_modules() {
local fs=$2
case "$fs" in
xfs | btrfs | ext4 | ext3)
instmods crc32c
;;
f2fs)
instmods crc32
;;
esac
}
# called by dracut
installkernel() {
# xfs/btrfs/ext4 need crc32c, f2fs needs crc32
if [[ $hostonly ]]; then
for_each_host_dev_fs include_fs_helper_modules
:
else
instmods crc32c crc32
fi
}
# called by dracut
install() {
local _helpers
inst "$moddir/fs-lib.sh" "/lib/fs-lib.sh"
: > "${initdir}"/etc/fstab.empty
[[ $nofscks == "yes" ]] && return
if [[ $fscks == "${fscks#*[^ ]*}" ]]; then
_helpers=(
/sbin/fsck* /usr/sbin/fsck*
xfs_db xfs_check xfs_repair xfs_metadump
e2fsck jfs_fsck reiserfsck btrfsck
)
if [[ $hostonly ]]; then
read -r -a _helpers < <(for_each_host_dev_fs echo_fs_helper)
fi
else
read -r -a _helpers <<< "$fscks"
fi
_helpers+=(umount mount)
if [[ ${_helpers[*]} == *e2fsck* ]] && [[ -e $dracutsysrootdir/etc/e2fsck.conf ]]; then
inst_simple /etc/e2fsck.conf
fi
inst_multiple -o "${_helpers[@]}" fsck
}
|