From 06446dda2c8081861ced5c546f30cff515928320 Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 23 Jan 2017 10:19:13 -0700 Subject: [PATCH] scripts: Allow image version number Add an --image-version argument to zep2newt.py to allow the major version number to be set. This helps make testing easier by having differing version numbers. --- scripts/zep2newt.py | 5 ++++- sign.sh | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/zep2newt.py b/scripts/zep2newt.py index 1b464650..e9904f86 100755 --- a/scripts/zep2newt.py +++ b/scripts/zep2newt.py @@ -63,6 +63,9 @@ def get_args(): parser.add_argument('-f', required=False, action="store_true", \ default=False, \ help='Flash using JLinkExe') + parser.add_argument('--image-version', dest='image_version', + default=1, + help='Major part of version number') return parser.parse_args() @@ -189,7 +192,7 @@ class Convert(): self.vtable_offs, image_size, sig.get_flags(), - 1, 0, 0, 0) + int(self.args.image_version), 0, 0, 0) return hd def add_trailer(self, pad): diff --git a/sign.sh b/sign.sh index 269032d8..6fe08f51 100755 --- a/sign.sh +++ b/sign.sh @@ -9,6 +9,7 @@ source $(dirname $0)/target.sh --out shell.signed.bin \ --vtoff 0x200 \ --word-size 8 \ + --image-version 3 \ --bit --pad 0x20000 ./scripts/zep2newt.py \ @@ -17,4 +18,5 @@ source $(dirname $0)/target.sh --sig RSA \ --vtoff 0x200 \ --word-size 8 \ + --image-version 2 \ --out hello.signed.bin