conf/imx_hab4: clean up scripts and extra SPL templates#55
conf/imx_hab4: clean up scripts and extra SPL templates#55ricardosalveti merged 1 commit intofoundriesio:masterfrom
Conversation
|
Ugh, the script requires mkimage be installed. I might need to add a check to make sure it's in the path when it runs. |
|
CRAP posted this against master |
8d17ebb to
9babf92
Compare
9babf92 to
532f243
Compare
75e42cd to
e27fc1a
Compare
|
Mind rebasing against master? |
| echo " --cst: set cst binary path/filename [default: ${CST_BINARY}]" | ||
| echo " --csf-template: set CSF template file [default: ${CSF_TEMPLATE}]" | ||
| echo " --spl: SPL binary to sign [required]" | ||
| echo " --m4app: M4 binary to sign [required]" |
There was a problem hiding this comment.
Is m4app required or optional?
There was a problem hiding this comment.
Has to have either --spl or --m4app to specify binary
There was a problem hiding this comment.
Maybe change usage to say one or other required? Both with [required] is confusing.
| if [ "${SIGN_M4APP}" == "1" ]; then | ||
| BINARY_LEN=$(od -An -t x4 -j 0x1024 -N 0x4 ${WORK_FILE}.mod | cut -d' ' -f2) | ||
| BINARY_LEN=$(printf "%08x" $(((0x${BINARY_LEN} / 0x1000 + 1) * 0x1000))) | ||
| objcopy -I binary -O binary --pad-to 0x${BINARY_LEN} --gap-fill=0x5A ${WORK_FILE}.mod ${WORK_FILE}.mod |
There was a problem hiding this comment.
While objcopy and other tools are commonly available, it is probably a good idea to use 'set -e' as part of this script, in case one of the tools are not available at the host side.
There was a problem hiding this comment.
Good catch will add that.
e27fc1a to
89b4ef6
Compare
|
@ricardosalveti rebased |
- rename sign-spl.sh -> sign-file.sh
- new usage of sign-file.sh is:
--cst <cst path/filename> (default: cst)
--spl <spl binary to sign>
--m4app <M4 binary to sign>
--csf-template <template file to use> (default: u-boot-spl-sign.csf-template)
--key-dir <directory where keys are located> (default: .)
--fix-sdp-dcd (default: no)
- remove mfgtools csf template
- remove hard-coded block data from std template
- support M4 signing logic
NOTES:
- script will copy the original binary as *.mod
if needed: modify it for: DCD handling, CSF address injection, etc.
Make sure we don't touch original binary
- template is turned into *.csf-config
- translates @@KEY_ROOT@@ into --key-dir setting
- uses "od" to get the DCD/HAB block information
and appends this to the config
- for DCD handling: uses the 0x20 header offset as the first block hex
(0x2f010000) as mkimage currently has a bug.
- cleans up copied files at the end
Change-Id: Ie7d930040c746991388832fa7d749bf3632e4a0b
Signed-off-by: Michael Scott <[email protected]>
89b4ef6 to
5280824
Compare
|
ci-retest |
ricardosalveti
left a comment
There was a problem hiding this comment.
Looks better, let's get this in and improve if needed.
Relevant changes: - 7935897 Merge pull request foundriesio#55 from quaresmajose/bbfatal_log - 3e7c55c image_types_ostree: use bbfatal_log when do_image_garagesign fails - ee7322c Merge pull request foundriesio#53 from quaresmajose/errcode - dd129dc image_types_ostree: show the errorcode on the push failed warning - 0207f86 Merge pull request foundriesio#50 from mdfr74/kirkstone - a2d9042 Fix typos created by 6159909 Signed-off-by: Ricardo Salveti <[email protected]>
Relevant changes: - 7935897 Merge pull request #55 from quaresmajose/bbfatal_log - 3e7c55c image_types_ostree: use bbfatal_log when do_image_garagesign fails - ee7322c Merge pull request #53 from quaresmajose/errcode - dd129dc image_types_ostree: show the errorcode on the push failed warning - 0207f86 Merge pull request #50 from mdfr74/kirkstone - a2d9042 Fix typos created by 6159909 Signed-off-by: Ricardo Salveti <[email protected]>
Relevant changes: - 7935897 Merge pull request #55 from quaresmajose/bbfatal_log - 3e7c55c image_types_ostree: use bbfatal_log when do_image_garagesign fails - ee7322c Merge pull request #53 from quaresmajose/errcode - dd129dc image_types_ostree: show the errorcode on the push failed warning - 0207f86 Merge pull request #50 from mdfr74/kirkstone - a2d9042 Fix typos created by 6159909 Signed-off-by: Ricardo Salveti <[email protected]>
conf/imx_hab4: clean up scripts and extra SPL templates
--cst <cst path/filename> (default: cst)
--spl
--m4app
--csf-template (default: u-boot-spl-sign.csf-template)
--key-dir (default: .)
--fix-sdp-dcd (default: no)
NOTES:
if needed: modify it for: DCD handling, CSF address injection, etc.
Make sure we don't touch original binary
and appends this to the config
(0x2f010000) as mkimage currently has a bug.
Signed-off-by: Michael Scott [email protected]