headers_install.patch 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. diff -Nur linux-3.10.30.orig/scripts/headers_install.sh linux-3.10.30/scripts/headers_install.sh
  2. --- linux-3.10.30.orig/scripts/headers_install.sh 2014-02-13 22:48:15.000000000 +0100
  3. +++ linux-3.10.30/scripts/headers_install.sh 2014-05-16 14:24:37.000000000 +0200
  4. @@ -2,7 +2,7 @@
  5. if [ $# -lt 1 ]
  6. then
  7. - echo "Usage: headers_install.sh OUTDIR [FILES...]
  8. + echo "Usage: headers_install.sh OUTDIR SRCDIR [FILES...]
  9. echo
  10. echo "Prepares kernel header files for use by user space, by removing"
  11. echo "all compiler.h definitions and #includes, removing any"
  12. @@ -10,6 +10,7 @@
  13. echo "asm/inline/volatile keywords."
  14. echo
  15. echo "OUTDIR: directory to write each userspace header FILE to."
  16. + echo "SRCDIR: source directory where files are picked."
  17. echo "FILES: list of header files to operate on."
  18. exit 1
  19. @@ -19,6 +20,8 @@
  20. OUTDIR="$1"
  21. shift
  22. +SRCDIR="$1"
  23. +shift
  24. # Iterate through files listed on command line
  25. @@ -34,7 +37,7 @@
  26. -e 's/(^|[^a-zA-Z0-9])__packed([^a-zA-Z0-9_]|$)/\1__attribute__((packed))\2/g' \
  27. -e 's/(^|[ \t(])(inline|asm|volatile)([ \t(]|$)/\1__\2__\3/g' \
  28. -e 's@#(ifndef|define|endif[ \t]*/[*])[ \t]*_UAPI@#\1 @' \
  29. - "$i" > "$OUTDIR/$FILE.sed" || exit 1
  30. + "$SRCDIR/$i" > "$OUTDIR/$FILE.sed" || exit 1
  31. scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ "$OUTDIR/$FILE.sed" \
  32. > "$OUTDIR/$FILE"
  33. [ $? -gt 1 ] && exit 1
  34. diff -Nur linux-3.10.30.orig/scripts/Makefile.headersinst linux-3.10.30/scripts/Makefile.headersinst
  35. --- linux-3.10.30.orig/scripts/Makefile.headersinst 2014-02-13 22:48:15.000000000 +0100
  36. +++ linux-3.10.30/scripts/Makefile.headersinst 2014-05-16 14:23:34.000000000 +0200
  37. @@ -47,18 +47,24 @@
  38. all-files := $(header-y) $(genhdr-y) $(wrapper-files)
  39. output-files := $(addprefix $(installdir)/, $(all-files))
  40. -input-files := $(foreach hdr, $(header-y), \
  41. +input-files1 := $(foreach hdr, $(header-y), \
  42. $(if $(wildcard $(srcdir)/$(hdr)), \
  43. - $(wildcard $(srcdir)/$(hdr)), \
  44. + $(wildcard $(srcdir)/$(hdr))) \
  45. + )
  46. +input-files1-name := $(notdir $(input-files1))
  47. +input-files2 := $(foreach hdr, $(header-y), \
  48. + $(if $(wildcard $(srcdir)/$(hdr)),, \
  49. $(if $(wildcard $(oldsrcdir)/$(hdr)), \
  50. $(wildcard $(oldsrcdir)/$(hdr)), \
  51. $(error Missing UAPI file $(srcdir)/$(hdr))) \
  52. - )) \
  53. - $(foreach hdr, $(genhdr-y), \
  54. + ))
  55. +input-files2-name := $(notdir $(input-files2))
  56. +input-files3 := $(foreach hdr, $(genhdr-y), \
  57. $(if $(wildcard $(gendir)/$(hdr)), \
  58. $(wildcard $(gendir)/$(hdr)), \
  59. $(error Missing generated UAPI file $(gendir)/$(hdr)) \
  60. ))
  61. +input-files3-name := $(notdir $(input-files3))
  62. # Work out what needs to be removed
  63. oldheaders := $(patsubst $(installdir)/%,%,$(wildcard $(installdir)/*.h))
  64. @@ -72,7 +78,9 @@
  65. quiet_cmd_install = INSTALL $(printdir) ($(words $(all-files))\
  66. file$(if $(word 2, $(all-files)),s))
  67. cmd_install = \
  68. - $(CONFIG_SHELL) $< $(installdir) $(input-files); \
  69. + $(CONFIG_SHELL) $< $(installdir) $(srcdir) $(input-files1-name); \
  70. + $(CONFIG_SHELL) $< $(installdir) $(oldsrcdir) $(input-files2-name); \
  71. + $(CONFIG_SHELL) $< $(installdir) $(gendir) $(input-files3-name); \
  72. for F in $(wrapper-files); do \
  73. echo "\#include <asm-generic/$$F>" > $(installdir)/$$F; \
  74. done; \
  75. @@ -98,7 +106,7 @@
  76. @:
  77. targets += $(install-file)
  78. -$(install-file): scripts/headers_install.sh $(input-files) FORCE
  79. +$(install-file): scripts/headers_install.sh $(input-files1) $(input-files2) $(input-files3) FORCE
  80. $(if $(unwanted),$(call cmd,remove),)
  81. $(if $(wildcard $(dir $@)),,$(shell mkdir -p $(dir $@)))
  82. $(call if_changed,install)