Skip to content

config: apply every packaging fragment, in locale-independent order - #76

Merged
Bjordis Collaku (bjordiscollaku) merged 1 commit into
qcom/debian/latestfrom
feat/config-handling-all-and-sorted
Aug 27, 2026
Merged

Bjordis Collaku (bjordiscollaku) merged 1 commit into
qcom/debian/latestfrom
feat/config-handling-all-and-sorted

Conversation

@bjordiscollaku

@bjordiscollaku Bjordis Collaku (bjordiscollaku) commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Two changes to config fragment handling.

  1. Every fragment in debian/config-available/ is applied to every build, for all variants, with no per-variant subset.
  2. Fragments are applied in a locale-independent order.

1. All fragments applied

prepare-source.sh now copies the whole of debian/config-available/ into debian/config/ rather than only the names listed in --kernel-config. Adding a fragment to that directory now enables it for every variant with no matrix or workflow change, which removes a class of drift: the list previously had to be repeated in each matrix row and kept in sync by hand.

--kernel-config now carries only what is applied in addition to that set, which today means intree: fragments shipped by the kernel source:

--kernel-config intree:qcom_debug

Bare names are still accepted, so existing callers and the kernel-config workflow input default keep working. They are reported as already applied rather than treated as an error.

2. Locale-independent ordering

debian/rules sorted debian/config/*.config with a plain sort, which follows the caller's collation:

LC_ALL=C          qcom-imsdk.config  qcom-laptops.config  qcom_debug.config
LC_ALL=en_US.UTF-8  qcom_debug.config  qcom-imsdk.config  qcom-laptops.config

Fragments are concatenated onto .config in order and later assignments win, so the same source could produce a different kernel configuration depending on the builder's locale. That is a reproducibility bug rather than a cosmetic one, and it affects the debug variant directly, since qcom_debug.config is exactly one of the names whose position moves.

Both the debian/rules glob and the prepare-source.sh entry list are now sorted with LC_ALL=C.

Validation

Exercised against a fixture kernel tree:

Case Result
No --kernel-config at all All 9 fragments from config-available/ applied
intree:qcom_debug only All 9 applied, plus qcom_debug.config from the kernel tree
Legacy bare names (docker,squashfs,intree:qcom_debug) Bare names reported as already applied, no failure
Unsorted input (usb-can,intree:qcom_debug,docker) Processed in sorted order
intree:nope Exits 1, reports the missing path and lists available in-tree fragments

bash -n and shellcheck -S error are clean on both modified scripts.

Follow-up

The matrix rows still list the fragment names in kernel_config. Those entries are now redundant and can be reduced to just the intree: entries in a companion change on main; they are harmless in the meantime.

Context

Follows the fragment sync in #71, which brought debian/config-available/ back in line with qcom-deb-images. That sync is what made the per variant list redundant: every variant is expected to carry the whole set, so listing a subset in each matrix row only creates somewhere for it to drift.

Refs #65.

Two changes to how config fragments are selected and applied.

Apply all of debian/config-available/ to every build. The directory is the
packaging fragment set, kept in sync with kernel-configs/ in qcom-deb-images,
and every variant is expected to carry all of it. prepare-source.sh now copies
the whole directory rather than the subset named in --kernel-config, so adding
a fragment enables it for every variant with no matrix or workflow change.

--kernel-config now carries only what is applied in addition to that set,
which today means intree: fragments shipped by the kernel source. Bare names
remain accepted so existing callers and the workflow input default keep
working; they are reported as already applied rather than failing.

Apply fragments in a deterministic order. debian/rules sorted
debian/config/*.config with plain sort, which follows the caller's collation:
under en_US.UTF-8 qcom_debug.config sorts before qcom-imsdk.config, under C it
sorts after. Fragments are concatenated in order and later assignments win, so
a locale difference could change the resulting kernel configuration. Both the
rules glob and the prepare-source.sh entry list are now sorted with LC_ALL=C.

Verified against a fixture kernel tree: all fragments applied with no
--kernel-config, intree: entries applied on top, legacy bare names accepted as
no-ops, unsorted input processed in sorted order, and a missing intree:
fragment still failing the build.

Signed-off-by: Bjordis Collaku <bcollaku@qti.qualcomm.com>
@bjordiscollaku
Bjordis Collaku (bjordiscollaku) merged commit 5cd4aae into qcom/debian/latest Aug 27, 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.

2 participants