diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2014-07-12 22:37:18 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2014-07-13 01:49:59 -0400 |
commit | f272718e00d83ea49c2a3ddc017527d1018d2b98 (patch) | |
tree | 7e9eab9b2e94a547422f1c6ceb479419aaf22f28 /kernels/linux-libre-xen/PKGBUILD | |
parent | 2580408aec42408d6f67e4d0deb6286d09cdd687 (diff) | |
download | abslibre-f272718e00d83ea49c2a3ddc017527d1018d2b98.tar.gz abslibre-f272718e00d83ea49c2a3ddc017527d1018d2b98.tar.bz2 abslibre-f272718e00d83ea49c2a3ddc017527d1018d2b98.zip |
Make kernel/linux-libre-xen actually work
Diffstat (limited to 'kernels/linux-libre-xen/PKGBUILD')
-rw-r--r-- | kernels/linux-libre-xen/PKGBUILD | 113 |
1 files changed, 61 insertions, 52 deletions
diff --git a/kernels/linux-libre-xen/PKGBUILD b/kernels/linux-libre-xen/PKGBUILD index 27a9817ef..bdbc9d9d8 100644 --- a/kernels/linux-libre-xen/PKGBUILD +++ b/kernels/linux-libre-xen/PKGBUILD @@ -1,41 +1,54 @@ -# $Id: PKGBUILD 215933 2014-07-01 05:46:28Z tpowa $ -# Contributor (Arch): Tobias Powalowski <tpowa@archlinux.org> -# Contributor (Arch): Thomas Baechler <thomas@archlinux.org> +# $Id$ +# Maintainer (Arch): Tobias Powalowski <tpowa@archlinux.org> +# Maintainer (Arch): Thomas Baechler <thomas@archlinux.org> # Maintainer: André Silva <emulatorman@parabola.nu> +# Contributor: Nicolás Reynolds <fauno@kiwwwi.com.ar> +# Contributor: Sorin-Mihai Vârgolici <smv@yobicore.org> +# Contributor: Michał Masłowski <mtjm@mtjm.eu> +# Contributor: Márcio Silva <coadde@parabola.nu> +# Contributor: Luke Shumaker <lukeshu@sbcglobal.net> -pkgbase=linux-libre-xen # Build stock -LIBRE-XEN kernel -#pkgbase=linux-libre-custom # Build kernel with a different name -_basekernel=3.15 -pkgver=${_basekernel}.3 -pkgrel=1 +pkgbase=linux-libre-xen + +_srcbase=linux +_srcmajor=3.15 +_srcminor=3 +pkgver=${_srcmajor}.${_srcminor} + +pkgrel=2 arch=('i686') url="http://linux-libre.fsfla.org/" license=('GPL2') makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc') options=('!strip') -source=("http://linux-libre.fsfla.org/pub/linux-libre/releases/${_basekernel}-gnu/linux-libre-${_basekernel}-gnu.tar.xz" - "http://linux-libre.fsfla.org/pub/linux-libre/releases/${pkgver}-gnu/patch-${_basekernel}-gnu-${pkgver}-gnu.xz" +source=("http://linux-libre.fsfla.org/pub/linux-libre/releases/${_srcmajor}-gnu/linux-libre-${_srcmajor}-gnu.tar.xz" # the main kernel config files 'config' # standard config files for mkinitcpio ramdisk - "${pkgbase}.preset" + 'linux.preset' 'boot-logo.patch' - 'change-default-console-loglevel.patch') + 'change-default-console-loglevel.patch' + ) +if [[ $pkgver != $_srcmajor ]]; then + source+=("http://linux-libre.fsfla.org/pub/linux-libre/releases/${pkgver}-gnu/patch-${_srcmajor}-gnu-${pkgver}-gnu.xz") +fi + sha256sums=('93450dc189131b6a4de862f35c5087a58cc7bae1c24caa535d2357cc3301b688' - 'dfd23e705edfc0f6fcf0df1a98e58ec7ae835ec780d7092810b664093d91cd5f' - '4e07667d502ddbf6368169de57ebdc5bd7923cc8b37cbd2739c1260aece1b3a7' - '7a475ada892857397cf80d2de777825ae94758dc2d9dfa3754ae3d670f4a2f02' + '276d16a06e9fa55b79e2f5604a500071b6a42f00836175aa3e4b045f469d43a8' + 'f0d90e756f14533ee67afda280500511a62465b4f76adcc5effa95a40045179c' '8303b426b1a6dce456b2350003558ae312d21cab0ae6c1f0d7b9d21395f4e177' - 'faced4eb4c47c4eb1a9ee8a5bf8a7c4b49d6b4d78efbe426e410730e6267d182') + 'faced4eb4c47c4eb1a9ee8a5bf8a7c4b49d6b4d78efbe426e410730e6267d182' + 'dfd23e705edfc0f6fcf0df1a98e58ec7ae835ec780d7092810b664093d91cd5f') -_kernelname=${pkgbase#linux-libre} -_localversionname=-LIBRE-XEN +_srcname=linux-${_srcmajor} +_kernelname=${pkgbase#linux} +_replaces=(kernel26 kernel26-libre linux) prepare() { - cd "${srcdir}/linux-${_basekernel}" + cd "${srcdir}/${_srcname}" - if [ "${_basekernel}" != "${pkgver}" ]; then - patch -p1 -i "${srcdir}/patch-${_basekernel}-gnu-${pkgver}-gnu" + if [ "${_srcmajor}" != "${pkgver}" ]; then + patch -p1 -i "${srcdir}/patch-${_srcmajor}-gnu-${pkgver}-gnu" fi # add freedo as boot logo @@ -49,10 +62,10 @@ prepare() { # (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227) patch -p1 -i "${srcdir}/change-default-console-loglevel.patch" - cat "${srcdir}/config" > ./.config # simpler + cat "${srcdir}/config" > ./.config if [ "${_kernelname}" != "" ]; then - sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_localversionname}\"|g" ./.config + sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config sed -i "s|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|" ./.config fi @@ -78,23 +91,23 @@ prepare() { } build() { - cd "${srcdir}/linux-${_basekernel}" + cd "${srcdir}/${_srcname}" make ${MAKEFLAGS} LOCALVERSION= bzImage modules } _package() { - pkgdesc="The ${pkgbase^} kernel and modules with Xen guest support" + pkgdesc="The ${pkgbase/linux/Linux} kernel and modules" [ "${pkgbase}" = "linux-libre" ] && groups=('base') depends=('coreutils' 'linux-libre-firmware' 'kmod' 'mkinitcpio>=0.7') optdepends=('crda: to set the correct wireless channels of your country') - provides=("kernel26${_kernelname}=${pkgver}" "linux${_kernelname}=${pkgver}") - conflicts=("kernel26${_kernelname}" "kernel26-libre${_kernelname}" "linux${_kernelname}") - replaces=("kernel26${_kernelname}" "kernel26-libre${_kernelname}" "linux${_kernelname}") + provides=( "${_replaces[@]/%/${_kernelname#-libre}=${pkgver}}") + conflicts=("${_replaces[@]/%/${_kernelname#-libre}}") + replaces=( "${_replaces[@]/%/${_kernelname#-libre}}") backup=("etc/mkinitcpio.d/${pkgbase}.preset") - install=${pkgbase}.install + install=linux.install - cd "${srcdir}/linux-${_basekernel}" + cd "${srcdir}/${_srcname}" KARCH=x86 @@ -105,7 +118,7 @@ _package() { 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}" + cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}" # set correct depmod command for install cp -f "${startdir}/${install}" "${startdir}/${install}.pkg" @@ -116,9 +129,9 @@ _package() { -i "${startdir}/${install}" # install mkinitcpio preset file for kernel - install -D -m644 "${srcdir}/${pkgbase}.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset" + install -D -m644 "${srcdir}/linux.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset" sed \ - -e "1s|'linux*.*'|'${pkgbase}'|" \ + -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\"|" \ @@ -131,10 +144,10 @@ _package() { # 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}${_localversionname:--LIBRE-XEN}" "${pkgdir}/lib/modules/${_kernver}/extramodules" + ln -s "../extramodules-${_basekernel}${_kernelname:--ARCH}" "${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}${_localversionname:--LIBRE-XEN}" - echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_localversionname:--LIBRE-XEN}/version" + mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}" + echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}/version" # Now we call depmod... depmod -b "${pkgdir}" -F System.map "${_kernver}" @@ -148,14 +161,16 @@ _package() { } _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") + pkgdesc="Header files and scripts for building modules for ${pkgbase/linux/Linux} kernel" + provides=( "${_replaces[@]/%/${_kernelname#-libre}-headers=${pkgver}}") + conflicts=("${_replaces[@]/%/${_kernelname#-libre}-headers}") + replaces=( "${_replaces[@]/%/${_kernelname#-libre}-headers}") + + KARCH=x86 install -dm755 "${pkgdir}/usr/lib/modules/${_kernver}" - cd "${srcdir}/linux-${_basekernel}" + cd "${srcdir}/${_srcname}" install -D -m644 Makefile \ "${pkgdir}/usr/lib/modules/${_kernver}/build/Makefile" install -D -m644 kernel/Makefile \ @@ -178,12 +193,6 @@ _package-headers() { cp Module.symvers "${pkgdir}/usr/lib/modules/${_kernver}/build" cp -a scripts "${pkgdir}/usr/lib/modules/${_kernver}/build" - if [ "$CARCH" = "mips64el" ]; then - cp arch/${KARCH}/Kbuild "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/" - cp -a arch/${KARCH}/loongson "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/" - cp ${srcdir}/Kbuild.platforms "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/" - fi - # fix permissions on scripts dir chmod og-w -R "${pkgdir}/usr/lib/modules/${_kernver}/build/scripts" mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/.tmp_versions" @@ -273,12 +282,12 @@ _package-headers() { } _package-docs() { - pkgdesc="Kernel hackers manual - HTML documentation that comes with the ${pkgbase^} kernel" - provides=("kernel26${_kernelname}-docs=${pkgver}" "linux${_kernelname}-docs=${pkgver}") - conflicts=("kernel26${_kernelname}-docs" "kernel26-libre${_kernelname}-docs" "linux${_kernelname}-docs") - replaces=("kernel26${_kernelname}-docs" "kernel26-libre${_kernelname}-docs" "linux${_kernelname}-docs") + pkgdesc="Kernel hackers manual - HTML documentation that comes with the ${pkgbase/linux/Linux} kernel" + provides=( "${_replaces[@]/%/${_kernelname#-libre}-docs=${pkgver}}") + conflicts=("${_replaces[@]/%/${_kernelname#-libre}-docs}") + replaces=( "${_replaces[@]/%/${_kernelname#-libre}-docs}") - cd "${srcdir}/linux-${_basekernel}" + cd "${srcdir}/${_srcname}" mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build" cp -al Documentation "${pkgdir}/usr/lib/modules/${_kernver}/build" |