summarylogtreecommitdiffstats
path: root/zfs.install
blob: 28e3d168232f33c81a4bb58ea83f8f976c66cf14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
post_install() {
    dkms add zfs/${1%%[-_]*}
    cat << EOF
==> To build and install your modules run: dkms install zfs/${1%%[_-]*} -k [KERNEL]
==> To do this automatically at startup run: systemctl enable dkms.service
EOF
}

pre_upgrade() {
    if [ "${1%%[-_]*}" != "${2%%[-_]*}" ]; then
        pre_remove "$2"
    fi
}

post_upgrade() {
    if [ "${1%%[-_]*}" != "${2%%[-_]*}" ]; then
        post_install "$1"
    fi
}

pre_remove() {
    [ -n "${1%%[-_]*}" ] && dkms remove zfs/${1%%[-_]*} --all -q || true
}