aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2018-05-25 13:42:46 +0100
committerPeter Maydell <peter.maydell@linaro.org>2018-05-25 14:08:39 +0100
commit5372d969fd0b16c3ecd227b663c0f808ebc08e3f (patch)
treef8698d2c7e5c50428bec1ad1de27a314025a9d41
parent080612c6ed099a458c1734727cbcb97b81b2d529 (diff)
downloadqemu-arm-5372d969fd0b16c3ecd227b663c0f808ebc08e3f.tar.gz
scripts/update-linux-headers: Handle kernel license no longer being one file
The kernel has changed its license documentation, so instead of COPYING being a stand-alone file that defines the license, it refers to various other files under LICENSES/. This means we need to copy not just COPYING but also these other files to our copy of the kernel headers. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> --- We could copy the whole of LICENSES/ but that seems like overkill.
-rwxr-xr-xscripts/update-linux-headers.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh
index 1fe54f8ab1..feb75390aa 100755
--- a/scripts/update-linux-headers.sh
+++ b/scripts/update-linux-headers.sh
@@ -142,6 +142,20 @@ else
cp "$linux/COPYING" "$output/linux-headers"
fi
+# Recent kernel sources split the copyright/license info into multiple
+# files, which we need to copy. This set of licenses is the set that
+# are referred to by SPDX lines in the headers we currently copy.
+# We don't copy the Documentation/process/license-rules.rst which
+# is also referred to by COPYING, since it's explanatory rather than license.
+if [ -d "$linux/LICENSES" ]; then
+ mkdir -p "$output/linux-headers/LICENSES/preferred" \
+ "$output/linux-headers/LICENSES/exceptions"
+ for l in preferred/GPL-2.0 preferred/BSD-2-Clause preferred/BSD-3-Clause \
+ exceptions/Linux-syscall-note; do
+ cp "$linux/LICENSES/$l" "$output/linux-headers/LICENSES/$l"
+ done
+fi
+
cat <<EOF >$output/linux-headers/linux/virtio_config.h
#include "standard-headers/linux/virtio_config.h"
EOF