summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorPieter Lenaerts2018-01-07 00:22:59 +0100
committerPieter Lenaerts2018-01-07 00:22:59 +0100
commitbccc6c29e9834729490e898a71d081f7f8658cc4 (patch)
tree7bcfa6b096ddba726c294c25a5323ea16b211b30 /PKGBUILD
parentfcb7a09139a22e40773640f6be2aa9e24a142e78 (diff)
downloadaur-bccc6c29e9834729490e898a71d081f7f8658cc4.tar.gz
Kernel version to 4.14.9 including std arch patches. Applying patches
primarily based on https://ubuntuforums.org/showthread.php?t=2254322&page=158&p=13625163#post13625163
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD373
1 files changed, 184 insertions, 189 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 5a1b783d9856..42c340d8315a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,71 +1,123 @@
-# $Id: PKGBUILD 265148 2016-04-19 06:55:26Z tpowa $
-# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
-# Maintainer: Thomas Baechler <thomas@archlinux.org>
+# $Id$
+# Maintainer: Pieter Lenaerts <pieter dot aj dot lenaerts at gmail>
+# Contributor: Tobias Powalowski <tpowa@archlinux.org>
+# Contributor: Thomas Baechler <thomas@archlinux.org>
pkgbase=linux-x205ta
-_srcname=linux-4.5
-pkgver=4.5.1
+_srcname=linux-4.14
+pkgver=4.14.9
pkgrel=1
-arch=('i686' 'x86_64')
-url="http://www.kernel.org/"
+arch=('x86_64')
+url="https://www.kernel.org/"
license=('GPL2')
-makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc')
+makedepends=('xmlto' 'kmod' 'inetutils' 'bc' 'libelf')
options=('!strip')
-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"
- "https://www.kernel.org/pub/linux/kernel/v4.x/patch-${pkgver}.xz"
- "https://www.kernel.org/pub/linux/kernel/v4.x/patch-${pkgver}.sign"
- # the main kernel config files
- 'config' 'config.x86_64'
- # standard config files for mkinitcpio ramdisk
- 'linux.preset'
- 'change-default-console-loglevel.patch'
- '0002-byt-cstates-fix.patch'
- '0003-elan-touchpad-fix.patch')
-
-sha256sums=('a40defb401e01b37d6b8c8ad5c1bbab665be6ac6310cdeed59950c96b31a519c'
+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"
+ "https://www.kernel.org/pub/linux/kernel/v4.x/patch-${pkgver}.xz"
+ "https://www.kernel.org/pub/linux/kernel/v4.x/patch-${pkgver}.sign"
+ '60-linux.hook' # pacman hook for depmod
+ '90-linux.hook' # pacman hook for initramfs regeneration
+ 'linux.preset' # standard config files for mkinitcpio ramdisk
+ '0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch'
+ '0001-e1000e-Fix-e1000_check_for_copper_link_ich8lan-retur.patch'
+ '0002-dccp-CVE-2017-8824-use-after-free-in-DCCP-code.patch'
+ '0001-Revert-xfrm-Fix-stack-out-of-bounds-read-in-xfrm_sta.patch'
+ '0002-xfrm-Fix-stack-out-of-bounds-read-on-socket-policy-l.patch'
+ '0003-cgroup-fix-css_task_iter-crash-on-CSS_TASK_ITER_PROC.patch'
+ '0001-ALSA-usb-audio-Fix-the-missing-ctl-name-suffix-at-pa.patch'
+ '9000-fix_c-state_patchv4.14.patch'
+ '9002-brcmfmac-p2p-and-normal-ap-access-are-not-always-possible-at-the-same-time.patch'
+ '9001-rpmb.patch'
+ '9003-brcmfmac-properly-align-buffers-on-certain-platform-swith-64-bit-DMA.patch'
+ 'config_x205ta'
+)
+validpgpkeys=(
+ 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds
+ '647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman
+)
+sha256sums=('f81d59477e90a130857ce18dc02f4fbe5725854911db1e7ba770c7cd350f96a7'
'SKIP'
- '060ad091ebfa2b63d62e86beaf68c3a5d4638c506c3ac941c1825ba756e830b1'
+ '5edc955bb67b04c7ed426b1df17a3e322e32ad9fdda9c6abb53ab6eca7faf704'
'SKIP'
- '8a8a955f015ee8342701231a63836cec0e300fd7e96d30e8696fde8a383fcdc9'
- '8b60911aad591306336e300e27071f2d108c5016e66a04327b82ac69acbfefff'
- 'f0d90e756f14533ee67afda280500511a62465b4f76adcc5effa95a40045179c'
- '1256b241cd477b265a3c2d64bdc19ffe3c9bbcee82ea3994c590c2c76e767d99'
- '20c8d367cb1bd1574827657912fc7b3e8dfb078be5a1fa9de45da5acc824c527'
- '5a56f93eaa394fa2d27cf7f8ac7b9db51889a97b08c2498f1e854feeaa9d90cb')
+ 'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21'
+ '75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919'
+ 'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65'
+ '37b86ca3de148a34258e3176dbf41488d9dbd19e93adbd22a062b3c41332ce85'
+ 'c6e7db7dfd6a07e1fd0e20c3a5f0f315f9c2a366fe42214918b756f9a1c9bfa3'
+ '1d69940c6bf1731fa1d1da29b32ec4f594fa360118fe7b128c9810285ebf13e2'
+ 'ed3266ab03f836f57de0faf8a10ffd7566c909515c2649de99adaab2fac4aa32'
+ '64a014f7e1b4588728b3ea9538beee67ec63fb792d890c7be9cc13ddc2121b00'
+ '3d4c41086c077fbd515d04f5e59c0c258f700433c5da3365d960b696c2e56efb'
+ '95f0d0a94983b0dafd295f660a663f9be5ef2fcb9646098426a5d12b59f50638'
+ 'dfbef29d75d08010223379500be62b7866c4606386d863eae1ba41bee16807de'
+ 'ad0f318809d074ee387f48fdfcb711b0fa3eb378867ac65c6da3d490834e649d'
+ 'f69b0f127f8f1a2b4b34dedaf3c37ef3e561e75fea4de031993341a93c0456d9'
+ '139b6357a092ecc0284ba8f4440f7babcb6f5ac81a52420ad950de4cd2f281dd'
+ '13bdf6048dba34c76565a98f758333bfe38bdb7e378122ea98c249f8e2c2cda5')
-validpgpkeys=(
- 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds
- '647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman
- )
_kernelname=${pkgbase#linux}
prepare() {
- cd "${srcdir}/${_srcname}"
+cd ${_srcname}
# add upstream patch
- patch -p1 -i "${srcdir}/patch-${pkgver}"
+ patch -p1 -i ../patch-${pkgver}
+
+ # security patches
# add latest fixes from stable queue, if needed
# http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git
+
+ # disable USER_NS for non-root users by default
+ patch -Np1 -i ../0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch
+
+ # https://bugs.archlinux.org/task/56575
+ patch -Np1 -i ../0001-e1000e-Fix-e1000_check_for_copper_link_ich8lan-retur.patch
+
+ # https://nvd.nist.gov/vuln/detail/CVE-2017-8824
+ patch -Np1 -i ../0002-dccp-CVE-2017-8824-use-after-free-in-DCCP-code.patch
+
+ # https://bugs.archlinux.org/task/56605
+ patch -Np1 -i ../0001-Revert-xfrm-Fix-stack-out-of-bounds-read-in-xfrm_sta.patch
+ patch -Np1 -i ../0002-xfrm-Fix-stack-out-of-bounds-read-on-socket-policy-l.patch
+
+ # https://bugs.archlinux.org/task/56846
+ patch -Np1 -i ../0003-cgroup-fix-css_task_iter-crash-on-CSS_TASK_ITER_PROC.patch
+
+ # https://bugs.archlinux.org/task/56830
+ patch -Np1 -i ../0001-ALSA-usb-audio-Fix-the-missing-ctl-name-suffix-at-pa.patch
+
+ # Here start x205ta patches, refer to https://goo.gl/dcXIM0 for harryharryharry's guide which is the main starting point
+ # for info on these patches.
- # bay trail cstates fix
- patch -p1 -i "${srcdir}/0002-byt-cstates-fix.patch"
+ # patch no. 1 (attempts to prevents baytrail kernel freezes - thanks to jbMacAZ)
+ # refer to https://bugzilla.kernel.org/show_bug.cgi?id=109051#c829 for statement that this seems the more effective patch.
+ # refer to https://drive.google.com/file/d/1uZeTQa6sWdtwXBIa8de5hkwEKeDeUR30/view for the patch, but to
+ # https://drive.google.com/drive/folders/0B4s5KNXf2Z36Nkxac245LTBGdjQ for an overview of patches for ASUS T100H, where this
+ # patch is published.
+ patch -Np1 -i ../9000-fix_c-state_patchv4.14.patch
- # elan touchpad fix
- patch -p1 -i "${srcdir}/0003-elan-touchpad-fix.patch"
+ # patch no. 2 (hide unnecessary mmcblkXrpmb block devices, which can cause hangups)
+ # refer to https://dev-nell.com/rpmb-emmc-errors-under-linux.html
+ patch -Np1 -i ../9001-rpmb.patch
- # 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)
- patch -p1 -i "${srcdir}/change-default-console-loglevel.patch"
+ # patch no. 3 (hide dmesg errors of brcmfmac trying to enable a p2p device)
+ # refer to https://patchwork.kernel.org/patch/9592913/
+ patch -Np1 -i ../9002-brcmfmac-p2p-and-normal-ap-access-are-not-always-possible-at-the-same-time.patch
- if [ "${CARCH}" = "x86_64" ]; then
- cat "${srcdir}/config.x86_64" > ./.config
- else
- cat "${srcdir}/config" > ./.config
- fi
+ # patch no. 4 (revert a patch in the mainline kernel which reduces wifi stability.
+ # refer to https://github.com/torvalds/linux/commit/6e84ab604bdedaa16239bd1c6e5fcb5660309f02.diff
+ patch -Rp1 -i ../9003-brcmfmac-properly-align-buffers-on-certain-platform-swith-64-bit-DMA.patch
+
+ # x205ta patches end here
+
+ # copying the x205ta config.
+ # harryharryharry's x205ta config file, updated to 4.14.9
+ # upstream is not always available. Should be at http://x205ta.myftp.org:1337/kernel/.config
+ cp -Tf ../config_x205ta .config
if [ "${_kernelname}" != "" ]; then
sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
@@ -94,204 +146,147 @@ prepare() {
}
build() {
- cd "${srcdir}/${_srcname}"
+ cd ${_srcname}
make ${MAKEFLAGS} LOCALVERSION= bzImage modules
}
_package() {
- pkgdesc="The ${pkgbase/linux/Linux} kernel and modules"
+ pkgdesc="The ${pkgbase/linux/Linux} kernel and modules, with patches and config for ASUS x205ta."
[ "${pkgbase}" = "linux" ] && groups=('base')
depends=('coreutils' 'linux-firmware' 'kmod' 'mkinitcpio>=0.7')
optdepends=('crda: to set the correct wireless channels of your country')
backup=("etc/mkinitcpio.d/${pkgbase}.preset")
install=linux.install
- cd "${srcdir}/${_srcname}"
-
- KARCH=x86
+ cd ${_srcname}
# 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
- cp -f "${startdir}/${install}" "${startdir}/${install}.pkg"
- true && install=${install}.pkg
- sed \
- -e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/" \
- -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/" \
- -i "${startdir}/${install}"
-
- # install mkinitcpio preset file for kernel
- install -D -m644 "${srcdir}/linux.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
- 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"
+ mkdir -p "${pkgdir}"/{boot,usr/lib/modules}
+ make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}/usr" modules_install
+ cp arch/x86/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}"
- # 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:--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}${_kernelname:--ARCH}"
- echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}/version"
-
- # Now we call depmod...
- depmod -b "${pkgdir}" -F System.map "${_kernver}"
+ local _extramodules="extramodules-${_basekernel}${_kernelname:--ARCH}"
+ ln -s "../${_extramodules}" "${pkgdir}/usr/lib/modules/${_kernver}/extramodules"
- # move module tree /lib -> /usr/lib
- mkdir -p "${pkgdir}/usr"
- mv "${pkgdir}/lib" "${pkgdir}/usr/"
+ # add real version for building modules and running depmod from hook
+ echo "${_kernver}" |
+ install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modules/${_extramodules}/version"
- # add vmlinux
- install -D -m644 vmlinux "${pkgdir}/usr/lib/modules/${_kernver}/build/vmlinux"
-}
-
-_package-headers() {
- pkgdesc="Header files and scripts for building modules for ${pkgbase/linux/Linux} kernel"
-
- install -dm755 "${pkgdir}/usr/lib/modules/${_kernver}"
+ # remove build and source links
+ rm "${pkgdir}"/usr/lib/modules/${_kernver}/{source,build}
- cd "${srcdir}/${_srcname}"
- 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"
+ # now we call depmod...
+ depmod -b "${pkgdir}/usr" -F System.map "${_kernver}"
- mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include"
+ # add vmlinux
+ install -Dt "${pkgdir}/usr/lib/modules/${_kernver}/build" -m644 vmlinux
- 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
+ # sed expression for following substitutions
+ local _subst="
+ s|%PKGBASE%|${pkgbase}|g
+ s|%KERNVER%|${_kernver}|g
+ s|%EXTRAMODULES%|${_extramodules}|g
+ "
- # 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/"
+ # hack to allow specifying an initially nonexisting install file
+ sed "${_subst}" "${startdir}/${install}" > "${startdir}/${install}.pkg"
+ true && install=${install}.pkg
- # 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"
+ # install mkinitcpio preset file
+ sed "${_subst}" ../linux.preset |
+ install -Dm644 /dev/stdin "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
- # 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"
+ # install pacman hooks
+ sed "${_subst}" ../60-linux.hook |
+ install -Dm644 /dev/stdin "${pkgdir}/usr/share/libalpm/hooks/60-${pkgbase}.hook"
+ sed "${_subst}" ../90-linux.hook |
+ install -Dm644 /dev/stdin "${pkgdir}/usr/share/libalpm/hooks/90-${pkgbase}.hook"
+}
- mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/kernel"
+_package-headers() {
+ pkgdesc="Header files and scripts for building modules for ${pkgbase/linux/Linux} kernel, with patches for ASUS x205ta."
- cp arch/${KARCH}/Makefile "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/"
+ cd ${_srcname}
+ local _builddir="${pkgdir}/usr/lib/modules/${_kernver}/build"
- if [ "${CARCH}" = "i686" ]; then
- cp arch/${KARCH}/Makefile_32.cpu "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/"
- fi
+ install -Dt "${_builddir}" -m644 Makefile .config Module.symvers
+ install -Dt "${_builddir}/kernel" -m644 kernel/Makefile
- cp arch/${KARCH}/kernel/asm-offsets.s "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/kernel/"
+ mkdir "${_builddir}/.tmp_versions"
- # add docbook makefile
- install -D -m644 Documentation/DocBook/Makefile \
- "${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/DocBook/Makefile"
+ cp -t "${_builddir}" -a include scripts
- # 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"
+ install -Dt "${_builddir}/arch/x86" -m644 arch/x86/Makefile
+ install -Dt "${_builddir}/arch/x86/kernel" -m644 arch/x86/kernel/asm-offsets.s
- # 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/"
+ cp -t "${_builddir}/arch/x86" -a arch/x86/include
- # 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/"
+ install -Dt "${_builddir}/drivers/md" -m644 drivers/md/*.h
+ install -Dt "${_builddir}/net/mac80211" -m644 net/mac80211/*.h
- # 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
- 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/"
-
- # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
- # in reference to:
+ install -Dt "${_builddir}/drivers/media/dvb-core" -m644 drivers/media/dvb-core/*.h
+
# 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/"
+ install -Dt "${_builddir}/drivers/media/i2c" -m644 drivers/media/i2c/msp3400-driver.h
- # 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/"
+ 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 "${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"
+ mkdir -p "${_builddir}"/{fs/xfs,mm}
# 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}"
+ find . -name Kconfig\* -exec install -Dm644 {} "${_builddir}/{}" \;
+
+ # add objtool for external module building and enabled VALIDATION_STACK option
+ install -Dt "${_builddir}/tools/objtool" tools/objtool/objtool
+
+ # remove unneeded architectures
+ local _arch
+ for _arch in "${_builddir}"/arch/*/; do
+ [[ ${_arch} == */x86/ ]] && continue
+ rm -r "${_arch}"
done
- chown -R root.root "${pkgdir}/usr/lib/modules/${_kernver}/build"
- find "${pkgdir}/usr/lib/modules/${_kernver}/build" -type d -exec chmod 755 {} \;
+ # remove files already in linux-docs package
+ rm -r "${_builddir}/Documentation"
+
+ # Fix permissions
+ chmod -R u=rwX,go=rX "${_builddir}"
# 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}";;
+ 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
- done
-
- # remove unneeded architectures
- rm -rf "${pkgdir}"/usr/lib/modules/${_kernver}/build/arch/{alpha,arc,arm,arm26,arm64,avr32,blackfin,c6x,cris,frv,h8300,hexagon,ia64,m32r,m68k,m68knommu,metag,mips,microblaze,mn10300,openrisc,parisc,powerpc,ppc,s390,score,sh,sh64,sparc,sparc64,tile,unicore32,um,v850,xtensa}
-
- # remove a files already in linux-docs package
- rm -f "${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/kbuild/Kconfig.recursion-issue-01"
- rm -f "${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/kbuild/Kconfig.recursion-issue-02"
- rm -f "${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/kbuild/Kconfig.select-break"
+ /usr/bin/strip ${_strip} "${_binary}"
+ done < <(find "${_builddir}/scripts" -type f -perm -u+w -print0 2>/dev/null)
}
_package-docs() {
pkgdesc="Kernel hackers manual - HTML documentation that comes with the ${pkgbase/linux/Linux} kernel"
- cd "${srcdir}/${_srcname}"
+ cd ${_srcname}
+ local _builddir="${pkgdir}/usr/lib/modules/${_kernver}/build"
- 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 {} \;
+ mkdir -p "${_builddir}"
+ cp -t "${_builddir}" -a Documentation
- # 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}"
}
pkgname=("${pkgbase}" "${pkgbase}-headers" "${pkgbase}-docs")