diff options
author | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2012-11-06 13:37:54 -0300 |
---|---|---|
committer | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2012-11-06 13:37:54 -0300 |
commit | a48d075b90120462b9f97ab95a224d47e072f7dd (patch) | |
tree | 8ba729381a11d91f09b298d888636425c549498b /libre/linux-libre-lts/PKGBUILD | |
parent | 4ce84837520f8c56ae998d5d2d98380faf3e3eb5 (diff) | |
parent | 8ab3c2d0517cb4db3ab2f7635d0b71b701e464ba (diff) | |
download | abslibre-a48d075b90120462b9f97ab95a224d47e072f7dd.tar.gz abslibre-a48d075b90120462b9f97ab95a224d47e072f7dd.tar.bz2 abslibre-a48d075b90120462b9f97ab95a224d47e072f7dd.zip |
Merge branch 'master' of ssh://gparabola/srv/git/abslibre
Diffstat (limited to 'libre/linux-libre-lts/PKGBUILD')
-rwxr-xr-x[-rw-r--r--] | libre/linux-libre-lts/PKGBUILD | 156 |
1 files changed, 100 insertions, 56 deletions
diff --git a/libre/linux-libre-lts/PKGBUILD b/libre/linux-libre-lts/PKGBUILD index 3593442f9..b7ffda209 100644..100755 --- a/libre/linux-libre-lts/PKGBUILD +++ b/libre/linux-libre-lts/PKGBUILD @@ -1,18 +1,16 @@ # $Id: PKGBUILD 130991 2011-07-09 12:23:51Z thomas $ # Maintainer: Tobias Powalowski <tpowa@archlinux.org> # Maintainer: Thomas Baechler <thomas@archlinux.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-lts -pkgname=('linux-libre-lts' 'linux-libre-lts-headers') # Build stock -LIBRE kernel -# pkgname=linux-custom # Build kernel with a different name -_kernelname=-LIBRE-LTS +pkgbase=linux-libre-lts # Build stock -LIBRE-LTS kernel +#pkgbase=linux-libre-custom # Build kernel with a different name _basekernel=3.0 -_sublevel=32 +_sublevel=51 pkgver=${_basekernel}.${_sublevel} -_lxopkgver=${_basekernel}.31 # nearly always the same as pkgver pkgrel=1 +_lxopkgver=${_basekernel}.50 # nearly always the same as pkgver arch=('i686' 'x86_64' 'mips64el') url="http://linux-libre.fsfla.org/" license=('GPL2') @@ -23,18 +21,20 @@ source=("http://linux-libre.fsfla.org/pub/linux-libre/releases/${_basekernel}-gn # the main kernel config files 'config.i686' 'config.x86_64' # standard config files for mkinitcpio ramdisk - "${pkgname}.preset" + "${pkgbase}.preset" 'Kbuild' 'Kbuild.platforms' 'boot-logo.patch' 'change-default-console-loglevel.patch' 'i915-fix-ghost-tv-output.patch' 'ext4-options.patch' - "http://www.linux-libre.fsfla.org/pub/linux-libre/lemote/gnewsense/pool/linux-patches-${_lxopkgver}-gnu_0loongsonlibre_mipsel.tar.bz2") + 'module-symbol-waiting-3.0.patch' + 'module-init-wait-3.0.patch' + "http://www.linux-libre.fsfla.org/pub/linux-libre/lemote/gnewsense/pool/debuginfo/linux-patches-${_lxopkgver}-gnu_0loongsonlibre_mipsel.tar.bz2") md5sums=('5f64180fe7df4e574dac5911b78f5067' - '1fc88c19baf04fbb37385712ad9c4d57' - 'df7e69a7b238c6492b589cc2beb894d2' - '2ef390e115d6ae1c074c30fec9258442' + 'fb3c742b1f8b01131534a22348cfa712' + 'aed25ab047e1c0b020a1516c235c6a74' + '7d37e8ce0f4bd5a957172b12ae742ea0' 'c072b17032e80debc6a8626299245d46' '2967cecc3af9f954ccc822fd63dca6ff' '8267264d9a8966e57fdacd1fa1fc65c4' @@ -42,13 +42,18 @@ md5sums=('5f64180fe7df4e574dac5911b78f5067' '9d3c56a4b999c8bfbd4018089a62f662' '263725f20c0b9eb9c353040792d644e5' 'f36222e7ce20c8e4dc27376f9be60f6c' - 'bacdceaf5ce186cfe69dffc89cd246a0') + '670931649c60fcb3ef2e0119ed532bd4' + '8a71abc4224f575008f974a099b5cf6f' + 'e2cc9f33fb26b254b6b65f8981aebf13') if [ "$CARCH" != "mips64el" ]; then # Don't use the Loongson-specific patches on non-mips64el arches. unset source[${#source[@]}-1] unset md5sums[${#md5sums[@]}-1] fi +_kernelname=${pkgbase#linux-libre} +_localversionname=-LIBRE-LTS + build() { cd "${srcdir}/linux-${_basekernel}" @@ -77,6 +82,11 @@ build() { # https://bugs.archlinux.org/task/28653 patch -Np1 -i "${srcdir}/ext4-options.patch" + # fix module initialisation + # https://bugs.archlinux.org/task/32122 + patch -Np1 -i "${srcdir}/module-symbol-waiting-3.0.patch" + patch -Np1 -i "${srcdir}/module-init-wait-3.0.patch" + if [ "$CARCH" == "mips64el" ]; then sed -i "s|^EXTRAVERSION.*|EXTRAVERSION =-libre-lts|" Makefile sed -r "s|^( SUBLEVEL = ).*|\1$_sublevel|" \ @@ -89,10 +99,10 @@ build() { # https://git.kernel.org/?p=linux/hotplug/udev.git;a=blob_plain;f=README # and make USB storage support builtin (e.g. for booting from USB # disks without slowly loading an initramfs) - sed -ri -e "s|CONFIG_MIPS32_N32=.*|CONFIG_MIPS32_N32=y|g" \ + sed -ri \ -e "s|CONFIG_MIPS32_N32=.*|CONFIG_MIPS32_N32=y|g" \ -e "s|CONFIG_UEVENT_HELPER_PATH=.*|CONFIG_UEVENT_HELPER_PATH=\"\"|g" \ - -e "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" \ + -e "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_localversionname}\"|g" \ -e "s;(CONFIG_USB(_COMMON|_EHCI_HCD|_OHCI_HCD|_STORAGE.*|_UAS)?)=.*;\1=y;g" \ ./.config else @@ -100,12 +110,16 @@ build() { fi 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 @@ -117,15 +131,22 @@ 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 + if [ "${CARCH}" = "x86_64" ]; then + cat .config > "${startdir}/config.x86_64.last" + else + cat .config > "${startdir}/config.i686.last" + fi + #################### # stop here # this is useful to configure the kernel - #msg "Stopping build" - #return 1 + #msg "Stopping build"; return 1 #################### - yes "" | make config - # build! if [ "$CARCH" == "mips64el" ]; then # The build system passes it directly to linker, disable to avoid @@ -133,21 +154,22 @@ build() { export LDFLAGS="" # bzImage is arch-specific and not supported on mips; vmlinux is # useful for oprofile. - make ${MAKEFLAGS} vmlinux vmlinuz modules + make ${MAKEFLAGS} LOCALVERSION= vmlinux vmlinuz modules else - make ${MAKEFLAGS} bzImage modules + make ${MAKEFLAGS} LOCALVERSION= bzImage modules fi } -package_linux-libre-lts() { - pkgdesc="The Linux-libre Kernel and modules - stable longtime supported kernel package suitable for servers" - depends=('coreutils' 'kmod') +_package() { + pkgdesc="The ${pkgbase} kernel and modules - stable longtime supported kernel package suitable for servers" + [ "${pkgbase}" = "linux-libre" ] && groups=('base') + depends=('coreutils' 'linux-libre-firmware' 'kmod') optdepends=('crda: to set the correct wireless channels of your country') - provides=('kernel26-lts' "linux-lts=$pkgver") - conflicts=('kernel26-lts' 'kernel26-libre-lts' 'linux-lts') - replaces=('kernel26-lts' 'kernel26-libre-lts' 'linux-lts') - 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 if [ "$CARCH" = "mips64el" ]; then optdepends+=('mkinitcpio: to make the initramfs (needs reinstall of this package)') conflicts+=('mkinitcpio<0.7') @@ -161,35 +183,42 @@ package_linux-libre-lts() { [ $CARCH = "mips64el" ] && KARCH=mips # 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 + make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}" modules_install if [ "$CARCH" == "mips64el" ]; then - cp vmlinuz "${pkgdir}/boot/vmlinuz-${pkgname}" - cp vmlinux "${pkgdir}/boot/vmlinux-${pkgname}" + cp vmlinuz "${pkgdir}/boot/vmlinuz-${pkgbase}" + cp vmlinux "${pkgdir}/boot/vmlinux-${pkgbase}" else - cp "arch/${KARCH}/boot/bzImage" "${pkgdir}/boot/vmlinuz-${pkgname}" + cp "arch/${KARCH}/boot/bzImage" "${pkgdir}/boot/vmlinuz-${pkgbase}" fi # 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" # mkinitcpio 0.7 relies on bzImage to find the kernel version if [ "$CARCH" == "mips64el" ]; then - sed -e "s|ALL_kver=.*|ALL_kver=\"${_kernver}\"|g" \ - -i "${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset" + sed -e "s|ALL_kver=.*|ALL_kver=\"${_kernver}\"|" \ + -i "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset" fi # remove build and source links @@ -199,17 +228,23 @@ package_linux-libre-lts() { # 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-LTS}" "${pkgdir}/lib/modules/${_kernver}/extramodules" + ln -s "../extramodules-${_basekernel}${_localversionname:--LIBRE-LTS}" "${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-LTS}" - echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--LIBRE-LTS}/version" + mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}${_localversionname:--LIBRE-LTS}" + echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_localversionname:--LIBRE-LTS}/version" + + # Now we call depmod... + depmod -b "$pkgdir" -F System.map "$_kernver" + + # move module tree /lib -> /usr/lib + mv "$pkgdir/lib" "$pkgdir/usr" } -package_linux-libre-lts-headers() { - pkgdesc="Header files and scripts for building modules for linux-libre-lts longtime supported kernel" - provides=('kernel26-lts-headers' "linux-lts-headers=${pkgver}") - conflicts=('kernel26-lts-headers' 'kernel26-libre-lts-headers' 'linux-lts-headers') - replaces=('kernel26-lts-headers' 'kernel26-libre-lts-headers' 'linux-lts-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") KARCH=x86 [ $CARCH = "mips64el" ] && KARCH=mips @@ -217,13 +252,13 @@ package_linux-libre-lts-headers() { # In case of repackaging this is empty if [ -z "${_kernver}" ]; then cd "${srcdir}/linux-${_basekernel}" - _kernver="$(make kernelrelease)" + _kernver="$(make LOCALVERSION= kernelrelease)" fi - 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 \ @@ -348,10 +383,19 @@ package_linux-libre-lts-headers() { done # remove unneeded architectures - rm -rf "${pkgdir}"/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,microblaze,mn10300,parisc,powerpc,ppc,s390,score,sh,sh64,sparc,sparc64,tile,um,unicore32,v850,xtensa} + rm -rf "${pkgdir}"/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,c6x,cris,frv,h8300,hexagon,ia64,m32r,m68k,m68knommu,microblaze,mn10300,openrisc,parisc,powerpc,ppc,s390,score,sh,sh64,sparc,sparc64,tile,unicore32,um,v850,xtensa} if [ "$CARCH" = "mips64el" ]; then rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/x86 else rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/mips fi } + +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: |