summaryrefslogtreecommitdiff
path: root/kernels/linux-libre-xen/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'kernels/linux-libre-xen/PKGBUILD')
-rwxr-xr-x[-rw-r--r--]kernels/linux-libre-xen/PKGBUILD121
1 files changed, 76 insertions, 45 deletions
diff --git a/kernels/linux-libre-xen/PKGBUILD b/kernels/linux-libre-xen/PKGBUILD
index caa0d045b..11b614694 100644..100755
--- a/kernels/linux-libre-xen/PKGBUILD
+++ b/kernels/linux-libre-xen/PKGBUILD
@@ -3,16 +3,14 @@
# Contributor: Thomas Baechler <thomas@archlinux.org>
# Maintainer (Parabola): Nicolás Reynolds <fauno@kiwwwi.com.ar>
# Maintainer (Parabola): Sorin-Mihai Vârgolici <smv@yobicore.org>
-# Maintainer (Parabola): André Silva <andre.paulista@adinet.com.uy>
-# Contributor (Parabola): Márcio Silva <coadde@adinet.com.uy>
+# Maintainer (Parabola): André Silva <emulatorman@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}.2
-pkgrel=1
+pkgver=${_basekernel}.6
+pkgrel=1.3
arch=('i686')
url="http://linux-libre.fsfla.org/"
license=('GPL2')
@@ -23,20 +21,23 @@ 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')
md5sums=('5487da14ca81715a469c7594d39722fa'
- 'b43d3bdecfa355bf45bd1154819e3687'
- '7e49ab7e4e63c890d0196be139a55656'
+ '6d9d139e4b53802615833372728cc0e4'
+ '08169715a665016e8e54a92f98768494'
'b7c2805bb287a644c0a303bf7721e534'
'04b21c79df0a952c22d681dd4f4562df'
'9d3c56a4b999c8bfbd4018089a62f662'
'263725f20c0b9eb9c353040792d644e5'
'bb7fd1aa23016c8057046b84fd4eb528')
+_kernelname=${pkgbase#linux-libre}
+_localversionname=-LIBRE-XEN
+
build() {
cd "${srcdir}/linux-${_basekernel}"
@@ -68,12 +69,16 @@ 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
sed -ri "s|^(EXTRAVERSION =).*|\1 -${pkgrel}|" Makefile
+ # don't run depmod on 'make install'. We'll do this ourselves in packaging
+ sed -i '2iexit 0' scripts/depmod.sh
+
# get kernel version
make prepare
@@ -85,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}
@@ -139,22 +155,28 @@ package_linux-libre-xen() {
# gzip -9 all modules to save 100MB of space
find "${pkgdir}" -name '*.ko' -exec gzip -9 {} \;
# make room for external modules
- ln -s "../extramodules-${_basekernel}${_kernelname:--LIBRE}" "${pkgdir}/lib/modules/${_kernver}/extramodules"
+ ln -s "../extramodules-${_basekernel}${_localversionname:--LIBRE-XEN}" "${pkgdir}/lib/modules/${_kernver}/extramodules"
# add real version for building modules and running depmod from post_install/upgrade
- mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--LIBRE}"
- echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--LIBRE}/version"
+ mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}${_localversionname:--LIBRE-XEN}"
+ echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_localversionname:--LIBRE-XEN}/version"
+
+ # move module tree /lib -> /usr/lib
+ mv "$pkgdir/lib" "$pkgdir/usr"
+
+ # Now we call depmod...
+ 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")
- mkdir -p "${pkgdir}/lib/modules/${_kernver}"
+ install -dm755 "${pkgdir}/usr/lib/modules/${_kernver}"
- cd "${pkgdir}/lib/modules/${_kernver}"
- ln -sf ../../../usr/src/linux-${_kernver} build
+ cd "${pkgdir}/usr/lib/modules/${_kernver}"
+ ln -sf ../../../src/linux-${_kernver} build
cd "${srcdir}/linux-${_basekernel}"
install -D -m644 Makefile \
@@ -173,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}"
@@ -275,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: