pkgname=linux-linode _basekernel=3.6 _kernelname=${pkgname#linux} _srcname=linux-${_basekernel} pkgver=${_basekernel}.4 pkgrel=3 arch=(x86_64) url="https://github.com/yardenac/linux-linode" license=(GPL2) makedepends=(xmlto docbook-xsl) options=('!strip') source=("http://www.kernel.org/pub/linux/kernel/v3.x/${_srcname}.tar.xz" "http://www.kernel.org/pub/linux/kernel/v3.x/patch-${pkgver}.xz" 'config.x86_64' 'menu.lst' "${pkgname}.preset" "module-symbol-waiting-3.6.patch" "module-init-wait-3.6.patch" 'change-default-console-loglevel.patch') md5sums=('1a1760420eac802c541a20ab51a093d1' 'd7efab4da2682c44662b684026b059f7' 'f54bfa388fdc9ed2da89c342434bbe33' 'd01f2350ec9f92e2eabcde0f11be24f2' 'ee66f3cd0c5bc0ba0f65499784d19f30' '670931649c60fcb3ef2e0119ed532bd4' '8a71abc4224f575008f974a099b5cf6f' '9d3c56a4b999c8bfbd4018089a62f662') pkgdesc="Kernel for Arch Linux on Linode" depends=('coreutils' 'linux-firmware' 'kmod' 'mkinitcpio>=0.7') provides=(kernel26 linux) conflicts=(kernel26 linux grub grub-legacy) replaces=(kernel26 linux) backup=(etc/mkinitcpio.d/${pkgname}.preset) install=${pkgname}.install build() { cd "${srcdir}/${_srcname}" patch -p1 -i "${srcdir}/patch-${pkgver}" patch -Np1 -i "${srcdir}/change-default-console-loglevel.patch" patch -Np1 -i "${srcdir}/module-symbol-waiting-3.6.patch" patch -Np1 -i "${srcdir}/module-init-wait-3.6.patch" cp "${srcdir}/config.x86_64" ./.config sed -i '2iexit 0' scripts/depmod.sh sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config sed -i "s|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|g" ./.config sed -ri "s|^(EXTRAVERSION =).*|\1 -${pkgrel}|" Makefile make prepare # msg "Stopping build"; return 1 CFLAGS=${CFLAGS}" -march=corei7 -mtune=corei7 -mcpu=corei7 " CXXFLAGS=${CXXFLAGS}" -march=corei7 -mtune=corei7 -mcpu=corei7 " ionice -c 3 nice -n 19 make ${MAKEFLAGS} LOCALVERSION= bzImage modules } package_linux-linode() { KARCH=x86 cd "${srcdir}/${_srcname}" _kernver="$(make LOCALVERSION= kernelrelease)" mkdir -p "${pkgdir}"/{lib/{modules,firmware},boot} make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}" modules_install cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgname}" install -D -m644 vmlinux "${pkgdir}/usr/src/linux-${_kernver}/vmlinux" install -D -m644 "${srcdir}/${pkgname}.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset" sed \ -e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/" \ -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/" \ -i "${startdir}/${pkgname}.install" sed \ -e "s|ALL_kver=.*|ALL_kver=\"/boot/vmlinuz-${pkgname}\"|" \ -e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgname}.img\"|" \ -e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgname}-fallback.img\"|" \ -i "${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset" rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build} rm -rf "${pkgdir}/lib/firmware" find "${pkgdir}" -name '*.ko' -exec gzip -9 {} \; emdir="extramodules-${_basekernel}${_kernelname:--ARCH}" mkdir -p "${pkgdir}/lib/modules/${emdir}" ln -s "../${emdir}" "${pkgdir}/lib/modules/${_kernver}/extramodules" echo "${_kernver}" >| "${pkgdir}/lib/modules/${emdir}/version" depmod -b "${pkgdir}" -F System.map "${_kernver}" mv "${pkgdir}/"{lib,usr/} mkdir -p ${pkgdir}/boot/grub sed "s/%VER%/${pkgver}-${pkgrel}/ig" ${srcdir}/menu.lst > ${pkgdir}/boot/grub/menu.lst }