summaryrefslogtreecommitdiff
path: root/kernels/linux-libre-xen/PKGBUILD
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@lavabit.com>2012-08-12 21:23:21 -0300
committerAndré Fabian Silva Delgado <emulatorman@lavabit.com>2012-08-12 21:23:21 -0300
commit0f03a821f1b0fd1782bf42807d050ade8c38bc3a (patch)
treeddd850c4c16c5b536dce639fbbd8bc0ec8d38b54 /kernels/linux-libre-xen/PKGBUILD
parent04d9e8ce244e920bdf37a6b4083673795b252ac5 (diff)
downloadabslibre-0f03a821f1b0fd1782bf42807d050ade8c38bc3a.tar.gz
abslibre-0f03a821f1b0fd1782bf42807d050ade8c38bc3a.tar.bz2
abslibre-0f03a821f1b0fd1782bf42807d050ade8c38bc3a.zip
linux-libre-xen-3.3.6-1.2: updating revision
Diffstat (limited to 'kernels/linux-libre-xen/PKGBUILD')
-rw-r--r--kernels/linux-libre-xen/PKGBUILD92
1 files changed, 57 insertions, 35 deletions
diff --git a/kernels/linux-libre-xen/PKGBUILD b/kernels/linux-libre-xen/PKGBUILD
index 72a788341..85475feb8 100644
--- a/kernels/linux-libre-xen/PKGBUILD
+++ b/kernels/linux-libre-xen/PKGBUILD
@@ -4,15 +4,13 @@
# Maintainer (Parabola): Nicolás Reynolds <fauno@kiwwwi.com.ar>
# Maintainer (Parabola): Sorin-Mihai Vârgolici <smv@yobicore.org>
# Maintainer (Parabola): André Silva <emulatorman@lavabit.com>
-# Contributor (Parabola): Márcio Silva <coadde@lavabit.com>
+# Maintainer (Parabola): Márcio Silva <coadde@lavabit.com>
-pkgbase=linux-libre-xen
-pkgname=('linux-libre-xen' 'linux-libre-xen-headers') # Build stock -LIBRE kernel with Xen guest support
-# pkgname=linux-custom # Build kernel with a different name
-_kernelname=-LIBRE-XEN
+pkgbase=linux-libre-xen # Build stock -LIBRE-XEN kernel
+#pkgbase=linux-libre-custom # Build kernel with a different name
_basekernel=3.3
pkgver=${_basekernel}.6
-pkgrel=1.1
+pkgrel=1.2
arch=('i686')
url="http://linux-libre.fsfla.org/"
license=('GPL2')
@@ -23,11 +21,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-XEN
md5sums=('5487da14ca81715a469c7594d39722fa'
'6d9d139e4b53802615833372728cc0e4'
'08169715a665016e8e54a92f98768494'
@@ -68,7 +69,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
@@ -88,52 +90,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-xen() {
- pkgdesc="The Linux-libre Kernel and modules with Xen guest support"
- depends=('coreutils' 'module-init-tools>=3.16' 'mkinitcpio>=0.7')
+_package() {
+ pkgdesc="The ${pkgbase} kernel and modules with xen guest support"
+ [ "${pkgbase}" = "linux-libre" ] && groups=('base')
+ depends=('coreutils' 'kmod' 'mkinitcpio>=0.7')
optdepends=('crda: to set the correct wireless channels of your country')
- provides=('kernel26-xen' "linux-xen=$pkgver")
- conflicts=('kernel26-xen' 'kernel26-libre-xen' 'linux-xen')
- replaces=('kernel26-xen' 'kernel26-libre-xen' 'linux-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}
@@ -154,11 +167,11 @@ package_linux-libre-xen() {
depmod -b "$pkgdir" -F System.map "$_kernver"
}
-package_linux-libre-xen-headers() {
- pkgdesc="Header files and scripts for building modules for linux-libre-xen kernel"
- provides=('kernel26-xen-headers' "linux-xen-headers=${pkgver}")
- conflicts=('kernel26-xen-headers' 'kernel26-libre-xen-headers' 'linux-xen-headers')
- replaces=('kernel26-xen-headers' 'kernel26-libre-xen-headers' 'linux-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}"
@@ -182,7 +195,7 @@ package_linux-libre-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}"
@@ -284,3 +297,12 @@ package_linux-libre-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: