summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gentoo.org>2017-09-11 01:54:57 +0100
committerMatt Turner <mattst88@gentoo.org>2017-09-11 01:54:57 +0100
commit4dcf881dfc303eb51caf9b8c306ef0c9cd47e32d (patch)
tree0010b675292042f1522af395d4fee00652f5a576
parentFix category of net-vpn/ipsec-tools and resort list (diff)
downloadlinux-headers-patches-4dcf881dfc303eb51caf9b8c306ef0c9cd47e32d.tar.gz
linux-headers-patches-4dcf881dfc303eb51caf9b8c306ef0c9cd47e32d.tar.bz2
linux-headers-patches-4dcf881dfc303eb51caf9b8c306ef0c9cd47e32d.zip
Update rip-headers.sh to handle kernels >= 4.12
Upstream kernel commit fcc8487d477a3452a1d0ccbdd4c5e0e1e3cb8bed ("uapi: export all headers under uapi directories") removed include/Kbuild and the Kbuild files from most directories within include/, thus breaking rip-headers.sh. I have modified rip-headers.sh to simply rip all of include/ if it cannot find the Kbuild files. This increase the size of gentoo-headers-base-*.tar.xz from ~4M to ~8M, but that's still significantly better than the size of the whole kernel.
-rwxr-xr-xrip-headers.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/rip-headers.sh b/rip-headers.sh
index 17812ed..74577d5 100755
--- a/rip-headers.sh
+++ b/rip-headers.sh
@@ -28,8 +28,13 @@ rm -rf ${dst}
mkdir ${dst}
cp ${src}/Makefile ${dst}/
mkdir ${dst}/include
-cp ${src}/include/Kbuild ${dst}/include/
-cp -r $(find ${src}/include -mindepth 2 -maxdepth 2 -name 'Kbuild*' -printf %h' ') ${dst}/include/
+[ -f ${src}/include/Kbuild ] && cp ${src}/include/Kbuild ${dst}/include/
+directories=$(find ${src}/include -mindepth 2 -maxdepth 2 -name 'Kbuild*' -printf %h' ')
+if [ -n "${directories}" ] ; then
+ cp -r ${directories} ${dst}/include/
+else
+ cp -r ${src}/include/* ${dst}/include
+fi
mkdir ${dst}/scripts
cp -r \
${src}/scripts/{Makefile,Kbuild}* \