summarylogtreecommitdiffstats
path: root/zfs.install
diff options
context:
space:
mode:
authorIacopo Isimbaldi2015-12-29 16:38:03 +0100
committerIacopo Isimbaldi2015-12-29 16:38:03 +0100
commitb76bd4a5b317ac6f07caa8785c475f58046635ce (patch)
treeee13fefd6f936d3fe3e32e2e5a9e180706b25e03 /zfs.install
parent25e777b85b38dbf8c8f68d5f1cb9a440ad82ae99 (diff)
downloadaur-b76bd4a5b317ac6f07caa8785c475f58046635ce.tar.gz
Updated to pkgver 0.6.5.3
Diffstat (limited to 'zfs.install')
-rw-r--r--zfs.install45
1 files changed, 36 insertions, 9 deletions
diff --git a/zfs.install b/zfs.install
index f406c472032..b8d2f40ebcd 100644
--- a/zfs.install
+++ b/zfs.install
@@ -1,17 +1,44 @@
post_install() {
- check_initramfs
+ 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
+ check_initramfs "install"
+}
+
+pre_upgrade() {
+ pre_remove "$2"
}
post_upgrade() {
- check_initramfs
+ post_install "$1"
}
-check_initramfs() {
- echo " >>> To build the module for the current kernel use this command:
- # dkms install zfs/0.6.5.2 -k _KERNEL_VERSION_HERE_
- or just boot to kernel you want to build and do
- # dkms install zfs/0.6.5.2 -k \$(uname -r)
+pre_remove() {
+ [ -n "${1%%[-_]*}" ] && dkms remove zfs/${1%%[-_]*} --all &>/dev/null || true
+}
+
+post_remove() {
+ check_initramfs "remove"
+}
- >>> Always remember to install kernel headers!
-"
+check_initramfs() {
+ if grep -v '#' /etc/mkinitcpio.conf | grep zfs >/dev/null; 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.'
+ elif grep -v '#' /etc/mkinitcpio.conf | grep dkms >/dev/null; then
+ echo '==> Generating initial ramdisk automatically (mkinitcpio-dkms found)'
+ for preset in /etc/mkinitcpio.d/*.preset; do
+ mkinitcpio -p "$(basename "$preset" .preset)"
+ done
+ else
+ echo '==> The ZFS packages are installed/updated, you need to (re)generate initial ramdisk yourself'
+ echo '==> After modules are built and installed, run: mkinitcpio -p [PRESET]'
+ echo '==> To do it automatically, you can also install mkinitcpio-dkms package'
+ echo '==> and add "dkms" to HOOKSs (before zfs)'
+ fi
+ fi
}