Fix getting package version numbers

Get version numbers from zfs instead of spl-utils.

Fix uname -r
pull/16/head
Jesus Alvarez 11 years ago
parent 127dee7b60
commit be17456bc3
  1. 8
      build.sh
  2. 2
      spl/spl.install
  3. 26
      zfs/zfs.install

@ -104,10 +104,10 @@ cleanup() {
}
update_pkgbuilds() {
CUR_ZFS_VER=$(grep "pkgver=" spl-utils/PKGBUILD | cut -d= -f2 | cut -d_ -f1)
CUR_PKGREL_VER=$(grep "pkgrel=" spl-utils/PKGBUILD | cut -d= -f2)
CUR_LINUX_VER=$(grep "linux=" spl-utils/PKGBUILD | sed -r "s/.*linux=(.*)-.+/\1/g")
CUR_LINUX_PKGREL=$(grep "linux=" spl-utils/PKGBUILD | sed -r "s/.*linux=.+-(.+)\"\)/\1/g")
CUR_ZFS_VER=$(grep "pkgver=" zfs/PKGBUILD | cut -d= -f2 | cut -d_ -f1)
CUR_PKGREL_VER=$(grep "pkgrel=" zfs/PKGBUILD | cut -d= -f2)
CUR_LINUX_VER=$(grep "linux=" zfs/PKGBUILD | sed -r "s/.*linux=(.*)-.+/\1/g")
CUR_LINUX_PKGREL=$(grep "linux=" zfs/PKGBUILD | sed -r "s/.*linux=.+-(.+)\"\)/\1/g")
SED_CUR_LIN_VER=$(sed_escape_input_string $CUR_LINUX_VER)
SED_CUR_ZFS_VER=$(sed_escape_input_string $CUR_ZFS_VER)

@ -27,6 +27,8 @@ 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)

@ -12,22 +12,26 @@ 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
echo $LINUX_VER
echo $KERNEL_VERSION
depmod $(basename $(find /usr/lib/modules -type d -iname $KERNEL_VERSION\*))
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
# 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
}

Loading…
Cancel
Save