From bb7a5b634853dba8931099d641e4c2f809f4186e Mon Sep 17 00:00:00 2001 From: Jesus Alvarez Date: Sun, 20 Apr 2014 12:18:07 -0700 Subject: [PATCH] Improve depmod handling in git PKGBUILDS --- spl-git/spl.install | 16 +++++++--------- zfs-git/zfs.install | 17 ++++++++--------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/spl-git/spl.install b/spl-git/spl.install index 1e2f7f5..e778650 100644 --- a/spl-git/spl.install +++ b/spl-git/spl.install @@ -27,13 +27,11 @@ check_hostid() { run_depmod() { echo ">>> Updating module dependencies. Please wait ..." - # `uname -r` returns the current running kernel version, we need the - # currently installed kernel version. - KERNEL_VERSION=$(pacman -Qi linux | sed -n 2p | cut -d: -f2) - # 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 - depmod $(basename $(find /usr/lib/modules -type d -iname $KERNEL_VERSION\*)) + + _kernel_version_x32_full="3.10.37-1" + _kernel_version_x64_full="3.10.37-1" + + [[ $CARCH == "i686" ]] && _kernel_version_full=${_kernel_version_x32_full} || _kernel_version_full=${_kernel_version_x64_full} + + depmod ${_kernel_version_full} } diff --git a/zfs-git/zfs.install b/zfs-git/zfs.install index 17d086f..9f79457 100644 --- a/zfs-git/zfs.install +++ b/zfs-git/zfs.install @@ -12,15 +12,14 @@ post_upgrade() { check_initramfs() { echo ">>> Updating module dependencies. Please wait ..." - # `uname -r` returns the current running kernel version, we need the - # currently installed kernel version. - KERNEL_VERSION=$(pacman -Qi linux | sed -n 2p | cut -d: -f2) - # 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 - depmod $(basename $(find /usr/lib/modules -type d -iname $KERNEL_VERSION\*)) + + _kernel_version_x32_full="3.10.37-1" + _kernel_version_x64_full="3.10.37-1" + + [[ $CARCH == "i686" ]] && _kernel_version_full=${_kernel_version_x32_full} || _kernel_version_full=${_kernel_version_x64_full} + + depmod ${_kernel_version_full} + MK_CONF=$(grep -v '#' /etc/mkinitcpio.conf | grep zfs >/dev/null; echo $?); if [[ $MK_CONF == '0' ]]; then if [[ $1 == 'remove' ]]; then