@@ -29,6 +29,32 @@ popd
pushd uapi
find . -type f -name '*.h' -exec cp -v "${kobj}/hdr/include/{}" {} \;
+
+go_on=true
+while $go_on; do
+ go_on=false
+ while read f; do
+ if [ "${f#asm/}" != "$f" ]; then
+ # skip architecture dependent asm/ headers
+ continue
+ fi
+ if [ -f "$f" ]; then
+ # already present
+ continue
+ fi
+ if [ ! -f "${kobj}/hdr/include/${f}" ]; then
+ # not a kernel header
+ continue
+ fi
+ echo "+ add $f"
+ go_on=true
+ mkdir -p "${f%/*}"
+ cp "${kobj}/hdr/include/${f}" "${f}"
+ done < <(
+ find . -type f -name '*.[ch]' -exec sed -nre '\_^[[:blank:]]*#include[[:blank:]]<.+>_ { s_^[[:blank:]]*#include[[:blank:]]<([^>]*)>.*$_\1_ ; p }' {} \; \
+ | LC_ALL=C sort -u
+ )
+done
popd
rm -rf "$kobj"
On multiple occasions, we had to add another uapi header copy to fix build on older system where system <linux/...> headers in /usr/include lacked recent definitions or changes. To prevent these problems, update the ethtool-import-uapi script to add all uapi headers included either from a source file or from already copied uapi header which are not present yet. Omit <asm/...> headers as those are architecture dependent so that we cannot pick one random version depending on architecture a developer runs the script on and having all versions and selecting the right one would be too complicated. Signed-off-by: Michal Kubecek <mkubecek@suse.cz> --- scripts/ethtool-import-uapi | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)