summaryrefslogtreecommitdiff
path: root/fw/sign.sh
diff options
context:
space:
mode:
Diffstat (limited to 'fw/sign.sh')
-rwxr-xr-xfw/sign.sh15
1 files changed, 12 insertions, 3 deletions
diff --git a/fw/sign.sh b/fw/sign.sh
index 343a038..2ae31bb 100755
--- a/fw/sign.sh
+++ b/fw/sign.sh
@@ -12,15 +12,24 @@ set -euf
ROOT="$(dirname "$0")"
MCUBOOT="${ROOT}/zephyrproject/bootloader/mcuboot"
IMGTOOL="${MCUBOOT}/scripts/imgtool.py"
-KEY="${MCUBOOT}/root-rsa-2048.pem"
INPUT="${ROOT}/../build/fw/zephyr/zephyr.bin"
OUTPUT="${INPUT}.signed"
+if test $# -ne 1
+then
+ echo "Please provide the path to the MCUboot signing key as single argument."
+ exit 1
+fi
+
+key="$1"
+
python $IMGTOOL sign \
--version 0.0.0 \
--header-size 0x200 \
--slot-size 0xc0000 \
- --key "${KEY}" \
+ --key "${key}" \
"${INPUT}" \
- "${OUTPUT}"
+ "${OUTPUT}" > /dev/null
+
+echo "Signed application firmware: ${OUTPUT}"