commit:     b418143bc1bc69f4b0c7509f74e16f9302557e4c
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Wed Mar  6 22:06:31 2019 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Wed Mar  6 22:06:31 2019 +0000
URL:        
https://gitweb.gentoo.org/proj/toolchain/linux-headers-patches.git/commit/?id=b418143b

rip-headers.sh: preserve arch/*/kernel/syscalls for all arches

Noticed by Jer as install failure:
    scripts/Makefile.build:42: arch/parisc/kernel/syscalls/Makefile: No such 
file or directory
    make[1]: *** No rule to make target 'arch/parisc/kernel/syscalls/Makefile'. 
 Stop.
    make: *** [arch/parisc/Makefile:168: archheaders] Error 2

The change generalises s390 tblgen inclusion for all arches.

Reported-by: Jeroen Roovers
Bug: https://bugs.gentoo.org/679630
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 rip-headers.sh | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/rip-headers.sh b/rip-headers.sh
index 7c37991..717405b 100755
--- a/rip-headers.sh
+++ b/rip-headers.sh
@@ -89,11 +89,16 @@ if [[ -d ${src}/arch/mips/boot/tools ]] ; then
        mkdir -p ${dst}/arch/mips/boot
        cp -r ${src}/arch/mips/boot/tools ${dst}/arch/mips/boot/
 fi
-# s390 has special sauce starting from 4.16
-if [[ -d ${src}/arch/s390/kernel/syscalls ]] ; then
-       mkdir -p ${dst}/arch/s390/kernel
-       cp -r ${src}/arch/s390/kernel/syscalls ${dst}/arch/s390/kernel/
-fi
+# linux-5.0 started generating syscall tables
+for tblgen in ${src}/arch/*/kernel/syscalls; do
+       tblgen_parent=${tblgen#${src}/}
+       tblgen_parent=${tblgen_parent%/syscalls}
+       # older kernels have none
+       if [[ -d ${tblgen} ]]; then
+               mkdir -p ${dst}/${tblgen_parent}
+               cp -r ${tblgen} ${dst}/${tblgen_parent}
+       fi
+done
 find ${dst}/ -name .gitignore -delete
 
 cp README.ripped-headers rip-headers.sh ${dst}/

Reply via email to