mirror of https://github.com/archzfs/archzfs
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.2 KiB
36 lines
1.2 KiB
12 years ago
|
post_install() {
|
||
12 years ago
|
check_initramfs
|
||
12 years ago
|
}
|
||
12 years ago
|
|
||
12 years ago
|
post_remove() {
|
||
12 years ago
|
check_initramfs 'remove'
|
||
12 years ago
|
}
|
||
12 years ago
|
|
||
12 years ago
|
post_upgrade() {
|
||
12 years ago
|
check_initramfs
|
||
|
}
|
||
|
|
||
|
check_initramfs() {
|
||
|
echo ">>> Updating module dependencies. Please wait ..."
|
||
11 years ago
|
# `uname -r` returns the current running kernel version, we need the
|
||
|
# currently installed kernel version.
|
||
12 years ago
|
KERNEL_VERSION=$(pacman -Qi linux | sed -n 2p | cut -d: -f2)
|
||
12 years ago
|
# For cases when the kernel version is 3.8, 3.9
|
||
|
LINUX_VER=$(echo $KERNEL_VERSION | cut -d- -f1)
|
||
|
if [ $(grep -o "\." <<<"$LINUX_VER" | wc -l) -eq 1 ]; then
|
||
|
KERNEL_VERSION="${LINUX_VER}.0-${KERNEL_VERSION:(-1)}"
|
||
|
fi
|
||
12 years ago
|
depmod $(basename $(find /usr/lib/modules -type d -iname $KERNEL_VERSION\*))
|
||
11 years ago
|
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
|
||
12 years ago
|
}
|