[PATCH v2 5/8] binman: android_boot: SEANDROIDENFORCE support
Simon Glass
sjg at chromium.org
Mon Jun 8 15:27:06 CEST 2026
Hi Sam,
On 2026-06-07T23:37:09, Sam Day via B4 Relay
<devnull+me.samcday.com at kernel.org> wrote:
> binman: android_boot: SEANDROIDENFORCE support
>
> Some older MSM8916-era bootloaders want to see this string appended to
> the abootimg, or they log an ugly warning to the screen.
>
> Signed-off-by: Sam Day <me at samcday.com>
>
> tools/binman/etype/android_boot.py | 11 +++++++++++
> tools/binman/ftest.py | 6 ++++++
> .../test/vendor/android_boot_seandroidenforce.dts | 22 ++++++++++++++++++++++
> 3 files changed, 39 insertions(+)
> diff --git a/tools/binman/etype/android_boot.py b/tools/binman/etype/android_boot.py
> @@ -55,6 +57,7 @@ class Entry_android_boot(Entry_section):
> - os-version: Encoded Android OS version and patch level, defaults to 0
> - boot-name: Android boot image board name
> - cmdline: Android boot command line
> + - append-seandroid-enforce: Append Samsung SEANDROIDENFORCE trailer,
Calling this 'Samsung' is misleading given the commit message
attributes it to MSM8916-era bootloaders - perhaps 'Append the
SEANDROIDENFORCE trailer expected by some MSM8916/Samsung
bootloaders'.
> diff --git a/tools/binman/etype/android_boot.py b/tools/binman/etype/android_boot.py
> @@ -174,6 +180,9 @@ class Entry_android_boot(Entry_section):
> self.Raise('page-size must fit the Android boot image header')
> if 'dtb' not in self._entries:
> self.Raise("Missing required subnode 'dtb'")
> + if self.append_seandroid:
> + self.Raise("Property 'append-seandroid-enforce' requires "
> + "header-version 0")
Just to check, is this a hard restriction of the format, or only a
reflection of which bootloaders are known to want this trailer? If v2
images can legitimately carry it too, it would be more flexible to
allow it. If it really is invalid, please add a short note in the
commit message saying why.
> diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
> @@ -5673,6 +5673,12 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
> + def testAndroidBootSeAndroidEnforce(self):
> + """Test that binman appends SEANDROIDENFORCE"""
> + data = self._DoReadFile('vendor/android_boot_seandroidenforce.dts')
> +
> + self.assertEqual(b'SEANDROIDENFORCE', data[-16:])
Please add a negative test for the v2 + append-seandroid-enforce
combination, to lock in the Raise(). It would also be worth asserting
the rest of the image (header, kernel page, ramdisk page) is intact,
so a regression that truncates the body but leaves the trailer in
place would still be caught.
Regards,
Simon
More information about the U-Boot
mailing list