summarylogtreecommitdiffstats
path: root/zfs.install
blob: f9923e479b983ee374a06a5c636d3478cbfe61b4 (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
post_install() {
    check_initramfs
}

post_remove() {
    check_initramfs 'remove'
}

post_upgrade() {
    check_initramfs
}

check_initramfs() {
    echo ">>> Updating module dependencies. Please wait ..."

    _kernel_version_x32_full="4.4.1-1"
    _kernel_version_x64_full="4.4.1-1"

    [[ $CARCH == "i686" ]] && _kernel_version_full=${_kernel_version_x32_full} || _kernel_version_full=${_kernel_version_x64_full}

    depmod ${_kernel_version_full}-ARCH

    MK_CONF=$(grep -v '#' /etc/mkinitcpio.conf | grep zfs >/dev/null; echo $?);
    if [[ $MK_CONF == '0' ]]; then
        if [[ $1 == 'remove' ]]; then
            echo '>>> The ZFS packages have been removed, but "zfs" remains in the "hooks"'
            echo '>>> list in mkinitcpio.conf! You will need to remove "zfs" from the '
            echo '>>> "hooks" list and then regenerate the initial ramdisk.'
        else
            echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..."
            mkinitcpio -p linux
        fi
    fi
}