--- packages/linux/trunk/PKGBUILD 2015-06-30 21:04:16.982818922 +0200 +++ linux-orig/trunk/PKGBUILD 2015-07-05 14:04:12.489200761 +0200 @@ -97,6 +97,17 @@ make ${MAKEFLAGS} LOCALVERSION= bzImage modules } +_common_package() { + cd "${srcdir}/${_srcname}" + + KARCH=x86 + + # get kernel version + _kernver="$(make LOCALVERSION= kernelrelease)" + _basekernel=${_kernver%%-*} + _basekernel=${_basekernel%.*} +} + _package() { pkgdesc="The ${pkgbase/linux/Linux} kernel and modules" [ "${pkgbase}" = "linux" ] && groups=('base') @@ -108,15 +119,6 @@ backup=("etc/mkinitcpio.d/${pkgbase}.preset") install=linux.install - cd "${srcdir}/${_srcname}" - - KARCH=x86 - - # get kernel version - _kernver="$(make LOCALVERSION= kernelrelease)" - _basekernel=${_kernver%%-*} - _basekernel=${_basekernel%.*} - mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot} make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}" modules_install cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}" @@ -300,6 +302,7 @@ for _p in ${pkgname[@]}; do eval "package_${_p}() { $(declare -f "_package${_p#${pkgbase}}") + _common_package _package${_p#${pkgbase}} }" done