The Python scripts that OP-TEE 4.6.0's core build runs, in Crystal, so OP-TEE builds in the BQ2 seed without Python. Each subcommand is one script, and takes the same arguments:
| Subcommand | Replaces | Makes |
|---|---|---|
arm32_sysreg |
scripts/arm32_sysreg.py |
ARMv7 system-register accessors (C or assembler) |
pem_to_pub_c |
scripts/pem_to_pub_c.py |
the TA signing key's modulus and exponent as C |
gen_ldelf_hex |
scripts/gen_ldelf_hex.py |
ldelf's load segments as a C array |
gen_ld_sects |
scripts/gen_ld_sects.py |
linker-script input sections from readelf -S -W |
gen_tee_bin |
scripts/gen_tee_bin.py |
tee.bin, tee-raw.bin, and the v2 tee-header, tee-pager and tee-pageable images |
bsp/beagley-ai/patches/optee_os/0001-build-run-the-core-build-helpers-with-cleave-optee.patch
makes OP-TEE call $(CLEAVE_OPTEE) <name> where it called $(PYTHON3) scripts/<name>.py.
The default is CLEAVE_OPTEE ?= cleave-optee. The scripts for early TAs, secure partitions,
embedded DTBs and mem_usage are untouched, because the BeagleY-AI build uses none of them.
ELF files are read by src/cleave/elf.cr, little-endian ELF32 and ELF64.
Checked
- Fixtures.
spec/optee_spec.crcompares every subcommand with the real scripts' output. It uses a tiny AArch64 ELF (tiny.S) forgen_tee_binandgen_ldelf_hex. - The k3-am62x build. On a full
PLATFORM=k3-am62x CFG_ARM64_core=y COMPILER=clangbuild of 4.6.0, all 15 generated files are identical to the Python ones: the five boot images,ldelf_hex.c,ta_pub_key.c, the fourarm32_*sysreg.{h,S}, and the four*.ld.S. - No Python. The patched tree builds with
PYTHON3=/bin/false. The images then differ from the earlier build only in the 5 bytes of OP-TEE's build timestamp.