diff options
author | sirlucjan | 2017-09-28 20:09:35 +0200 |
---|---|---|
committer | sirlucjan | 2017-09-28 20:09:35 +0200 |
commit | e3ff644373f8229c4399165cdf5a7c2356ad093b (patch) | |
tree | e235ee8621995b393cfa53cde599b4574805821b /PKGBUILD | |
parent | 050d8c7b4c09ca6f36b229ceefd9aa3dcc0e87e0 (diff) | |
download | aur-e3ff644373f8229c4399165cdf5a7c2356ad093b.tar.gz |
Start with 4.13.4
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 520 |
1 files changed, 203 insertions, 317 deletions
@@ -1,26 +1,24 @@ # Maintainer: Piotr Gorski <lucjan.lucjanov@gmail.com> -# Contributor: Felix Yan <felixonmars@gmail.com> -# Contributor: Kelvin Ng (qpalz) <kelvin9302104 at gmail dot com> # Contributor: Tobias Powalowski <tpowa@archlinux.org> # Contributor: Thomas Baechler <thomas@archlinux.org> ### BUILD OPTIONS # Set these variables to ANYTHING that is not null to enable them -# Tweak kernel options prior to a build via nconfig +### Tweak kernel options prior to a build via nconfig _makenconfig= -# Tweak kernel options prior to a build via menuconfig +### Tweak kernel options prior to a build via menuconfig _makemenuconfig= -# Tweak kernel options prior to a build via xconfig +### Tweak kernel options prior to a build via xconfig _makexconfig= -# Tweak kernel options prior to a build via gconfig +### Tweak kernel options prior to a build via gconfig _makegconfig= -# Running with a 1000 HZ tick rate -_1k_HZ_ticks= +### Running with a 1000 HZ tick rate +_1k_HZ_ticks=y # NUMA is optimized for multi-socket motherboards. # A single multi-core CPU actually runs slower with NUMA enabled. @@ -48,104 +46,60 @@ _localmodcfg= # a new kernel is released, but again, convenient for package bumps. _use_current= -# Alternative I/O scheduler by Paolo. -# Set this if you want it enabled globally i.e. for all devices in your system -# If you want it enabled on a device-by-device basis, leave this unset and see: -# https://wiki.archlinux.org/index.php/Linux-ck#How_to_Enable_the_BFQ_I.2FO_Scheduler -_BFQ_enable_= - ### Do not edit below this line unless you know what you're doing pkgbase=linux-uksm -pkgname=('linux-uksm' 'linux-uksm-headers' 'linux-uksm-docs') -_kernelname=-uksm -_srcname=linux-4.0 -pkgver=4.0.9 +# pkgname=('linux-uksm' 'linux-uksm-headers' 'linux-uksm-docs') +_srcname=linux-4.13 +pkgver=4.13.4 pkgrel=1 -arch=('i686' 'x86_64') -url="http://kerneldedup.org/" +arch=('x86_64') +url="https://github.com/dolohow/uksm" license=('GPL2') options=('!strip') -makedepends=('kmod' 'inetutils' 'bc') -_uksmvernel="0.1.2.4-beta" -_uksmname="v4.0" -_bfqrel=v7r8 -#_bfqpath="http://algo.ing.unimo.it/people/paolo/disk_sched/patches/4.0.0-${_bfqrel}" -_bfqpath="https://pf.natalenko.name/mirrors/bfq/4.0.0-${_bfqrel}/" -_gcc_patch="enable_additional_cpu_optimizations_for_gcc_v4.9+_kernel_v3.15+.patch" - -source=("http://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.xz" +makedepends=('kmod' 'inetutils' 'bc' 'libelf') +_uksm_path="https://raw.githubusercontent.com/dolohow/uksm/master" +_uksm_patch="uksm-4.13.patch" +_gcc_path="https://raw.githubusercontent.com/sirlucjan/kernel_gcc_patch/master" +_gcc_patch="enable_additional_cpu_optimizations_for_gcc_v4.9+_kernel_v4.13+.patch" + +source=("https://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.xz" "https://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.sign" - "http://www.kernel.org/pub/linux/kernel/v4.x/patch-${pkgver}.xz" + "https://www.kernel.org/pub/linux/kernel/v4.x/patch-${pkgver}.xz" "https://www.kernel.org/pub/linux/kernel/v4.x/patch-${pkgver}.sign" - #"http://kerneldedup.org/download/uksm/${_uksmvernel}/uksm-${_uksmvernel}-for-${_uksmname}.patch" # website often went down - "uksm-${_uksmvernel}-for-linux-${_uksmname}.patch" - "${_bfqpath}/0001-block-cgroups-kconfig-build-bits-for-BFQ-${_bfqrel}-4.0.patch" - "${_bfqpath}/0002-block-introduce-the-BFQ-${_bfqrel}-I-O-sched-for-4.0.patch" - "${_bfqpath}/0003-block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-${_bfqrel}-for-4.0.0.patch" - "http://repo-ck.com/source/gcc_patch/${_gcc_patch}.gz" - 'linux-uksm.preset' - 'change-default-console-loglevel.patch' - 'config' 'config.x86_64' - '0004-block-loop-convert-to-per-device-workqueue.patch' - '0005-block-loop-avoiding-too-many-pending-per-work-I-O.patch') + "${_gcc_path}/${_gcc_patch}" + "${_uksm_path}/${_uksm_patch}" + # the main kernel config files + 'config.i686' 'config.x86_64' + # pacman hook for initramfs regeneration + '90-linux.hook' + # standard config files for mkinitcpio ramdisk + 'linux.preset') +_kernelname=${pkgbase#linux} + prepare() { cd ${_srcname} ### Add upstream patch msg "Add upstream patch" - patch -Np1 -i "${srcdir}/patch-${pkgver}" - - ### Fix deadlock with stacked loop devices (FS#45129) - # http://marc.info/?l=linux-kernel&m=143280649731902&w=2 - msg "Fix deadlock with stacked loop devices (FS#45129)" - for p in "${srcdir}"/000{4,5}-block*.patch; do - msg " $p" - patch -Np1 -i "$p" - done - - ### set DEFAULT_CONSOLE_LOGLEVEL to 4 (same value as the 'quiet' kernel param) - # remove this when a Kconfig knob is made available by upstream - # (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227) - msg "Patching set DEFAULT_CONSOLE_LOGLEVEL to 4" - patch -p1 -i "${srcdir}/change-default-console-loglevel.patch" - + patch -p1 -i ../patch-${pkgver} + ### Patch source with UKSM - msg "Patching with UKSM" - patch -Np1 -i "${srcdir}/uksm-${_uksmvernel}-for-linux-${_uksmname}.patch" - - ### Patch source with BFQ - msg "Patching source with BFQ patches" - for p in "${srcdir}"/000{1,2,3}-block*.patch; do - msg " $p" - patch -Np1 -i "$p" - done - + msg "Patching source with UKSM" + patch -Np1 -i ../${_uksm_patch} + ### Patch source to enable more gcc CPU optimizatons via the make nconfig msg "Patching source with gcc patch to enable more cpus types" - patch -Np1 -i "${srcdir}/${_gcc_patch}" - - + patch -Np1 -i ../${_gcc_patch} + ### Clean tree and copy ARCH config over msg "Running make mrproper to clean source tree" make mrproper - if [ "${CARCH}" = "x86_64" ]; then - cat "${srcdir}/config.x86_64" > ./.config - else - cat "${srcdir}/config" > ./.config - fi - - ### Optionally set tickrate to 1000 - if [ -n "$_1k_HZ_ticks" ]; then - msg "Setting tick rate to 1k..." - sed -i -e 's/^CONFIG_HZ_300=y/# CONFIG_HZ_300 is not set/' \ - -i -e 's/^# CONFIG_HZ_1000 is not set/CONFIG_HZ_1000=y/' \ - -i -e 's/^CONFIG_HZ=300/CONFIG_HZ=1000/' .config - fi - - ### Optionally use running kernel's config + cp -Tf ../config.${CARCH} .config + + ### Optionally use running kernel's config # code originally by nous; http://aur.archlinux.org/packages.php?ID=40191 if [ -n "$_use_current" ]; then if [[ -s /proc/config.gz ]]; then @@ -158,8 +112,16 @@ prepare() { warning "Aborting!" exit fi + fi + + ### Optionally set tickrate to 1000 + if [ -n "$_1k_HZ_ticks" ]; then + msg "Setting tick rate to 1k..." + sed -i -e 's/^CONFIG_HZ_300=y/# CONFIG_HZ_300 is not set/' \ + -i -e 's/^# CONFIG_HZ_1000 is not set/CONFIG_HZ_1000=y/' \ + -i -e 's/^CONFIG_HZ=300/CONFIG_HZ=1000/' .config fi - + if [ "${_kernelname}" != "" ]; then sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config sed -i "s|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|" ./.config @@ -183,20 +145,13 @@ prepare() { fi fi - ### Optionally enable BFQ as the default I/O scheduler - if [ -n "$_BFQ_enable_" ]; then - msg "Setting BFQ as default I/O scheduler..." - sed -i -e '/CONFIG_DEFAULT_IOSCHED/ s,cfq,bfq,' \ - -i -e s'/CONFIG_DEFAULT_CFQ=y/# CONFIG_DEFAULT_CFQ is not set\nCONFIG_DEFAULT_BFQ=y/' ./.config - fi - - # set extraversion to pkgrel + ### 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 + ### Don't run depmod on 'make install'. We'll do this ourselves in packaging sed -i '2iexit 0' scripts/depmod.sh - # get kernel version + ### Get kernel version msg "Running make prepare for you to enable patched options of your choosing" make prepare @@ -205,281 +160,212 @@ prepare() { if [ -n "$_localmodcfg" ]; then msg "If you have modprobe-db installed, running it in recall mode now" if [ -e /usr/bin/modprobed-db ]; then - [[ ! -x /usr/bin/sudo ]] && echo "Cannot call modprobe with sudo. Install via pacman -S sudo and configure to work with this user." && exit 1 + [[ -x /usr/bin/sudo ]] || { + echo "Cannot call modprobe with sudo. Install sudo and configure it to work with this user." + exit 1; } sudo /usr/bin/modprobed-db recall fi msg "Running Steven Rostedt's make localmodconfig now" make localmodconfig fi - if [ -n "$_makenconfig" ]; then - msg "Running make nconfig" - make nconfig - fi + ### Running make nconfig - if [ -n "$_makemenuconfig" ]; then - msg "Running make menuconfig" - make menuconfig - fi + [[ -z "$_makenconfig" ]] || make nconfig - if [ -n "$_makexconfig" ]; then - msg "Running make xconfig" - make xconfig - fi + ### Running make menuconfig - if [ -n "$_makegconfig" ]; then - msg "Running make gconfig" - make gconfig - fi - - # rewrite configuration + [[ -z "$_makemenuconfig" ]] || make menuconfig + + ### Running make xconfig + + [[ -z "$_makexconfig" ]] || make xconfig + + ### Running make gconfig + + [[ -z "$_makegconfig" ]] || make gconfig + + ### 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.last" - fi + ### Save configuration for later reuse + cat .config > "${startdir}/config.${CARCH}.last" } build() { - cd ${_srcname} - msg "Running make bzImage and modules" - make ${MAKEFLAGS} LOCALVERSION= bzImage modules + cd ${_srcname} + + make ${MAKEFLAGS} LOCALVERSION= bzImage modules } -package_linux-uksm() { - pkgdesc='Linux Kernel and modules with the UKSM patchset featuring the v1.2.4 and BFQ scheduler.' +_package-kernel() { + pkgdesc='Linux Kernel and modules with the UKSM.' depends=('coreutils' 'linux-firmware' 'mkinitcpio>=0.7') - optdepends=('crda: to set the correct wireless channels of your country' 'nvidia-uksm: nVidia drivers for linux-uksm' 'modprobed-db: Keeps track of EVERY kernel module that has ever been probed - useful for those of us who make localmodconfig') - backup=("etc/mkinitcpio.d/linux-uksm.preset") - install=linux-uksm.install + optdepends=('crda: to set the correct wireless channels of your country' 'modprobed-db: Keeps track of EVERY kernel module that has ever been probed - useful for those of us who make localmodconfig') + backup=("etc/mkinitcpio.d/${pkgbase}.preset") + install=linux.install cd ${_srcname} KARCH=x86 - # get kernel version - _kernver="$(make LOCALVERSION= kernelrelease)" - _basekernel=${_kernver%%-*} - _basekernel=${_basekernel%.*} - - mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot} - make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}" modules_install - cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-linux-uksm" - - # set correct depmod command for install - cp -f "${startdir}/${install}" "${startdir}/${install}.pkg" - true && install=${install}.pkg - sed \ - -e "s/KERNEL_NAME=.*/KERNEL_NAME=-uksm/g" \ - -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \ - -i "${startdir}/${install}" - - # install mkinitcpio preset file for kernel - install -D -m644 "${srcdir}/linux-uksm.preset" "${pkgdir}/etc/mkinitcpio.d/linux-uksm.preset" - sed \ - -e "1s|'linux.*'|'linux-uksm'|" \ - -e "s|ALL_kver=.*|ALL_kver=\"/boot/vmlinuz-linux-uksm\"|" \ - -e "s|default_image=.*|default_image=\"/boot/initramfs-linux-uksm.img\"|" \ - -e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-linux-uksm-fallback.img\"|" \ - -i "${pkgdir}/etc/mkinitcpio.d/linux-uksm.preset" - - # remove build and source links - rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build} - # remove the firmware - rm -rf "${pkgdir}/lib/firmware" - # make room for external modules - ln -s "../extramodules-${_basekernel}${_kernelname:uksm}" "${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:uksm}" - echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:uksm}/version" - - # Now we call depmod... - depmod -b "${pkgdir}" -F System.map "${_kernver}" - - # move module tree /lib -> /usr/lib - mkdir -p "${pkgdir}/usr" - mv "${pkgdir}/lib" "${pkgdir}/usr/" - - # add vmlinux - install -D -m644 vmlinux "${pkgdir}/usr/lib/modules/${_kernver}/build/vmlinux" + # get kernel version + _kernver="$(make LOCALVERSION= kernelrelease)" + _basekernel=${_kernver%%-*} + _basekernel=${_basekernel%.*} + + 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}" + + # set correct depmod command for install + sed -e "s|%PKGBASE%|${pkgbase}|g;s|%KERNVER%|${_kernver}|g" \ + "${startdir}/${install}" > "${startdir}/${install}.pkg" + true && install=${install}.pkg + + # install mkinitcpio preset file for kernel + sed "s|%PKGBASE%|${pkgbase}|g" ../linux.preset | + install -Dm644 /dev/stdin "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset" + + # install pacman hook for initramfs regeneration + sed "s|%PKGBASE%|${pkgbase}|g" ../90-linux.hook | + install -Dm644 /dev/stdin "${pkgdir}/usr/share/libalpm/hooks/90-${pkgbase}.hook" + + # remove build and source links + rm "${pkgdir}"/lib/modules/${_kernver}/{source,build} + + # remove the firmware + rm -r "${pkgdir}/lib/firmware" + + # make room for external modules + ln -s "../extramodules-${_basekernel}${_kernelname:--ARCH}" "${pkgdir}/lib/modules/${_kernver}/extramodules" + + # add real version for building modules and running depmod from post_install/upgrade + echo "${_kernver}" | + install -Dm644 /dev/stdin "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}/version" + + # Now we call depmod... + depmod -b "${pkgdir}" -F System.map "${_kernver}" + + # move module tree /lib -> /usr/lib + mv -t "${pkgdir}/usr" "${pkgdir}/lib" + + # add vmlinux + install -Dm644 vmlinux "${pkgdir}/usr/lib/modules/${_kernver}/build/vmlinux" } -package_linux-uksm-headers() { - pkgdesc='Header files and scripts to build modules for linux-uksm.' +_package-headers() { + pkgdesc='Header files and scripts to build modules for linux-uksm' depends=('linux-uksm') install -dm755 "${pkgdir}/usr/lib/modules/${_kernver}" cd ${_srcname} - - KARCH=x86 - - # get kernel version - _kernver="$(make LOCALVERSION= kernelrelease)" - _basekernel=${_kernver%%-*} - _basekernel=${_basekernel%.*} + local _builddir="${pkgdir}/usr/lib/modules/${_kernver}/build" - - install -D -m644 Makefile \ - "${pkgdir}/usr/lib/modules/${_kernver}/build/Makefile" - install -D -m644 kernel/Makefile \ - "${pkgdir}/usr/lib/modules/${_kernver}/build/kernel/Makefile" - install -D -m644 .config \ - "${pkgdir}/usr/lib/modules/${_kernver}/build/.config" + install -Dt "${_builddir}" -m644 Makefile .config Module.symvers + install -Dt "${_builddir}/kernel" -m644 kernel/Makefile - mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include" + mkdir "${_builddir}/.tmp_versions" - for i in acpi asm-generic config crypto drm generated keys linux math-emu \ - media net pcmcia scsi sound trace uapi video xen; do - cp -a include/${i} "${pkgdir}/usr/lib/modules/${_kernver}/build/include/" - done + cp -t "${_builddir}" -a include scripts - # copy arch includes for external modules - mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/x86" - cp -a arch/x86/include "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/x86/" + install -Dt "${_builddir}/arch/${KARCH}" -m644 arch/${KARCH}/Makefile + install -Dt "${_builddir}/arch/${KARCH}/kernel" -m644 arch/${KARCH}/kernel/asm-offsets.s - # copy files necessary for later builds, like nvidia and vmware - cp Module.symvers "${pkgdir}/usr/lib/modules/${_kernver}/build" - cp -a scripts "${pkgdir}/usr/lib/modules/${_kernver}/build" + if [[ ${CARCH} = i686 ]]; then + install -t "${_builddir}/arch/${KARCH}" -m644 arch/${KARCH}/Makefile_32.cpu + 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" + cp -t "${_builddir}/arch/${KARCH}" -a arch/${KARCH}/include - mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/kernel" + install -Dt "${_builddir}/drivers/md" -m644 drivers/md/*.h + install -Dt "${_builddir}/net/mac80211" -m644 net/mac80211/*.h - cp arch/${KARCH}/Makefile "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/" + # http://bugs.archlinux.org/task/9912 + install -Dt "${_builddir}/drivers/media/dvb-core" -m644 drivers/media/dvb-core/*.h - if [ "${CARCH}" = "i686" ]; then - cp arch/${KARCH}/Makefile_32.cpu "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/" - fi + # http://bugs.archlinux.org/task/13146 + install -Dt "${_builddir}/drivers/media/dvb-frontends" -m644 drivers/media/dvb-frontends/lgdt330x.h + install -Dt "${_builddir}/drivers/media/i2c" -m644 drivers/media/i2c/msp3400-driver.h - cp arch/${KARCH}/kernel/asm-offsets.s "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/kernel/" - - # add docbook makefile - install -D -m644 Documentation/DocBook/Makefile \ - "${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/DocBook/Makefile" - - # add dm headers - mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/md" - cp drivers/md/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/md" - - # add inotify.h - mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include/linux" - cp include/linux/inotify.h "${pkgdir}/usr/lib/modules/${_kernver}/build/include/linux/" - - # add wireless headers - mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/net/mac80211/" - cp net/mac80211/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/net/mac80211/" - - # add dvb headers for external modules - # in reference to: - # http://bugs.archlinux.org/task/9912 - mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-core" - cp drivers/media/dvb-core/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-core/" - # and... - # http://bugs.archlinux.org/task/11194 - ### - ### DO NOT MERGE OUT THIS IF STATEMENT - ### IT AFFECTS USERS WHO STRIP OUT THE DVB STUFF SO THE OFFICIAL ARCH CODE HAS A CP - ### LINE THAT CAUSES MAKEPKG TO END IN AN ERROR - ### - if [ -d include/config/dvb/ ]; then - mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include/config/dvb/" - cp include/config/dvb/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/include/config/dvb/" - fi + # http://bugs.archlinux.org/task/20402 + install -Dt "${_builddir}/drivers/media/usb/dvb-usb" -m644 drivers/media/usb/dvb-usb/*.h + install -Dt "${_builddir}/drivers/media/dvb-frontends" -m644 drivers/media/dvb-frontends/*.h + install -Dt "${_builddir}/drivers/media/tuners" -m644 drivers/media/tuners/*.h + + # add xfs and shmem for aufs building + mkdir -p "${_builddir}"/{fs/xfs,mm} + + # copy in Kconfig files + find . -name Kconfig\* -exec install -Dm644 {} "${_builddir}/{}" \; - # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new - # in reference to: - # http://bugs.archlinux.org/task/13146 - mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/" - cp drivers/media/dvb-frontends/lgdt330x.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/" - mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c/" - cp drivers/media/i2c/msp3400-driver.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c/" - - # add dvb headers - # in reference to: - # http://bugs.archlinux.org/task/20402 - mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/usb/dvb-usb" - cp drivers/media/usb/dvb-usb/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/usb/dvb-usb/" - mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends" - cp drivers/media/dvb-frontends/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/" - mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/tuners" - cp drivers/media/tuners/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/tuners/" - - # add xfs and shmem for aufs building - mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/fs/xfs" - mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/mm" - # removed in 3.17 series - #cp fs/xfs/xfs_sb.h "${pkgdir}/usr/lib/modules/${_kernver}/build/fs/xfs/xfs_sb.h" - - # copy in Kconfig files - for i in $(find . -name "Kconfig*"); do - mkdir -p "${pkgdir}"/usr/lib/modules/${_kernver}/build/`echo ${i} | sed 's|/Kconfig.*||'` - cp ${i} "${pkgdir}/usr/lib/modules/${_kernver}/build/${i}" - done - - chown -R root.root "${pkgdir}/usr/lib/modules/${_kernver}/build" - find "${pkgdir}/usr/lib/modules/${_kernver}/build" -type d -exec chmod 755 {} \; - - # strip scripts directory - find "${pkgdir}/usr/lib/modules/${_kernver}/build/scripts" -type f -perm -u+w 2>/dev/null | while read binary ; do - case "$(file -bi "${binary}")" in - *application/x-sharedlib*) # Libraries (.so) - /usr/bin/strip ${STRIP_SHARED} "${binary}";; - *application/x-archive*) # Libraries (.a) - /usr/bin/strip ${STRIP_STATIC} "${binary}";; - *application/x-executable*) # Binaries - /usr/bin/strip ${STRIP_BINARIES} "${binary}";; - esac - done + # add objtool for external module building and enabled VALIDATION_STACK option + if [[ -e tools/objtool/objtool ]]; then + install -Dt "${_builddir}/tools/objtool" tools/objtool/objtool + fi # remove unneeded architectures - rm -rf "${pkgdir}"/usr/lib/modules/${_kernver}/build/arch/{alpha,arm,arm26,arm64,avr32,blackfin,c6x,cris,frv,h8300,hexagon,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,openrisc,parisc,powerpc,ppc,s390,score,sh,sh64,sparc,sparc64,tile,unicore32,um,v850,xtensa} + local _arch + for _arch in "${_builddir}"/arch/*/; do + if [[ ${_arch} != */${KARCH}/ ]]; then + rm -r "${_arch}" + fi + done + + # remove files already in linux-uksm-docs package + rm -r "${_builddir}/Documentation" + + # Fix permissions + chmod -R u=rwX,go=rX "${_builddir}" + + # strip scripts directory + local _binary _strip + while read -rd '' _binary; do + case "$(file -bi "${_binary}")" in + *application/x-sharedlib*) _strip="${STRIP_SHARED}" ;; # Libraries (.so) + *application/x-archive*) _strip="${STRIP_STATIC}" ;; # Libraries (.a) + *application/x-executable*) _strip="${STRIP_BINARIES}" ;; # Binaries + *) continue ;; + esac + /usr/bin/strip ${_strip} "${_binary}" + done < <(find "${_builddir}/scripts" -type f -perm -u+w -print0 2>/dev/null) } -package_linux-uksm-docs() { - pkgdesc="Kernel hackers manual - HTML documentation that comes with the linux-uksm kernel" +_package-docs() { + pkgdesc='Kernel hackers manual - HTML documentation that comes with the linux-uksm.' depends=('linux-uksm') cd ${_srcname} + local _builddir="${pkgdir}/usr/lib/modules/${_kernver}/build" - KARCH=x86 - - # get kernel version - _kernver="$(make LOCALVERSION= kernelrelease)" - _basekernel=${_kernver%%-*} - _basekernel=${_basekernel%.*} + mkdir -p "${_builddir}" + cp -t "${_builddir}" -a Documentation - mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build" - cp -al Documentation "${pkgdir}/usr/lib/modules/${_kernver}/build" - find "${pkgdir}" -type f -exec chmod 444 {} \; - find "${pkgdir}" -type d -exec chmod 755 {} \; - - # remove a file already in linux package - rm -f "${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/DocBook/Makefile" + # Fix permissions + chmod -R u=rwX,go=rX "${_builddir}" } -sha512sums=('ce13d2c1c17908fd9a4aa42bb6348a0cb13dd22e560bd54c61b8bfdf62726d6095f130c59177a2fe4793b7dc399481bf10d3556d1d571616000f180304e5a995' +pkgname=("${pkgbase}-kernel" "${pkgbase}-headers" "${pkgbase}-docs") +for _p in ${pkgname[@]}; do + eval "package_${_p}() { + $(declare -f "_package${_p#${pkgbase}}") + _package${_p#${pkgbase}} + }" +done + +sha512sums=('a557c2f0303ae618910b7106ff63d9978afddf470f03cb72aa748213e099a0ecd5f3119aea6cbd7b61df30ca6ef3ec57044d524b7babbaabddf8b08b8bafa7d2' 'SKIP' - '59cfaba028cf9d669ceac25f967945963330736059f38c01f584d3379e2ac243df3f89836e4815014f6799816746bba49a35915ccc4a66250bb95536d9b9e9f5' + '37aa8add92ae23b627c166b878b6d8191b75c2aca3a2eb2d7ae4f55262644731ab51a3ee171186fc0b011c6c8e537686377c3e73e8928797323b0a958eeb4b6b' 'SKIP' - 'ce46c47a1685f5014f4ada55b9ee6292255a383f83c04ac84ae922d16fef0687ebf09e7a6b211f23c6d1156312ef812c950805979893792f3e19b6c643d2fb81' - '1a08e834c4e90a7f9da77460bda1ed0efa9b331811521520402b0d094de3a1155d6e7ddbcbfcbefeef92b5468c56960750f6568cd73114a2a87a9d8a39a63fe8' - '46cb51684ca5fd9ba9460c8a62be22e99169de1b5e87ac47f9782f52123993de61fe9563ffec062a9b7c2024d08b1d5f57e09a09dbd7841faa3d149f346f5464' - '879ab2364ae09993f8dcd17f3c44584967cf26d26f8376611a9eb7824cf78cadf4cdae58d18f3b493d0ec48395888f1ca1395563e52501dc79f559369c931371' - '76bf6a9f22b023ab8f780884f595dac1801d150ecd94f88da229c5c9ea98d2c3ef8add01ff7e18e4cbbfa5e6e9c022c4042ee62c779a8485203c1b0e082b8ccc' - '274c592f48eba59dc1423ecd926859eb87fbb6ad3431415ed79bcfbaeae59a71d09669edfc4d217ec9ff39da42af21c8a55ceb4d6463c288d3c5f470b19184e8' - 'd9d28e02e964704ea96645a5107f8b65cae5f4fb4f537e224e5e3d087fd296cb770c29ac76e0ce95d173bc420ea87fb8f187d616672a60a0cae618b0ef15b8c8' - 'c48370c02c26f05ef09f89b539f07f49a712524c07465601cdfcf4b12bbfaee2f86c350fa24badf661d62fe6cf2dcf1d4d51093642ac29664eb3204ad4c0048d' - 'a3683a42b0480140be2c85645fefb5db097ee7e7d76c2e45a28d3090a0680a80fca416f0df67dd32f8d88c7f1fcb114bd93364f720f6b281fd2458df99151a6a' - '412d17407ecb6dffe036094a33531edb8df0c9a6e6a1aebe113733db066c8530a87710c5d51bbf5310a9a39cacc95cecf938d2e7e63903605c45c06d73b975d7' - '68f8c2bd38baf91ac5058cda03f11b2388b3de1fd5064d8c15317354877be1ec56c92fa2f535b7e0868472a5c94fbfa225481fa0990664a786ab358bc010af3a') + '5ca7ae20245a54caa71fb570d971d6872d4e888f35c6123b93fbca16baf9a0e2500d6ec931f3906e4faecaaca9cad0d593694d9cab617efd0cb7b5fc09c0fa48' + '632c37449c088141dbed4e745c252849396a305a03a86349080a58fb14d7fcd3488f306b890a082a334dab878e179889dfaae0423dfe3d125f48804847abbb39' + '4644b7a118f6e75ea6835daa83045f7faeb5086d02aa7ca2b84e092139e7c6b0c55afe3c934694e8e9fbf7c98c931863b113354cf94d291985fb543711863518' + 'b7934213009b9f812aae38d635043183c18fb5d51543ca372301e9fe13806bfff553d3f483da9f9c5973d6d4c0394270ca7e68c7eb69d69ec0826efe36862dfd' + 'd6faa67f3ef40052152254ae43fee031365d0b1524aa0718b659eb75afc21a3f79ea8d62d66ea311a800109bed545bc8f79e8752319cd378eef2cbd3a09aba22' + '2dc6b0ba8f7dbf19d2446c5c5f1823587de89f4e28e9595937dd51a87755099656f2acec50e3e2546ea633ad1bfd1c722e0c2b91eef1d609103d8abdc0a7cbaf') validpgpkeys=( 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds '647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman - )
\ No newline at end of file + ) |