#!/bin/bash
build() {
map add_module \
zfs \
zcommon \
znvpair \
zavl \
zunicode \
spl \
zlib_deflate
map add_binary \
zfs \
zpool \
zpool_layout \
mount.zfs \
hostid \
/lib/udev/zpool_id \
/lib/udev/zvol_id
map add_file \
/lib/udev/rules.d/60-z{vol,pool}.rules \
/lib/udev/rules.d/90-zfs.rules \
/etc/zfs/zdev.conf
add_runscript
# allow mount(8) to "autodetect" ZFS
echo 'zfs' >>"$BUILDROOT/etc/filesystems"
[[ -f /etc/zfs/zpool.cache ]] && add_file "/etc/zfs/zpool.cache"
[[ -f /etc/hostid ]] && add_file "/etc/hostid"
}
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 override the /etc/hostid:
spl_hostid=0x00bab10c
By default the hostid will be used from /etc/hostid, you can use spl_hostid
to override it.
Examples:
To use bootfs on your pool, use
zfs=bootfs
This will setup your root using tank/root zfs pool.
zfs=tank/root
HELPEOF
}
# vim: set ts=4 sw=4 ft=sh et: