diff options
Diffstat (limited to 'kernels/linux-libre-lts-xen/PKGBUILD')
-rw-r--r-- | kernels/linux-libre-lts-xen/PKGBUILD | 90 |
1 files changed, 56 insertions, 34 deletions
diff --git a/kernels/linux-libre-lts-xen/PKGBUILD b/kernels/linux-libre-lts-xen/PKGBUILD index 160353e50..186614bc0 100644 --- a/kernels/linux-libre-lts-xen/PKGBUILD +++ b/kernels/linux-libre-lts-xen/PKGBUILD @@ -3,13 +3,11 @@ # Contributor: Thomas Baechler <thomas@archlinux.org> # Maintainer (Parabola): André Silva <emulatorman@lavabit.com> -pkgbase=linux-libre-lts-xen -pkgname=('linux-libre-lts-xen' 'linux-libre-lts-xen-headers') # Build stock -LIBRE kernel with Xen guest support -# pkgname=linux-custom # Build kernel with a different name -_kernelname=-LIBRE-LTS-XEN +pkgbase=linux-libre-lts-xen # Build stock -LIBRE-LTS-XEN kernel +#pkgbase=linux-libre-custom # Build kernel with a different name _basekernel=3.0 pkgver=${_basekernel}.31 -pkgrel=1.1 +pkgrel=1.2 arch=('i686') url="http://linux-libre.fsfla.org/" license=('GPL2') @@ -20,11 +18,14 @@ source=("http://linux-libre.fsfla.org/pub/linux-libre/releases/${_basekernel}-gn # the main kernel config files 'config.i686' # standard config files for mkinitcpio ramdisk - "${pkgname}.preset" + "${pkgbase}.preset" 'boot-logo.patch' 'change-default-console-loglevel.patch' 'i915-fix-ghost-tv-output.patch' 'ext4-options.patch') + +_kernelname=${pkgbase#linux-libre} +_localversionname=-LIBRE-LTS-XEN md5sums=('5f64180fe7df4e574dac5911b78f5067' '2748e4e15dada12fe284e9ae341a4652' '162fda63a1b6f9e0bf801e30cbb52195' @@ -65,7 +66,8 @@ build() { cat "${srcdir}/config.${CARCH}" > ./.config # simpler if [ "${_kernelname}" != "" ]; then - sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config + sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_localversionname}\"|g" ./.config + sed -i "s|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|" ./.config fi # set extraversion to pkgrel @@ -85,52 +87,63 @@ build() { #make oldconfig # using old config from previous kernel version # ... or manually edit .config + # rewrite configuration + yes "" | make config >/dev/null + + # save configuration for later reuse + cat .config > "${startdir}/config.i686.last" + #################### # stop here # this is useful to configure the kernel - #msg "Stopping build" - #return 1 + #msg "Stopping build"; return 1 #################### - yes "" | make config - # build! - make ${MAKEFLAGS} bzImage modules + make ${MAKEFLAGS} LOCALVERSION= bzImage modules } -package_linux-libre-lts-xen() { - pkgdesc="The Linux-libre Kernel and modules with Xen guest support - stable longtime supported kernel package suitable for servers" - depends=('coreutils' 'module-init-tools>=3.16' 'mkinitcpio>=0.7') +_package() { + pkgdesc="The ${pkgbase} kernel and modules with xen guest support - stable longtime supported kernel package suitable for servers" + [ "${pkgbase}" = "linux-libre" ] && groups=('base') + depends=('coreutils' 'kmod' 'mkinitcpio>=0.7') optdepends=('crda: to set the correct wireless channels of your country') - provides=('kernel26-lts-xen' "linux-lts-xen=$pkgver") - conflicts=('kernel26-lts-xen' 'kernel26-libre-lts-xen' 'linux-lts-xen') - replaces=('kernel26-lts-xen' 'kernel26-libre-lts-xen' 'linux-lts-xen') - backup=("etc/mkinitcpio.d/${pkgname}.preset") - install=${pkgname}.install + provides=("kernel26${_kernelname}=${pkgver}" "linux${_kernelname}=${pkgver}") + conflicts=("kernel26${_kernelname}" "kernel26-libre${_kernelname}" "linux${_kernelname}") + replaces=("kernel26${_kernelname}" "kernel26-libre${_kernelname}" "linux${_kernelname}") + backup=("etc/mkinitcpio.d/${pkgbase}.preset") + install=${pkgbase}.install cd "${srcdir}/linux-${_basekernel}" KARCH=x86 # get kernel version - _kernver="$(make kernelrelease)" + _kernver="$(make LOCALVERSION= kernelrelease)" + _basekernel=${_kernver%%-*} + _basekernel=${_basekernel%.*} mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot} - make INSTALL_MOD_PATH="${pkgdir}" modules_install - cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgname}" + make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}" modules_install + cp "arch/$KARCH/boot/bzImage" "${pkgdir}/boot/vmlinuz-${pkgbase}" # add vmlinux install -D -m644 vmlinux "${pkgdir}/usr/src/linux-${_kernver}/vmlinux" # install fallback mkinitcpio.conf file and preset file for kernel - install -D -m644 "${srcdir}/${pkgname}.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset" + install -D -m644 "${srcdir}/${pkgbase}.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset" # set correct depmod command for install sed \ - -e "s|ALL_kver=.*|ALL_kver=\"/boot/vmlinuz-${pkgname}\"|g" \ - -e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgname}.img\"|g" \ - -e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgname}-fallback.img\"|g" \ - -i "${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset" + -e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/" \ + -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/" \ + -i "${startdir}/${pkgbase}.install" + sed \ + -e "1s|'linux*.*'|'${pkgbase}'|" \ + -e "s|ALL_kver=.*|ALL_kver=\"/boot/vmlinuz-${pkgbase}\"|" \ + -e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgbase}.img\"|" \ + -e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgbase}-fallback.img\"|" \ + -i "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset" # remove build and source links rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build} @@ -151,11 +164,11 @@ package_linux-libre-lts-xen() { depmod -b "$pkgdir" -F System.map "$_kernver" } -package_linux-libre-lts-xen-headers() { - pkgdesc="Header files and scripts for building modules for linux-libre-lts-xen longtime supported kernel" - provides=('kernel26-lts-xen-headers' "linux-lts-xen-headers=${pkgver}") - conflicts=('kernel26-lts-xen-headers' 'kernel26-libre-lts-xen-headers' 'linux-lts-xen-headers') - replaces=('kernel26-lts-xen-headers' 'kernel26-libre-lts-xen-headers' 'linux-lts-xen-headers') +_package-headers() { + pkgdesc="Header files and scripts for building modules for ${pkgbase} kernel" + provides=("kernel26${_kernelname}-headers=${pkgver}" "linux${_kernelname}-headers=${pkgver}") + conflicts=("kernel26${_kernelname}-headers" "kernel26-libre${_kernelname}-headers" "linux${_kernelname}-headers") + replaces=("kernel26${_kernelname}-headers" "kernel26-libre${_kernelname}-headers" "linux${_kernelname}-headers") install -dm755 "${pkgdir}/usr/lib/modules/${_kernver}" @@ -179,7 +192,7 @@ package_linux-libre-lts-xen-headers() { # copy arch includes for external modules mkdir -p "${pkgdir}/usr/src/linux-${_kernver}/arch/x86" - cp -a arch/x86/include "${pkgdir}/usr/src/linux-${_kernver}/arch/x86/" + cp -a "arch/x86/include" "${pkgdir}/usr/src/linux-${_kernver}/arch/x86/" # copy files necessary for later builds cp Module.symvers "${pkgdir}/usr/src/linux-${_kernver}" @@ -281,3 +294,12 @@ package_linux-libre-lts-xen-headers() { # remove unneeded architectures rm -rf "${pkgdir}"/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa} } + +pkgname=("${pkgbase}" "${pkgbase}-headers") +for _p in ${pkgname[@]}; do + eval "package_${_p}() { + _package${_p#${pkgbase}} + }" +done + +# vim:set ts=8 sts=2 sw=2 et: |