summaryrefslogtreecommitdiff
path: root/kernels/linux-libre-rt/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'kernels/linux-libre-rt/PKGBUILD')
-rw-r--r--kernels/linux-libre-rt/PKGBUILD235
1 files changed, 86 insertions, 149 deletions
diff --git a/kernels/linux-libre-rt/PKGBUILD b/kernels/linux-libre-rt/PKGBUILD
index e8b1007ca..86b09fc40 100644
--- a/kernels/linux-libre-rt/PKGBUILD
+++ b/kernels/linux-libre-rt/PKGBUILD
@@ -1,5 +1,4 @@
# Maintainer: David P. <megver83@parabola.nu>
-# Maintainer: Jesús E. <heckyel@parabola.nu>
# Contributor: André Silva <emulatorman@hyperbola.info>
# Contributor: Márcio Silva <coadde@hyperbola.info>
# Contributor: Nicolás Reynolds <fauno@kiwwwi.com.ar>
@@ -12,9 +11,9 @@
pkgbase=linux-libre-rt
_pkgbasever=4.9-gnu
-_pkgver=4.9.35-gnu
+_pkgver=4.9.47-gnu
_rtbasever=4.9
-_rtpatchver=rt25
+_rtpatchver=rt37
_replacesarchkernel=('linux%') # '%' gets replaced with _kernelname
_replacesoldkernels=() # '%' gets replaced with _kernelname
@@ -24,7 +23,7 @@ _srcname=linux-${_pkgbasever%-*}
_archpkgver=${_pkgver%-*}_${_rtpatchver}
pkgver=${_pkgver//-/_}.${_rtpatchver}
pkgrel=1
-rcnrel=armv7-x4
+rcnrel=armv7-x5
arch=('i686' 'x86_64' 'armv7h')
url="https://rt.wiki.kernel.org/"
license=('GPL2')
@@ -48,20 +47,19 @@ source=("https://linux-libre.fsfla.org/pub/linux-libre/releases/${_pkgbasever}/l
'0001-usb-serial-gadget-no-TTY-hangup-on-USB-disconnect-WI.patch'
'0002-fix-Atmel-maXTouch-touchscreen-support.patch'
# armv7h patches
-# "https://repo.parabola.nu/other/rcn-libre/patches/${_pkgver%-*}/rcn-libre-${_pkgver%-*}-${rcnrel}.patch"{,.sig}
+ "https://repo.parabola.nu/other/rcn-libre/patches/${_pkgver%-*}/rcn-libre-${_pkgver%-*}-${rcnrel}.patch"{,.sig}
'0001-ARM-atags-add-support-for-Marvell-s-u-boot.patch'
'0002-ARM-atags-fdt-retrieve-MAC-addresses-from-Marvell-bo.patch'
'0003-SMILE-Plug-device-tree-file.patch'
'0004-fix-mvsdio-eMMC-timing.patch'
'0005-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch'
- '0006-ARM-TLV320AIC23-SoC-Audio-Codec-Fix-errors-reported-.patch'
- '0007-set-default-cubietruck-led-triggers.patch'
- '0008-exynos4412-odroid-set-higher-minimum-buck2-regulator.patch')
+ '0006-set-default-cubietruck-led-triggers.patch'
+ '0007-exynos4412-odroid-set-higher-minimum-buck2-regulator.patch')
sha512sums=('885eb0a7fab45dc749acb4329b4330a43b704df2d5f2f5aac1811503c132ca53ca49452f9b1cc80b0826c7a4962dbe4937aecb697aa823b2543ba2cabc704816'
'SKIP'
- '78eb447a92c7ee891f7681fe5b913461c99567a0360b860e412354b10cb4d84891888a35262a114919dee8f09c189e78107165650dfb2c933c677c796a5fd0de'
+ '8a9dc40c14b9d5b621c3121563991ab3384a3b75df70fdaf6209f9957e83629c2e3315e4b62edfcf416eed3f247fa069509bfc42603db941d742a6972a4fb903'
'SKIP'
- '49ae9ca9ead68445d14adb63277529eecac9f0ea42bdf755777f8f2f4afc660a8d9c16ac0d26e1553b163f532f274acd8308d21cf90e5ed82c5681f1b02f276b'
+ 'b41e77788f29f825d7de923b9601668a27298ed21c6ca44576f67c0db48795b8b22f32bcdb713eb79792e4d1b286dce1387faa3418a306034516023943047609'
'SKIP'
'13cb5bc42542e7b8bb104d5f68253f6609e463b6799800418af33eb0272cc269aaa36163c3e6f0aacbdaaa1d05e2827a4a7c4a08a029238439ed08b89c564bb3'
'SKIP'
@@ -69,20 +67,21 @@ sha512sums=('885eb0a7fab45dc749acb4329b4330a43b704df2d5f2f5aac1811503c132ca53ca4
'SKIP'
'7a3716bfe3b9f546da309c7492f3e08f8f506813afeb1c737a474c83313d5c313cf4582b65215c2cfce3b74d9d1021c96e8badafe8f6e5b01fe28d2b5c61ae78'
'SKIP'
- '628e2be190adca0584755e4f07209949fbac7c32777c6254cd1cc4ba12647f03167bfd54e8b556ff0f24f174ce1dcda40e26b17ab2260146e54ab60b134980b1'
- '60d82baec381c379f62ff3393760054c6f8e209ec86f56a1fdb40de70afae5cc05a61e85a6c20a70f476480f6957fad28ec14bf8f35139a3ccddfba7f14e7acf'
+ '72f605e7678e9bfe46075b245e009737b433172636e108155dbadec4540c1c2411bc7a3bca0b75d6b879b80950a4162aa750447c22c295ffef6c15210897959a'
+ 'c5eafbea055db7948decbbc8e99a4c76464302d525a556783487b98da8263d5510b1d566730c25b838230098c4167922e0076158c8e5feb66a4f22343ab5da5e'
'9208d62aa73752cc95a3584ecf245ce94058a0ac05bb5e8434dda100917a1725408cade525aeff6c2697f53bb4aff028bda69cb9c3b697bcdd7f8ae389ed2cc4'
'd6faa67f3ef40052152254ae43fee031365d0b1524aa0718b659eb75afc21a3f79ea8d62d66ea311a800109bed545bc8f79e8752319cd378eef2cbd3a09aba22'
'2dc6b0ba8f7dbf19d2446c5c5f1823587de89f4e28e9595937dd51a87755099656f2acec50e3e2546ea633ad1bfd1c722e0c2b91eef1d609103d8abdc0a7cbaf'
'd9d28e02e964704ea96645a5107f8b65cae5f4fb4f537e224e5e3d087fd296cb770c29ac76e0ce95d173bc420ea87fb8f187d616672a60a0cae618b0ef15b8c8'
'02af4dd2a007e41db0c63822c8ab3b80b5d25646af1906dc85d0ad9bb8bbf5236f8e381d7f91cf99ed4b0978c50aee37cb9567cdeef65b7ec3d91b882852b1af'
'b8fe56e14006ab866970ddbd501c054ae37186ddc065bb869cf7d18db8c0d455118d5bda3255fb66a0dde38b544655cfe9040ffe46e41d19830b47959b2fb168'
+ '98ec26b61c30f3cf15dde3547e49ffb579aea06fd0dbd7bc54df97923dcc9be8e7904b83e95b9cd03918f2431ff454339500d13d831b552738af6c411a62bef1'
+ 'SKIP'
'ccf18eb2c3d33a57871cbadd5ad825d2f2f489e69c54c7293b160abdc3e9e5c6a664ba7926a617d31affcf20b7ecb4e8de54fa78438c574aa1b257f686faade9'
'69f13bb2e353727acbe39034978729272511c6578aa2faf8c829e1bb89c22e769262289b76d93254314304ebd7547c45cdc8ba6afc278444a8fd09f71dff9757'
'47038a476ff90d7106e1ce2cf5dd3f2c356c75ab8cefc6901f8eddcbf7cd0f23c44f6ce96b2b3d57a6e3f30bdd5192cf3e75759277ab0ac6fbb179423f2431a0'
'75513d1d6dfeb6425763dc8fe8d7f607ddd11d2a8397230333a4e556b303ceb7e68bfdb26d0a10f4b557ef13adbf54c3aab00f5b493772a94b5cd87d143663c4'
'37df06631772200edc7e5a4450719155156a781e9a475383283627f6f1b8cbe94db6ba2e2fbc59107ea288846b56881b892e9b21d3d899b974fad4226c4def10'
- '73916b59fd8f269ce2831d9a0710f503b9cd1004d94caf9e061ebff870a115cc8455409040574a609473e48c60b2f0b833c907327dacb085509e615c27dd463f'
'eef5d8161edcc9817832de2000ad30320507a1e16fc321fb2b97dd2d159825b8f924cd29e5a4ffa29c339c8727f106730e6b6858c50d8afe7a5000629507badd'
'b3aad9fd9292122fd3227f05d54742731bf4d6d57aaac680b34eca19597dfb56a7f54c7ad54f37cfc2ec7f622fbd90abe7f288f11f8eb98278ab07df32cf890a')
validpgpkeys=(
@@ -102,7 +101,7 @@ case "${CARCH}" in
esac
prepare() {
- cd "${srcdir}/${_srcname}"
+ cd ${_srcname}
# add upstream patch
if [ "${_pkgbasever}" != "${_pkgver}" ]; then
@@ -126,9 +125,8 @@ prepare() {
patch -p1 -i "${srcdir}/0003-SMILE-Plug-device-tree-file.patch"
patch -p1 -i "${srcdir}/0004-fix-mvsdio-eMMC-timing.patch"
patch -p1 -i "${srcdir}/0005-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch"
- patch -p1 -i "${srcdir}/0006-ARM-TLV320AIC23-SoC-Audio-Codec-Fix-errors-reported-.patch"
- patch -p1 -i "${srcdir}/0007-set-default-cubietruck-led-triggers.patch"
- patch -p1 -i "${srcdir}/0008-exynos4412-odroid-set-higher-minimum-buck2-regulator.patch"
+ patch -p1 -i "${srcdir}/0006-set-default-cubietruck-led-triggers.patch"
+ patch -p1 -i "${srcdir}/0007-exynos4412-odroid-set-higher-minimum-buck2-regulator.patch"
fi
# add freedo as boot logo
@@ -152,7 +150,7 @@ prepare() {
# http://www.fsfla.org/pipermail/linux-libre/2015-November/003202.html
patch -p1 -i "${srcdir}/0002-fix-Atmel-maXTouch-touchscreen-support.patch"
- cat "${srcdir}/config.${CARCH}" > ./.config
+ cp -Tf ../config.${CARCH} .config
# append pkgrel to extraversion
sed -ri "s|^(EXTRAVERSION =.*\S).*|\1-${pkgrel}|" Makefile
@@ -176,7 +174,7 @@ prepare() {
}
build() {
- cd "${srcdir}/${_srcname}"
+ cd ${_srcname}
if [ "${CARCH}" = "armv7h" ]; then
make ${MAKEFLAGS} LOCALVERSION= zImage modules dtbs
@@ -196,7 +194,7 @@ _package() {
backup=("etc/mkinitcpio.d/${pkgbase}.preset")
install=linux.install
- cd "${srcdir}/${_srcname}"
+ cd ${_srcname}
# get kernel version
_kernver="$(make LOCALVERSION= kernelrelease)"
@@ -220,37 +218,39 @@ _package() {
# install mkinitcpio preset file for kernel
if [ "${CARCH}" = "armv7h" ]; then
sed "s|/boot/vmlinuz-%PKGBASE%|${_kernver}|g
- s|%PKGBASE%|${pkgbase}|g" "${srcdir}/linux.preset" |
- install -D -m644 /dev/stdin "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
+ s|%PKGBASE%|${pkgbase}|g" ../linux.preset |
+ install -Dm644 /dev/stdin "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
elif [ "${CARCH}" = "x86_64" ] || [ "${CARCH}" = "i686" ]; then
- sed "s|%PKGBASE%|${pkgbase}|g" "${srcdir}/linux.preset" |
- install -D -m644 /dev/stdin "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
+ sed "s|%PKGBASE%|${pkgbase}|g" ../linux.preset |
+ install -Dm644 /dev/stdin "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
fi
# install pacman hook for initramfs regeneration
- sed "s|%PKGBASE%|${pkgbase}|g" "${srcdir}/90-linux.hook" |
- install -D -m644 /dev/stdin "${pkgdir}/usr/share/libalpm/hooks/90-${pkgbase}.hook"
+ sed "s|%PKGBASE%|${pkgbase}|g" /90-linux.hook |
+ install -Dm644 /dev/stdin "${pkgdir}/usr/share/libalpm/hooks/99-${pkgbase}.hook"
# remove build and source links
- rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build}
+ rm "${pkgdir}"/lib/modules/${_kernver}/{source,build}
+
# remove the firmware
- rm -rf "${pkgdir}/lib/firmware"
+ rm -r "${pkgdir}/lib/firmware"
+
# make room for external modules
ln -s "../extramodules-${_basekernel}${_kernelname}" "${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}"
- echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname}/version"
+ echo "${_kernver}" |
+ install -Dm644 /dev/stdin "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname}/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/"
+ mv -t "${pkgdir}/usr" "${pkgdir}/lib"
if [ "${CARCH}" = "x86_64" ] || [ "${CARCH}" = "i686" ]; then
# add vmlinux
- install -D -m644 vmlinux "${pkgdir}/usr/lib/modules/${_kernver}/build/vmlinux"
+ install -Dm644 vmlinux "${pkgdir}/usr/lib/modules/${_kernver}/build/vmlinux"
fi
}
@@ -260,139 +260,76 @@ _package-headers() {
conflicts=("${_replacesarchkernel[@]/%/-headers}" "${_replacesoldkernels[@]/%/-headers}")
replaces=("${_replacesarchkernel[@]/%/-headers}" "${_replacesoldkernels[@]/%/-headers}")
- install -dm755 "${pkgdir}/usr/lib/modules/${_kernver}"
-
- 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"
-
- mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include"
-
- for i in acpi asm-generic config crypto drm generated keys linux math-emu \
- media net pcmcia scsi soc sound trace uapi video xen; do
- cp -a include/${i} "${pkgdir}/usr/lib/modules/${_kernver}/build/include/"
- done
-
- # copy arch includes for external modules
- mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}"
- cp -a arch/${KARCH}/include "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/"
- if [ "${CARCH}" = "armv7h" ]; then
- for i in dove exynos omap2; do
- mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/mach-${i}"
- cp -a arch/${KARCH}/mach-${i}/include "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/mach-${i}/"
- done
- for i in omap orion samsung versatile; do
- mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/plat-${i}"
- cp -a arch/${KARCH}/plat-${i}/include "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/plat-${i}/"
- done
- fi
+ cd ${_srcname}
+ local _builddir="${pkgdir}/usr/lib/modules/${_kernver}/build"
- # copy files necessary for later builds
- cp Module.symvers "${pkgdir}/usr/lib/modules/${_kernver}/build"
- cp -a scripts "${pkgdir}/usr/lib/modules/${_kernver}/build"
+ install -Dt "${_builddir}" -m644 Makefile .config Module.symvers
+ install -Dt "${_builddir}/kernel" -m644 kernel/Makefile
- # 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"
+ mkdir "${_builddir}/.tmp_versions"
- mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/kernel"
+ cp -t "${_builddir}" -a include scripts
- cp arch/${KARCH}/Makefile "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/"
+ install -Dt "${_builddir}/arch/${KARCH}" -m644 arch/${KARCH}/Makefile
+ install -Dt "${_builddir}/arch/${KARCH}/kernel" -m644 arch/${KARCH}/kernel/asm-offsets.s
- if [ "${CARCH}" = "i686" ]; then
- cp arch/${KARCH}/Makefile_32.cpu "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/"
+ if [[ ${CARCH} = i686 ]]; then
+ install -t "${_builddir}/arch/${KARCH}" -m644 arch/${KARCH}/Makefile_32.cpu
fi
- 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"
+ cp -t "${_builddir}/arch/${KARCH}" -a arch/${KARCH}/include
- # 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/"
+ install -Dt "${_builddir}/drivers/md" -m644 drivers/md/*.h
+ install -Dt "${_builddir}/net/mac80211" -m644 net/mac80211/*.h
- # 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
- 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/dvb-frontends" -m644 drivers/media/dvb-frontends/lgdt330x.h
+ 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-gnu 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}"
- done
+ find . -name Kconfig\* -exec install -Dm644 {} "${_builddir}/{}" \;
# add objtool for external module building and enabled VALIDATION_STACK option
- if [ -f tools/objtool/objtool ]; then
- mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/tools/objtool"
- cp -a tools/objtool/objtool ${pkgdir}/usr/lib/modules/${_kernver}/build/tools/objtool/
+ if [[ -e tools/objtools/objtool ]]; then
+ install -Dt "${_builddir}/tools/objtool" tools/objtool/objtool
fi
- 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
+ # remove unneeded architectures
+ local _arch
+ for _arch in "${_builddir}"/arch/*/; do
+ if [[ ${_arch} != */${KARCH}/ ]]; then
+ rm -r "${_arch}"
+ fi
done
- # remove unneeded architectures
- find "${pkgdir}"/usr/lib/modules/${_kernver}/build/arch -mindepth 1 -maxdepth 1 -type d -not -name "$KARCH" -exec rm -rf {} +
+ # remove files already in linux-docs package
+ rm -r "${_builddir}/Documentation"
+
+ # Fix permissions
+ chmod -R u=rwX,go=rX "${_builddir}"
- # remove files already in 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"
+ # 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-docs() {
@@ -401,15 +338,15 @@ _package-docs() {
conflicts=("${_replacesarchkernel[@]/%/-docs}" "${_replacesoldkernels[@]/%/-docs}")
replaces=("${_replacesarchkernel[@]/%/-docs}" "${_replacesoldkernels[@]/%/-docs}")
- cd "${srcdir}/${_srcname}"
+ cd ${_srcname}
- 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 {} \;
+ local _builddir="${pkgdir}/usr/lib/modules/${_kernver}/build"
+
+ mkdir -p "${_builddir}"
+ cp -t "${_builddir}" -a Documentation
- # remove a file already in kernel 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")