Skip to content

kbuild: merge config fragments from the kernel source tree - #3225

Closed
bhcopeland wants to merge 1 commit into
kernelci:mainfrom
bhcopeland:kbuild-tree-fragments
Closed

bhcopeland wants to merge 1 commit into
kernelci:mainfrom
bhcopeland:kbuild-tree-fragments

Conversation

@bhcopeland

Copy link
Copy Markdown
Member

A fragment can only carry config symbols or a make target, so a job that needs the options a subsystem's selftests declare has to either run 'make kselftest-merge', which merges every selftest config and brings in lockdep, DEBUG_PAGEALLOC and the rest, or copy that one config file into fragments.yaml, where it goes stale as the kernel's copy changes.

Accept a 'tree:' entry naming a config fragment file in the kernel source tree, such as 'tree:tools/testing/selftests/arm64/config', and merge it as each tree ships it. The make backend merges it with merge_config.sh from inside the tree; tuxmake is given its path in the tree. The path is written into the build script unquoted, so one that is empty, absolute, lexically outside the tree or holding anything but letters, digits, '.', '_', '-' and '/' fails the job.

When a tree does not ship the file its merge is skipped with a message, and the build continues: tools/testing/selftests/arm64/config first appears in v7.3-rc1, and the same fragment is built for stable branches that predate it. The check happens when the script runs, since the tree is only unpacked then.

A fragment can only carry config symbols or a make target, so a job that
needs the options a subsystem's selftests declare has to either run
'make kselftest-merge', which merges every selftest config and brings in
lockdep, DEBUG_PAGEALLOC and the rest, or copy that one config file into
fragments.yaml, where it goes stale as the kernel's copy changes.

Accept a 'tree:<path>' entry naming a config fragment file in the kernel
source tree, such as 'tree:tools/testing/selftests/arm64/config', and
merge it as each tree ships it. The make backend merges it with
merge_config.sh from inside the tree; tuxmake is given its path in the
tree. The path is written into the build script unquoted, so one that is
empty, absolute, lexically outside the tree or holding anything but
letters, digits, '.', '_', '-' and '/' fails the job.

When a tree does not ship the file its merge is skipped with a message,
and the build continues: tools/testing/selftests/arm64/config first
appears in v7.3-rc1, and the same fragment is built for stable branches
that predate it. The check happens when the script runs, since the tree
is only unpacked then.

Signed-off-by: Ben Copeland <ben.copeland@linaro.org>
@bhcopeland

Copy link
Copy Markdown
Member Author

@bhcopeland
bhcopeland requested a review from roxell September 25, 2026 22:21
@bhcopeland
bhcopeland marked this pull request as draft September 25, 2026 22:22
@bhcopeland bhcopeland closed this Sep 26, 2026
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