feat: add cross-compilation support and Docker containerized builds for kernel packaging - #57
Open
guanquan (GuanquanTian) wants to merge 10 commits into
Conversation
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
…uisites before clean - Detect a build/host arch mismatch and enable cross builds via dpkg foreign-architecture, the "cross" build profile, and DEB_HOST_ARCH/GNU_TYPE/MULTIARCH propagation. - Factor debian/control generation and native-host-tool-dep patching into scripts/lib/gen-real-control.sh, shared with build-docker-image.sh. - Install fakeroot/debhelper before running `debian/rules clean`, which requires both to run. - Mark native-host build tools (e.g. llvm-*-dev) `:native` via a pattern-keyed NATIVE_HOST_TOOL_DEPS table, and restore debian/control from a backup on exit. - Support OUTPUT_DIR override, and exit with an explicit error message when apt-get build-dep or dch need root but no sudo binary is available. - Add binary-indep to the build targets so the arch:all linux-qcom-headers-* package is produced alongside the flavour packages. Signed-off-by: Guanquan Tian <guanquan@qti.qualcomm.com>
…rfile - Add scripts/Dockerfile.kernel-build, built FROM docker.io/library/ubuntu:resolute (falling back to public.ecr.aws/ubuntu/ubuntu:resolute), with build deps resolved dynamically from the kernel tree's own debian/control via `debian/rules clean`. - Add scripts/build-docker-image.sh to drive it: runs `debian/rules clean` on the host, copies the generated debian/control into a scratch build context, and passes TARGET_ARCH/CROSS build args. - The image is built from a Dockerfile checked into this repo. Signed-off-by: Guanquan Tian <guanquan@qti.qualcomm.com>
…t uid/gid - Build the local image on demand via build-docker-image.sh if not already present. - Bind-mount the current directory, OUTPUT_DIR, SOURCE_DIR's parent (where debian/rules writes .deb/.changes/.buildinfo), and the script directory (read-only). - Run the container as the invoking host uid/gid. - Resolve SOURCE_DIR from the path passed in. - Support OUTPUT_DIR override, created on the host before the container starts. Signed-off-by: Guanquan Tian <guanquan@qti.qualcomm.com>
Add scripts/README.md covering build-kernel-deb.sh, docker-build-kernel.sh, and build-docker-image.sh usage, arguments, environment variables, and cross-compilation notes. Signed-off-by: Guanquan Tian <guanquan@qti.qualcomm.com>
- Pass HTTP_PROXY/HTTPS_PROXY/NO_PROXY as Docker build args, scoped to the individual RUN steps in Dockerfile.kernel-build (not ENV), so they never leak into the built image or its containers. - Document the one-time, per-machine proxy setup and the two new env vars in scripts/README.md. - Note that linux-headers-*-qcom depends on linux-qcom-headers-*, so the latter must be installed first. Signed-off-by: Guanquan Tian <guanquan@qti.qualcomm.com>
guanquan (GuanquanTian)
force-pushed
the
build-kernel-deb-cross-improvements
branch
3 times, most recently
from
August 31, 2026 04:37
ccf55ae to
1d1c23c
Compare
debian/rules clean wipes debian/build/ and debian/stamps/ on every build, discarding kbuild's own object/cmd tracking and the per-flavour stamp state even when nothing changed. Add INCREMENTAL_BUILD to skip that destructive step (falling back to a full clean on the first build for a given SOURCE_DIR), while still refreshing debian/control and invalidating just the flavour-specific stamps so make re-enters those recipes. Incremental is the default; set INCREMENTAL_BUILD=0 to force a full clean. Signed-off-by: Guanquan Tian <guanquan@qti.qualcomm.com>
Higher parallelism scales worse than expected on incremental (mostly-cached) rebuilds, since scheduling overhead outweighs the gains once most translation units are skipped or near-instant. Override explicitly (e.g. JOBS=$(nproc)) for from-scratch builds on many-core machines. Signed-off-by: Guanquan Tian <guanquan@qti.qualcomm.com>
build-kernel-deb.sh's VERSION_SUFFIX=auto path and gen-real-control.sh's is_git_worktree() checks shell out to git, but the build image never installed it, so builds using VERSION_SUFFIX=auto failed inside the container. git is a script-level tool dependency, not a kernel build dependency, so it belongs in the hand-maintained base-tools layer rather than in the dynamically generated extra-tools.txt. Also document that docker-build-kernel.sh only builds the image when missing locally, so this (or any future Dockerfile) change requires removing the stale cached image before it takes effect. Signed-off-by: Guanquan Tian <guanquan@qti.qualcomm.com>
DBGSYM (default 0) maps to do_dbgsym_package=true/false on the debian/rules invocation, and .ddeb artifacts are now collected into OUTPUT_DIR alongside .deb/.changes/.buildinfo. docker-build-kernel.sh forwards DBGSYM into the container the same way it already does for INCREMENTAL_BUILD. Signed-off-by: Guanquan Tian <guanquan@qti.qualcomm.com>
build-kernel-deb.sh and docker-build-kernel.sh now print their Usage/Arguments/Environment/Output/Notes documentation when called with -h or --help, instead of it only being available as a header comment. Signed-off-by: Guanquan Tian <guanquan@qti.qualcomm.com>
guanquan (GuanquanTian)
force-pushed
the
build-kernel-deb-cross-improvements
branch
from
August 31, 2026 07:13
376adb2 to
ddef691
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
INCREMENTAL_BUILDflag (default 1) andJOBSdefault lowered to 8According to PR # 33 review's feedback, complete the corresponding modifications and add support for setting container content proxies.
#33