Skip to content

image: add a stage pre-load

Philippe Reynes u-boot 8 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest15 patches 15 repliesIn review
  2. v716 patches 4 repliesSuperseded
  3. v616 patches 13 repliesSuperseded
Earlier versions · 5
VersionPostedPatchesRepliesStatus
v516 patches7 repliesSuperseded
v418 patches2 repliesSuperseded
v3 RFC8 patches16 repliesSuperseded
v2 RFC6 patches0 repliesSuperseded
v1 RFC2 patches0 repliesSuperseded

Changes in v8 from the cover letter

- remove command pre_load_verify
- add subcommand preload to bootm
- add stage pre_load in "bootm start"
- use PYTHONPATH to use binman in py test vboot v7:
- rename command verify to pre_load_verify
- add usage doc for command pre_load_verify
- some cleanup in support of pre-load in binman
- rename variable key-path to pre-load-key-path
- some cleanup in test vboot for pre-load

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15arch: Kconfig: imply BINMAN for SANDBOXarch/Kconfig arch/sandbox/dts/sandbox.dtsi arch/sandbox/dts/test.dts +2 more+13 -01 reply
2/15lib: Kconfig: enhance help for ASN1lib/Kconfig+13 -11 reply
3/15lib: Kconfig: enhance the help of OID_REGISTRYlib/Kconfig+4 -01 reply
4/15lib: allow to build asn1 decoder and oid registry in SPLlib/Kconfig lib/Makefile+21 -21 reply
5/15lib: crypto: allow to build crypyo in SPLlib/Makefile lib/crypto/Kconfig lib/crypto/Makefile+44 -71 reply
6/15lib: rsa: allow rsa verify with pkey in SPLlib/rsa/Kconfig+19 -01 reply
7/15boot: image: add a stage pre-loadboot/Kconfig boot/Makefile boot/image-pre-load.c +1 more+486 -01 reply
8/15cmd: bootm: add a stage pre-loadboot/bootm.c cmd/Kconfig cmd/bootm.c +1 more+47 -21 reply
9/15common: spl: fit_ram: allow to use image pre loadcommon/spl/spl_ram.c+20 -11 reply
10/15mkimage: add public key for image pre-load stageinclude/image.h tools/fit_image.c tools/image-host.c+132 -01 reply
11/15Makefile: provide sah-key to binmanMakefile+1 -01 reply
12/15tools: binman: add support for pre-load headertools/binman/entries.rst tools/binman/etype/pre_load.py tools/binman/ftest.py +8 more+439 -01 reply
13/15configs: sandbox_defconfig: enable stage pre-load in bootmconfigs/sandbox_defconfig+3 -01 reply
14/15test: py: vboot: add test for global image signaturetest/py/tests/test_vboot.py test/py/tests/vboot/sandbox-binman-pss.dts test/py/tests/vboot/sandbox-binman.dts +3 more+272 -161 reply
15/15cmd: bootm: add subcommand preloadcmd/bootm.c+30 -01 reply

Reviews trailers per patch

12 of 15 patches have a Reviewed-by or Acked-by.

PatchSimon Glass
1/15R-b
2/15R-b
3/15R-b
4/15R-b
5/15R-b
6/15R-b
7/15
8/15R-b
9/15R-b
10/15R-b
11/15R-b
12/15R-b
13/15R-b
14/15
15/15

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v8 thread

Cover letter [PATCH v8 00/15] image: add a stage pre-load

This serie adds a stage pre-load before launching an image. This stage is used to read a header before the image and this header contains the signature of the full image. So u-boot may check the full image before using any data of the image.

The support of this header is added to binman, and a command verify checks the signature of a blob and set the u-boot env variable "loadaddr_verified" to the beginning of the "real" image.

The support of this header is only added to binman, but it may also be added to mkimage.

Changelog:
v8:
- remove command pre_load_verify
- add subcommand preload to bootm
- add stage pre_load in "bootm start"
- use PYTHONPATH to use binman in py test vboot v7:
- rename command verify to pre_load_verify
- add usage doc for command pre_load_verify
- some cleanup in support of pre-load in binman
- rename variable key-path to pre-load-key-path
- some cleanup in test vboot for pre-load
v6:
- set values in big endian in the pre-load header
- binman: etypes: pre-load: read image from other entry instead of directly from a file
- binman: etypes: pre-load: add test unit
- lib: Makefile: no longer add -I$(obj) for SPL
It was to fix build when oid is built on spl but not on u-boot. It is not longer possible.
v5:
- replace config SANDBOX_BINMAN by an imply
v4:
- add a config SANDBOX_BIN
- enhance help for asn1 and oid
- change the format of the pre-load header
- add the support of pre-load header in binman
- add py test for pre-load header
- add a command verify
v3:
- move image-pre-load.c to /boot
- update mkimage to add public key in u-boot device tree
- add script gen_pre_load_header.sh
v2:
- move the code to image-pre-load
- add support of stage pre-load for spl
- add support of stage pre-load on spl_ram

Philippe Reynes (15):
arch: Kconfig: imply BINMAN for SANDBOX
lib: Kconfig: enhance help for ASN1
lib: Kconfig: enhance the help of OID_REGISTRY
lib: allow to build asn1 decoder and oid registry in SPL
lib: crypto: allow to build crypyo in SPL
lib: rsa: allow rsa verify with pkey in SPL
boot: image: add a stage pre-load
cmd: bootm: add a stage pre-load
common: spl: fit_ram: allow to use image pre load
mkimage: add public key for image pre-load stage
Makefile: provide sah-key to binman
tools: binman: add support for pre-load header
configs: sandbox_defconfig: enable stage pre-load in bootm
test: py: vboot: add test for global image signature
cmd: bootm: add subcommand preload

 Makefile                                      |   1 +
 arch/Kconfig                                  |   1 +
 arch/sandbox/dts/sandbox.dtsi                 |   3 +
 arch/sandbox/dts/test.dts                     |   3 +
 boot/Kconfig                                  |  55 +++
 boot/Makefile                                 |   1 +
 boot/bootm.c                                  |  33 ++
 boot/image-pre-load.c                         | 416 ++++++++++++++++++
 cmd/Kconfig                                   |  10 +
 cmd/bootm.c                                   |  35 +-
 common/spl/spl_ram.c                          |  21 +-
 configs/sandbox_defconfig                     |   3 +
 include/image.h                               |  30 ++
 lib/Kconfig                                   |  37 +-
 lib/Makefile                                  |   7 +-
 lib/crypto/Kconfig                            |  29 ++
 lib/crypto/Makefile                           |  19 +-
 lib/rsa/Kconfig                               |  19 +
 test/py/tests/test_fit.py                     |   3 +
 test/py/tests/test_vboot.py                   | 148 ++++++-
 test/py/tests/vboot/sandbox-binman-pss.dts    |  25 ++
 test/py/tests/vboot/sandbox-binman.dts        |  24 +
 .../tests/vboot/sandbox-u-boot-global-pss.dts |  28 ++
 test/py/tests/vboot/sandbox-u-boot-global.dts |  27 ++
 test/py/tests/vboot/sandbox-u-boot.dts        |   3 +
 test/py/tests/vboot/simple-images.its         |  36 ++
 tools/binman/entries.rst                      |  38 ++
 tools/binman/etype/pre_load.py                | 162 +++++++
 tools/binman/ftest.py                         |  51 +++
 tools/binman/test/225_dev.key                 |  28 ++
 tools/binman/test/225_pre_load.dts            |  22 +
 tools/binman/test/226_pre_load_pkcs.dts       |  23 +
 tools/binman/test/227_pre_load_pss.dts        |  23 +
 .../test/228_pre_load_invalid_padding.dts     |  23 +
 .../binman/test/229_pre_load_invalid_sha.dts  |  23 +
 .../binman/test/230_pre_load_invalid_algo.dts |  23 +
 .../binman/test/231_pre_load_invalid_key.dts  |  23 +
 tools/fit_image.c                             |   3 +
 tools/image-host.c                            | 114 +++++
 39 files changed, 1544 insertions(+), 29 deletions(-)
 create mode 100644 boot/image-pre-load.c
 create mode 100644 test/py/tests/vboot/sandbox-binman-pss.dts
 create mode 100644 test/py/tests/vboot/sandbox-binman.dts
 create mode 100644 test/py/tests/vboot/sandbox-u-boot-global-pss.dts
 create mode 100644 test/py/tests/vboot/sandbox-u-boot-global.dts
 create mode 100644 test/py/tests/vboot/simple-images.its
 create mode 100644 tools/binman/etype/pre_load.py
 create mode 100644 tools/binman/test/225_dev.key
 create mode 100644 tools/binman/test/225_pre_load.dts
 create mode 100644 tools/binman/test/226_pre_load_pkcs.dts
 create mode 100644 tools/binman/test/227_pre_load_pss.dts
 create mode 100644 tools/binman/test/228_pre_load_invalid_padding.dts
 create mode 100644 tools/binman/test/229_pre_load_invalid_sha.dts
 create mode 100644 tools/binman/test/230_pre_load_invalid_algo.dts
 create mode 100644 tools/binman/test/231_pre_load_invalid_key.dts
Signature · 1 line
2.25.1