Re: [PATCH v3 13/15] fdtfactor: Add -S/--strip-local-fixups option
From: Simon Glass
Date: Wed Nov 04 2026 - 10:24:28 EST
On 2026-11-01T22:01:07, Douglas Anderson <dianders@xxxxxxxxxxxx> wrote:
> fdtfactor: Add -S/--strip-local-fixups option
>
> By default, `fdtfactor` preserves `/__local_fixups__` on `base.dtb` so
> that when `fdt_overlay_apply()` merges a `.dtbo` overlay, the
> reconstructed device tree retains full `/__local_fixups__` information
> (for instance, if an OS kernel wants to know which property cells
> contain phandles at runtime).
>
> When `-L` was passed to `dtc` solely to help `fdtfactor` locate phandle
> cells at build time and `/__local_fixups__` is not needed at runtime,
> retaining `/__local_fixups__` in `base.dtb` wastes space.
>
> Add `-S` / `--strip-local-fixups` to omit `/__local_fixups__` from
> `base.dtb` (and therefore from the merged device trees produced by
> `fdt_overlay_apply()`). On a set of 47 Qualcomm SC7180 Trogdor
> Chromebook board DTBs, `fdtfactor` without `-S` reduces total
> uncompressed size from 7.69 MB to 932 KB (88.2% savings), while
> `fdtfactor -S` reduces it to 634 KB (91.8% savings, saving an additional
> 298 KB by omitting `/__local_fixups__` from `base.dtb`).
>
> Add a test case in `tests/run_tests.sh` verifying that `fdtfactor -S`
> followed by `fdtoverlay` reproduces DTBs compiled with `-@` (without
> `-L`) via `dtbs_equal_unordered`.
>
> Assisted-by: Gemini:gemini-pro-prerelease
> Signed-off-by: Douglas Anderson <dianders@xxxxxxxxxxxx>
>
> README.md | 9 +++++++++
> fdtfactor | 34 ++++++++++++++++++++++++++--------
> tests/run_tests.sh | 18 ++++++++++++++++++
> 3 files changed, 53 insertions(+), 8 deletions(-)
Reviewed-by: Simon Glass <sjg@xxxxxxxxxxxx>