33f78e51cde7a2e7ec9d1470b0f4ad0be50b5a69
[zfs.git] / dracut / 90zfs / module-setup.sh.in
1 #!/bin/sh
2
3 check() {
4         # We depend on udev-rules being loaded
5         [ "$1" = "-d" ] && return 0
6
7         # Verify the zfs tool chain
8         which zpool >/dev/null 2>&1 || return 1
9         which zfs >/dev/null 2>&1 || return 1
10
11         return 0
12 }
13
14 depends() {
15         echo udev-rules
16         return 0
17 }
18
19 installkernel() {
20         instmods zfs
21         instmods zcommon
22         instmods znvpair
23         instmods zavl
24         instmods zunicode
25         instmods spl
26         instmods zlib_deflate
27         instmods zlib_inflate
28 }
29
30 install() {
31         inst_rules @udevruledir@/90-zfs.rules
32         inst_rules @udevruledir@/60-zpool.rules
33         inst_rules @udevruledir@/60-zvol.rules
34         inst @sysconfdir@/zfs/zdev.conf
35         inst @sysconfdir@/zfs/zpool.cache
36         inst @sysconfdir@/hostid
37         dracut_install @sbindir@/zfs
38         dracut_install @sbindir@/zpool
39         dracut_install @bindir@/zpool_layout
40         dracut_install @udevdir@/zpool_id
41         dracut_install @udevdir@/zvol_id
42         dracut_install mount.zfs
43         dracut_install hostid
44         inst_hook cmdline 95 "$moddir/parse-zfs.sh"
45         inst_hook mount 98 "$moddir/mount-zfs.sh"
46 }