A GitHub Action that builds a Linux kernel into Debian packages
(linux-image, linux-headers, linux-libc-dev, …) using the kernel's
in-tree make bindeb-pkg target.
- Configurable base
defconfigand target architecture. - Cross-compiles automatically when the target arch differs from the
runner (sets up the crossbuild toolchain + target multiarch
libssl-dev); builds natively otherwise. - Generic config fragments — merge
*.configkconfig fragments from any repo (or from the kernel tree) on top of the base defconfig viascripts/kconfig/merge_config.sh.
It follows the
qcom-deb-images build-linux-deb.py
methodology (defconfig → merge_config.sh -m -r → olddefconfig →
bindeb-pkg), generalized so it isn't pinned to arm64 or to any one set of
fragments.
jobs:
build:
runs-on: ubuntu-24.04 # or your self-hosted runner
permissions:
contents: write # only if you publish a release below
steps:
- id: build
uses: EmbeddedAndroid/kbuild-deb@v1
with:
kernel-repo: ${{ github.server_url }}/${{ github.repository }}
kernel-ref: ${{ github.head_ref || github.ref_name }}
arch: arm64
defconfig: defconfig
fragments-repo: qualcomm-linux/qcom-deb-images
fragments: kernel-configs/*.config
- uses: actions/upload-artifact@v4
with:
name: linux-${{ steps.build.outputs.kernelversion }}-deb
path: |
${{ steps.build.outputs.deb-dir }}/*.deb
${{ steps.build.outputs.deb-dir }}/config-*
${{ steps.build.outputs.deb-dir }}/SHA256SUMS - uses: EmbeddedAndroid/kbuild-deb@v1
with:
kernel-repo: https://github.com/torvalds/linux
kernel-ref: master
arch: x86_64
defconfig: x86_64_defconfig - uses: EmbeddedAndroid/kbuild-deb@v1
with:
kernel-repo: ...
kernel-ref: ...
arch: arm64
fragments: |
arch/arm64/configs/virt.config
kernel/configs/debug.config| input | required | default | description |
|---|---|---|---|
kernel-repo |
yes | — | Kernel git URL to clone. |
kernel-ref |
yes | — | Branch or tag to build (git clone --branch). |
arch |
no | arm64 |
Kernel ARCH (arm64, x86_64, arm, riscv, powerpc, s390). |
defconfig |
no | defconfig |
Base config make target. |
cross-compile |
no | auto | CROSS_COMPILE prefix; auto-derived from arch. Empty + matching host arch = native build. |
deb-arch |
no | auto | DEB_HOST_ARCH for the packages; auto-derived from arch. |
fragments |
no | (none) | Newline-separated fragment paths/globs to merge. |
fragments-repo |
no | (none) | owner/repo to resolve fragments within. |
fragments-ref |
no | default | Ref for fragments-repo. |
Architectures outside the built-in map are supported by passing both
cross-compile and deb-arch explicitly.
| output | description |
|---|---|
deb-dir |
Directory holding the .debs, the config-*, and SHA256SUMS. |
config-file |
Path to the exact .config used (captured after olddefconfig). |
kernelversion |
make kernelversion of the built tree. |
- Runner arch. Cross builds assume a Debian/Ubuntu amd64 runner with
ports.ubuntu.comreachable (used to install the targetlibssl-dev:<arch>). - The package version is whatever the kernel's
mkdebiangenerates; tag/name your release in the calling workflow if you want run-numbered versions.