diff options
author | Masahiro Yamada | 2019-07-25 10:05:13 +0200 |
---|---|---|
committer | Masahiro Yamada | 2019-07-29 03:05:41 +0200 |
commit | 622445541b751ce70a952b8486ce4512a792c0a2 (patch) | |
tree | a950578c6f212af0edb8f8d365a517b6c653821c /scripts | |
parent | Linux 5.3-rc2 (diff) | |
download | kernel-qcow2-linux-622445541b751ce70a952b8486ce4512a792c0a2.tar.gz kernel-qcow2-linux-622445541b751ce70a952b8486ce4512a792c0a2.tar.xz kernel-qcow2-linux-622445541b751ce70a952b8486ce4512a792c0a2.zip |
kbuild: detect missing "WITH Linux-syscall-note" for uapi headers
UAPI headers licensed under GPL are supposed to have exception
"WITH Linux-syscall-note" so that they can be included into non-GPL
user space application code.
Unfortunately, people often miss to add it. Break 'make headers'
when any of exported headers lacks the exception note so that the
0-day bot can easily catch it.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/headers_install.sh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/headers_install.sh b/scripts/headers_install.sh index 47f6f3ea0771..bbaf29386995 100755 --- a/scripts/headers_install.sh +++ b/scripts/headers_install.sh @@ -23,6 +23,12 @@ TMPFILE=$OUTFILE.tmp trap 'rm -f $OUTFILE $TMPFILE' EXIT +# SPDX-License-Identifier with GPL variants must have "WITH Linux-syscall-note" +if [ -n "$(sed -n -e "/SPDX-License-Identifier:.*GPL-/{/WITH Linux-syscall-note/!p}" $INFILE)" ]; then + echo "error: $INFILE: missing \"WITH Linux-syscall-note\" for SPDX-License-Identifier" >&2 + exit 1 +fi + sed -E -e ' s/([[:space:](])(__user|__force|__iomem)[[:space:]]/\1/g s/__attribute_const__([[:space:]]|$)/\1/g |