summarylogtreecommitdiffstats
path: root/zfs-pivy.install
blob: 07110a4e0b9d8144f95fcc4af3e5de2a9cf3fc37 (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#!/bin/bash

build() {
    map add_module \
        zavl \
        znvpair \
        zunicode \
        zcommon \
        zfs \
        spl

    if [[ -f /usr/lib/libminipcsc.so ]]; then
        map add_file /usr/lib/libminipcsc.so
        ln -sf libminipcsc.so "${BUILDROOT}/usr/lib/libpcsclite.so.1"
    else
        map add_file \
            /etc/libccid_Info.plist \
            /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Info.plist \
            /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Linux/libccid.so \
            /usr/lib/libpcsclite.so.1
        map add_binary pcscd
    fi

    map add_file \
        /usr/lib/libusb-1.0.so.0 \
        /usr/lib/libudev.so.1 \
        /usr/lib/libatomic.so.1

    map add_binary \
        fsck.zfs \
        mount.zfs \
        seq \
        zdb \
        zed \
        zfs \
        zhack \
        zinject \
        zpool \
        zstreamdump \
        /lib/udev/vdev_id \
        /lib/udev/zvol_id \
        findmnt \
        pivy-zfs \
        pivy-box \
        pivy-tool

    map add_file \
        /lib/udev/rules.d/60-zvol.rules \
        /lib/udev/rules.d/69-vdev.rules \
        /lib/udev/rules.d/90-zfs.rules \
        /lib/libgcc_s.so.1 \
        /usr/lib/libfl.so.2 \
        /usr/lib/libusb-1.0.so.0

    map add_dir \
        /etc/zfs/zed.d

    add_runscript

    # allow mount(8) to "autodetect" ZFS
    echo 'zfs' >>"${BUILDROOT}/etc/filesystems"

    [[ -f /etc/zfs/zpool.cache ]] && cp "/etc/zfs/zpool.cache" "${BUILDROOT}/etc/zfs/zpool.cache.org"
    [[ -f /etc/modprobe.d/zfs.conf ]] && add_file "/etc/modprobe.d/zfs.conf"
}

help() {
    cat<<HELPEOF
This hook allows you to use ZFS as your root filesystem.

Command Line Setup:

    You can append the following arguments to your kernel parameters list. See
    https://wiki.archlinux.org/index.php/Kernel_parameters for more information.

    To use ZFS as your boot filesystem:

        zfs=bootfs or zfs=auto or root=zfs

    To use a pool or dataset:

        zfs=<pool/dataset>

    To force importing of a ZFS pool:

        zfs_force=1

        If set to 1, this will use "zpool import -f" when attempting to import
        pools.

    To change the seconds of time to wait for ZFS devices to show up at boot:

        zfs_wait=30

    To search for devices in a directory other than "/dev":

        zfs_import_dir=/dev/disk/by-uuid
            or
        zfs_import_dir=/dev/disk/by-partuuid
            or
        zfs_import_dir=/dev/disk/by-path
            etc.

    Following initcpio convention, the 'rw' option must be specified to load the
    pool as read/write. Pools are loaded as read only by default.

Examples:

    To use bootfs on your pool, use

        zfs=bootfs rw

    This will setup your root using tank/root zfs pool.

        zfs=tank/root rw

If you want to set properties for zfs-on-linux module, you should add them to
/etc/modprobe.d/zfs.conf and then rebuild initcpio.

HELPEOF
}

# vim: set ts=4 sw=4 ft=sh et: