Skip to content

make-boot-image: --payload packs an existing SWEETXNU payload as it is - #380

Merged
claudiusthebot merged 1 commit into
mainfrom
agent/scion-loader-test/pack
Nov 18, 2026
Merged

claudiusthebot merged 1 commit into
mainfrom
agent/scion-loader-test/pack

Conversation

@claudiusthebot

Copy link
Copy Markdown
Collaborator

Follow-up to #370 (--loader-kind scion, merged). The scion loader's first phone test wants the loader around exactly the payload that boots today. make-boot-image.sh could not do that: it always makes a new payload from the kernel and the donor ADT and adds sweetepoch=<now> to the line, so the payload's bytes and its line change with every run.

  • make-boot-image.sh --payload P skips the payload-making steps (and the firmware, camera, canvas and inject steps that only shape a new payload) and packs P unchanged; --template is still required. The payload's line is not printed, only its length and SHA-256. Without --payload the script is unchanged.
  • starlte-pack-boot.py payload BOOTIMG OUT takes the payload out of an sboot image (the one SWEETXNU at a 4 KiB offset of the kernel slot, to the slot's end, as packed).
  • docs/ios27/SCION-LOADER.md: how, and why the loader should be built with LDR_OS_TOKENS=0 (Scion-Project/scion-boot-exynos9810, draft PR) for a boot identical to sboot's.

Used on 18 November to make the first scion-loader test image from iOS 27.2.1's BOOT image: the payload, kernel segments, ADT, line, Android header and DTBH of the result are byte-identical to the source's (checked by hashes). Checked locally: bash -n, py_compile, tools/provenance-check.py, tools/provenance-test.py. Not run on a phone yet.

Separate finding, not fixed here: the kernel's built-in arguments share the 1024-byte line with the loader's (starlte_bootargs_defaults), and today's line is at 1018 of 1024: any 6 more bytes on a loader line start dropping the last built-ins (cam_switch, sgu_irq, decmpfs_lz4, sweetatpath first).

🤖 Generated with Claude Code

The scion loader's first phone test wants the loader around exactly the payload
that boots today. make-boot-image.sh could not do that: it always makes a new
payload from the kernel and the donor ADT, and adds sweetepoch=<now> to the
line, so the payload's bytes and its line changed with every run.

--payload P skips those steps (and the firmware, camera, canvas and inject
steps that only shape a new payload) and packs P unchanged; the template is
still required. Its line is not printed: the script prints only its length
and SHA-256. starlte-pack-boot.py payload BOOTIMG OUT takes the payload out of
an sboot image (the one SWEETXNU at a 4 KiB offset of the kernel slot, to the
slot's end, as packed). docs/ios27/SCION-LOADER.md says how, and why the loader
should be built with LDR_OS_TOKENS=0 for a boot identical to sboot's (the
54 bytes of scion_ldr= and scion_guard= push the kernel's last built-in
arguments out of its 1024-byte line).

Used on 18 November to make the first scion-loader test image from iOS 27.2.1's
BOOT image: the payload, kernel segments, ADT, line, Android header and DTBH of
the result are byte-identical to the source image's. Without --payload the
script is unchanged. Not run on a phone yet.
@claudiusthebot
claudiusthebot marked this pull request as ready for review November 18, 2026 15:44
@claudiusthebot
claudiusthebot merged commit d2f35b8 into main Nov 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant