Debian Patches

Status for device-tree-compiler/1.8.1-2

Patch Description Author Forwarded Bugs Origin Last update
01_build_doc.patch =================================================================== no
upstream/0001-tests-Remove-unused-cleanup-mechanism-from-tests.patch [PATCH 01/20] tests: Remove unused cleanup() mechanism from tests
The cleanup() function is defined as a weak symbol in testutils.c, and
called from the various helpers which exit a test. The idea is that
each test can override it to perform test specific cleanup. However,
nothing actually uses it. Furthermore the use of ((weak)) means we can't
run the tests on Windows / mingw. Just remove it for now.
David Gibson <david@gibson.dropbear.id.au> no 2026-05-26
upstream/0002-tests-More-portable-installation-of-SIGINT-handler.patch [PATCH 02/20] tests: More portable installation of SIGINT handler
Our tests install SIGINT handlers using sigaction(), but that isn't
available on Windows / mingw, blocking use of the tests there. Use the
more portable signal() instead - it's good enough for our needs. Avoid
strsignal() for the same reason.
David Gibson <david@gibson.dropbear.id.au> no 2026-05-26
upstream/0003-tests-Fix-mkdir-call-for-Windows-compatibility.patch [PATCH 03/20] tests: Fix mkdir() call for Windows compatibility
Windows mkdir() takes only one argument (no mode parameter).
Guard the two-argument POSIX form with #ifndef _WIN32.
David Gibson <david@gibson.dropbear.id.au> no 2026-05-26
upstream/0004-tests-Avoid-Wconstant-logical-operand-warnings-in-in.patch [PATCH 04/20] tests: Avoid -Wconstant-logical-operand warnings in integer-expressions.c

Our examples trip this warning new in gcc 17, but we still want them.
David Gibson <david@gibson.dropbear.id.au> no 2026-05-28
upstream/0005-livetree-Fix-a-comparison-of-integers-with-different.patch [PATCH 05/20] livetree: Fix a comparison of integers with different signedness

On some architectures we have:

livetree.c: In function 'fixup_phandles':
livetree.c:1237:54: error: comparison of integer expressions of different signedness: 'long int' and 'unsigned int' [-Werror=sign-compare]
1237 | if (offset < 0 || offset + 4 > p->val.len) {
| ^
cc1: all warnings being treated as errors
make: *** [Makefile:307: livetree.o] Error 1
Uwe Kleine-König <u.kleine-koenig@baylibre.com> no 2026-06-08
upstream/0006-Set-default-permissions-for-workflows.patch [PATCH 06/20] Set default permissions for workflows
Old github repositories created before 2023 run jobs with a GITHUB_TOKEN
that has write permissions by default for PRs from inside the repo (not
a fork), unless set otherwise in the repository.[0][1]

[0] https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only/
[1] https://github.blog/changelog/2021-04-20-github-actions-control-permissions-for-github_token/

Set it explicitly so there won't be a chance that a compromise of an action
will be able to modify anything in the repository.

Pointed out by zizmor[2]
[2] https://github.com/zizmorcore/zizmor
Yedaya Katsman <yedaya.ka@gmail.com> no 2026-05-27
upstream/0007-ci-Upgrade-actions-checkout-v4-to-v6-for-Node.js-24-.patch [PATCH 07/20] ci: Upgrade actions/checkout v4 to v6 for Node.js 24 support

Node.js 20 actions are deprecated and will be forced to Node.js 24 on
June 16, 2026. actions/checkout@v6 has native Node.js 24 support.
David Gibson <david@gibson.dropbear.id.au> no 2026-06-13
upstream/0008-ci-Move-FreeBSD-CI-from-Cirrus-CI-to-GitHub-Actions.patch [PATCH 08/20] ci: Move FreeBSD CI from Cirrus CI to GitHub Actions
Cirrus CI shut down on 2026-06-01. Replace it with
cross-platform-actions/action which runs FreeBSD in a QEMU VM on
GitHub Actions runners. This preserves the same test matrix: FreeBSD
13.5 and 14.3 with both make and meson build systems.

Explicitly set shell to sh, since FreeBSD 13.x defaults to csh which
doesn't understand POSIX if/then/fi syntax.
David Gibson <david@gibson.dropbear.id.au> no 2026-06-13
upstream/0009-ci-Add-macOS-support-to-install-deps.sh.patch [PATCH 09/20] ci: Add macOS support to install-deps.sh
Use brew install --quiet to suppress warnings about already-installed
packages on the GitHub Actions runner.
David Gibson <david@gibson.dropbear.id.au> no 2026-06-13
upstream/0010-ci-Merge-make-and-meson-jobs-using-build-matrix.patch [PATCH 10/20] ci: Merge make and meson jobs using build matrix
Combine build-make/build-meson into build-linux and
build-freebsd-make/build-freebsd-meson into build-freebsd, each with
a build: [make, meson] matrix dimension.
David Gibson <david@gibson.dropbear.id.au> no 2026-06-13
upstream/0011-tests-Add-missing-unterminated_memrsv-to-dumptrees.patch [PATCH 11/20] tests: Add missing unterminated_memrsv to dumptrees
unterminated_memrsv is defined in trees.S and has a test program, but
was never included in the dumptrees table, so no .dtb file was
generated for it.
David Gibson <david@gibson.dropbear.id.au> no 2026-06-13
upstream/0012-tests-Dont-have-test-cases-link-directly-against-exa.patch [PATCH 12/20] tests: Dont have test cases link directly against example dtb data

Several tests (truncated_property, truncated_string, truncated_memrsv and
unterminated_memrsv), rather than loading their example dtb from a file,
instead link directly to trees.o and get the data from directly in their
own data segment. This was a clever trick once, but it's kind of awkward,
and makes it harder to generalise how we generate those trees.

Change them to load their example data from file, like most of the tests
already do.
David Gibson <david@gibson.dropbear.id.au> no 2026-06-13
upstream/0013-tests-Add-treegen-a-pure-C-replacement-for-trees.S-d.patch [PATCH 13/20] tests: Add treegen, a pure C replacement for trees.S + dumptrees

For tests, we need some example dtbs that are generated without using dtc
or libfdt. This is for two reasons:
* We want to check exact byte-for-byte properties independently of the
main code - we don't want bugs in one to mask bugs in the other
* We need to generate some deliberately malformed trees to test error
handling

Currently, these are generated (somewhat oddly) using the assembler -
we use assembler macros in trees.S which constructs them "in memory", then
dumptrees.c links against that and dumps them out as files. This is
arguably an abuse of the assembler, and it's fairly fragile. Platforms
with unusual symbol naming conventions can cause it to break, and some
assembler versions (e.g. the one on MacOS) don't work with it.

This replaces it with a bespoke C code, with a structure to at least
somewhat maintain the readability of the examples. Output is byte for
byte identical with the previous version. For now we add tests that check
the new code generates (byte for byte) identical output, but still use
the old version in our other tests.
David Gibson <david@gibson.dropbear.id.au> no 2026-06-13
upstream/0014-tests-Replace-trees.S-dumptrees-with-treegen-for-mak.patch [PATCH 14/20] tests: Replace trees.S/dumptrees with treegen for making test dtbs

Switch the build system to use treegen instead of trees.S + dumptrees
for generating the test DTB files. treegen produces byte-identical
output without requiring a GNU assembler.

Remove the old tree.S, dumptrees.c and associated pieces.

This also removes the need for the ASM_CONST_LL macro and separated
values for the high and low halves of 64-bit values: those only
existed so the same constants could be embedded in both C and
assembly. Remove those from testdata.h, and the copies in
pylibfdt_tests.py.
David Gibson <david@gibson.dropbear.id.au> no 2026-06-14
upstream/0015-libfdt-fdt_check_full-Add-can_assume-PERFECT-check.patch [PATCH 15/20] libfdt: fdt_check_full: Add can_assume(PERFECT) check
In this function from fdt_check.c we have (reasonably and as the name
implies) a number of checks on the DTB. However, there are cases where
we may wish to assume that we have been given a perfect DTB already and
do nothing here. Add a test for can_assume(PERFECT) as the first check
in this function and if true, perform no checks.
Tom Rini <trini@konsulko.com> no 2026-05-26
upstream/0016-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch [PATCH 16/20] pylibfdt: Replace removed SWIG Python 2 compatibility macros

SWIG 4.5.0 removed Python 2 compatibility macros (PyInt_*, PyString_*)
from its runtime header pyhead.swg (see commit 79f7a2b7cb7d). Replace
them with their Python 3 C API equivalents:

- PyString_FromString -> PyUnicode_FromString
- PyString_AsString -> PyBytes_AsString
- PyInt_AsLong -> PyLong_AsLong

The replacements are safe since the macros were already aliased to
these exact functions in SWIG's Python 3 code path.
Jitka Plesnikova <jplesnik@redhat.com> no 2026-07-29
upstream/0017-pylibfdt-Grow-the-FdtSw-buffer-geometrically.patch [PATCH 17/20] pylibfdt: Grow the FdtSw buffer geometrically
Every expansion copies the whole tree into a freshly allocated buffer, so
growing by a fixed amount makes building a tree cost time quadratic in
its size. This is especially painful when assembling larger images with
the data inline, such as U-Boot's binman does for FIT images.

Grow by at least as much as the tree already holds, which is what variable
sized arrays usually do specifically to avoid such excessive copying.

With this change, building a Rockchip TF-A+Falcon image whose FIT carries
a 31 MiB kernel takes 33.1 s rather than 44.4 s, with binman itself down
from 25.3 s to 14.0 s, as 7139 reallocations become 187. The images
produced are byte-identical.
Alexey Charkov <alchark@flipper.net> no 2026-08-06
upstream/0018-pylibfdt-Add-address_cells-and-size_cells.patch [PATCH 18/20] pylibfdt: Add address_cells() and size_cells()
Finding out how many cells a node's children use for addresses and sizes
currently requires calling the raw fdt_address_cells()/fdt_size_cells()
wrappers with the private FdtRo._fdt buffer, as the class exposes no
methods for them.

Add them to FdtRo alongside the other node accessors, and test them.
Alexey Charkov <alchark@flipper.net> no 2026-08-06
upstream/0019-pylibfdt-Add-add_mem_rsv-and-del_mem_rsv.patch [PATCH 19/20] pylibfdt: Add add_mem_rsv() and del_mem_rsv()
The memory reserve map can be read through num_mem_rsv() and
get_mem_rsv(), but changing it requires calling the raw fdt_* wrappers
with the private Fdt._fdt buffer, as the class exposes no methods for
the write side.

Add them next to the existing accessors, and test them.
Alexey Charkov <alchark@flipper.net> no 2026-08-06
upstream/0020-fdtget-Use-libfdt-iterators-instead-of-open-coded-lo.patch [PATCH 20/20] fdtget: Use libfdt iterators instead of open coded loops

fdtget uses directly fdt_{first,next}_property_offset() with a while(1)
loop to iterate over node properties.

It also uses the low level primitive fdt_next_tag() with custom tags,
level and depth handling to iterates over subnodes.

It is worth noting that FDT_NOP can be returned by fdt_next_tag() and
this tag is not taken into account in the fdtget open coded loop. This
will lead to an incorrect error if a FDT_NOP tag is encountered.

libfdt provides iterators to iterate over node properties and subnodes.
The subnode iterator provided by libfdt is robust against FDT_NOP tags
and will be robust in the future when new tags are introduced.

Replace fdtget open coded loops by iterators provided by libfdt and
designed to perform those operations.
Herve Codina <herve.codina@bootlin.com> no 2026-08-26
02_meson-fix-libfdt-sources.patch no

All known versions for source package 'device-tree-compiler'

Links