scripts: Add SPDX headers
Add SPDX headers indicating the Apache-2.0 license to the scripts in the
scripts directory. This can be assumed due to the presence of the
Apache-2.0 LICENSE file at the top of the project.
Fixes #930
Signed-off-by: David Brown <david.brown@linaro.org>
diff --git a/scripts/assemble.py b/scripts/assemble.py
index 1eedb67..5ef403f 100755
--- a/scripts/assemble.py
+++ b/scripts/assemble.py
@@ -2,6 +2,8 @@
#
# Copyright 2017 Linaro Limited
#
+# SPDX-License-Identifier: Apache-2.0
+#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
diff --git a/scripts/flash.sh b/scripts/flash.sh
index a2c58c7..7cb5bdb 100755
--- a/scripts/flash.sh
+++ b/scripts/flash.sh
@@ -1,4 +1,6 @@
#! /bin/bash
+#
+# SPDX-License-Identifier: Apache-2.0
source $(dirname $0)/../target.sh
diff --git a/scripts/gdb-boot.sh b/scripts/gdb-boot.sh
index dd8a34d..60c3861 100755
--- a/scripts/gdb-boot.sh
+++ b/scripts/gdb-boot.sh
@@ -1,4 +1,6 @@
#! /bin/bash
+#
+# SPDX-License-Identifier: Apache-2.0
source $(dirname $0)/../target.sh
diff --git a/scripts/imgtool.nix b/scripts/imgtool.nix
index 7d750df..9ac41bc 100644
--- a/scripts/imgtool.nix
+++ b/scripts/imgtool.nix
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: Apache-2.0
#
# Nix environment for imgtool
#
diff --git a/scripts/imgtool.py b/scripts/imgtool.py
index 7861474..e29e224 100755
--- a/scripts/imgtool.py
+++ b/scripts/imgtool.py
@@ -2,6 +2,8 @@
#
# Copyright 2017 Linaro Limited
#
+# SPDX-License-Identifier: Apache-2.0
+#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
diff --git a/scripts/imgtool/__init__.py b/scripts/imgtool/__init__.py
index 73ea839..5d7d181 100644
--- a/scripts/imgtool/__init__.py
+++ b/scripts/imgtool/__init__.py
@@ -1,5 +1,7 @@
# Copyright 2017-2020 Linaro Limited
#
+# SPDX-License-Identifier: Apache-2.0
+#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
diff --git a/scripts/imgtool/boot_record.py b/scripts/imgtool/boot_record.py
index 4112b22..ac433aa 100644
--- a/scripts/imgtool/boot_record.py
+++ b/scripts/imgtool/boot_record.py
@@ -1,6 +1,8 @@
# Copyright (c) 2019, Arm Limited.
# Copyright (c) 2020, Linaro Limited
#
+# SPDX-License-Identifier: Apache-2.0
+#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
diff --git a/scripts/imgtool/image.py b/scripts/imgtool/image.py
index cb212c8..5030bb4 100644
--- a/scripts/imgtool/image.py
+++ b/scripts/imgtool/image.py
@@ -2,6 +2,8 @@
# Copyright 2017-2020 Linaro Limited
# Copyright 2019-2020 Arm Limited
#
+# SPDX-License-Identifier: Apache-2.0
+#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
diff --git a/scripts/imgtool/keys/__init__.py b/scripts/imgtool/keys/__init__.py
index af6caff..dfd101d 100644
--- a/scripts/imgtool/keys/__init__.py
+++ b/scripts/imgtool/keys/__init__.py
@@ -1,5 +1,7 @@
# Copyright 2017 Linaro Limited
#
+# SPDX-License-Identifier: Apache-2.0
+#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
diff --git a/scripts/imgtool/keys/ecdsa.py b/scripts/imgtool/keys/ecdsa.py
index 81aa321..e45492b 100644
--- a/scripts/imgtool/keys/ecdsa.py
+++ b/scripts/imgtool/keys/ecdsa.py
@@ -2,6 +2,8 @@
ECDSA key management
"""
+# SPDX-License-Identifier: Apache-2.0
+
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import ec
diff --git a/scripts/imgtool/keys/ecdsa_test.py b/scripts/imgtool/keys/ecdsa_test.py
index 31fe085..65b709f 100644
--- a/scripts/imgtool/keys/ecdsa_test.py
+++ b/scripts/imgtool/keys/ecdsa_test.py
@@ -2,6 +2,8 @@
Tests for ECDSA keys
"""
+# SPDX-License-Identifier: Apache-2.0
+
import io
import os.path
import sys
diff --git a/scripts/imgtool/keys/ed25519.py b/scripts/imgtool/keys/ed25519.py
index f20c5dc..b6367e7 100644
--- a/scripts/imgtool/keys/ed25519.py
+++ b/scripts/imgtool/keys/ed25519.py
@@ -2,6 +2,8 @@
ED25519 key management
"""
+# SPDX-License-Identifier: Apache-2.0
+
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import ed25519
diff --git a/scripts/imgtool/keys/ed25519_test.py b/scripts/imgtool/keys/ed25519_test.py
index 31f43fe..ef6ebd0 100644
--- a/scripts/imgtool/keys/ed25519_test.py
+++ b/scripts/imgtool/keys/ed25519_test.py
@@ -2,6 +2,8 @@
Tests for ECDSA keys
"""
+# SPDX-License-Identifier: Apache-2.0
+
import hashlib
import io
import os.path
diff --git a/scripts/imgtool/keys/general.py b/scripts/imgtool/keys/general.py
index f6b8a09..e8755f6 100644
--- a/scripts/imgtool/keys/general.py
+++ b/scripts/imgtool/keys/general.py
@@ -1,5 +1,7 @@
"""General key class."""
+# SPDX-License-Identifier: Apache-2.0
+
import sys
AUTOGEN_MESSAGE = "/* Autogenerated by imgtool.py, do not edit. */"
diff --git a/scripts/imgtool/keys/rsa.py b/scripts/imgtool/keys/rsa.py
index 85c0342..d8543ed 100644
--- a/scripts/imgtool/keys/rsa.py
+++ b/scripts/imgtool/keys/rsa.py
@@ -2,6 +2,8 @@
RSA Key management
"""
+# SPDX-License-Identifier: Apache-2.0
+
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import rsa
diff --git a/scripts/imgtool/keys/rsa_test.py b/scripts/imgtool/keys/rsa_test.py
index b0afa83..4b2106a 100644
--- a/scripts/imgtool/keys/rsa_test.py
+++ b/scripts/imgtool/keys/rsa_test.py
@@ -2,6 +2,8 @@
Tests for RSA keys
"""
+# SPDX-License-Identifier: Apache-2.0
+
import io
import os
import sys
diff --git a/scripts/imgtool/keys/x25519.py b/scripts/imgtool/keys/x25519.py
index adb68a1..a31cb3f 100644
--- a/scripts/imgtool/keys/x25519.py
+++ b/scripts/imgtool/keys/x25519.py
@@ -2,6 +2,8 @@
X25519 key management
"""
+# SPDX-License-Identifier: Apache-2.0
+
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import x25519
diff --git a/scripts/imgtool/main.py b/scripts/imgtool/main.py
index 674063a..6188e78 100755
--- a/scripts/imgtool/main.py
+++ b/scripts/imgtool/main.py
@@ -3,6 +3,8 @@
# Copyright 2017-2020 Linaro Limited
# Copyright 2019-2020 Arm Limited
#
+# SPDX-License-Identifier: Apache-2.0
+#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
diff --git a/scripts/imgtool/version.py b/scripts/imgtool/version.py
index 8910e0b..6e38f44 100644
--- a/scripts/imgtool/version.py
+++ b/scripts/imgtool/version.py
@@ -1,5 +1,7 @@
# Copyright 2017 Linaro Limited
#
+# SPDX-License-Identifier: Apache-2.0
+#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
diff --git a/scripts/jgdb.sh b/scripts/jgdb.sh
index a79c87c..dc59020 100755
--- a/scripts/jgdb.sh
+++ b/scripts/jgdb.sh
@@ -1,4 +1,6 @@
#! /bin/bash
+#
+# SPDX-License-Identifier: Apache-2.0
source $(dirname $0)/../target.sh
diff --git a/scripts/jl.sh b/scripts/jl.sh
index 260206d..abc6dab 100755
--- a/scripts/jl.sh
+++ b/scripts/jl.sh
@@ -1,4 +1,6 @@
#!/bin/bash
+#
+# SPDX-License-Identifier: Apache-2.0
source $(dirname $0)/../target.sh
diff --git a/scripts/setup.py b/scripts/setup.py
index b567a9a..a228ea3 100644
--- a/scripts/setup.py
+++ b/scripts/setup.py
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: Apache-2.0
+
import setuptools
from imgtool import imgtool_version