Skip to content

Commit 6224455

Browse files
committed
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>
1 parent 609488b commit 6224455

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

scripts/headers_install.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ TMPFILE=$OUTFILE.tmp
2323

2424
trap 'rm -f $OUTFILE $TMPFILE' EXIT
2525

26+
# SPDX-License-Identifier with GPL variants must have "WITH Linux-syscall-note"
27+
if [ -n "$(sed -n -e "/SPDX-License-Identifier:.*GPL-/{/WITH Linux-syscall-note/!p}" $INFILE)" ]; then
28+
echo "error: $INFILE: missing \"WITH Linux-syscall-note\" for SPDX-License-Identifier" >&2
29+
exit 1
30+
fi
31+
2632
sed -E -e '
2733
s/([[:space:](])(__user|__force|__iomem)[[:space:]]/\1/g
2834
s/__attribute_const__([[:space:]]|$)/\1/g

0 commit comments

Comments
 (0)