Skip to content

Latest commit

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

kbuild-deb

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 defconfig and 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 *.config kconfig fragments from any repo (or from the kernel tree) on top of the base defconfig via scripts/kconfig/merge_config.sh.

It follows the qcom-deb-images build-linux-deb.py methodology (defconfigmerge_config.sh -m -rolddefconfigbindeb-pkg), generalized so it isn't pinned to arm64 or to any one set of fragments.

Usage

jobs:
build:
runs-on: ubuntu-24.04 # or your self-hosted runnerpermissions:
contents: write # only if you publish a release belowsteps:
- id: builduses: EmbeddedAndroid/kbuild-deb@v1with:
kernel-repo: ${{ github.server_url }}/${{ github.repository }}kernel-ref: ${{ github.head_ref || github.ref_name }}arch: arm64defconfig: defconfigfragments-repo: qualcomm-linux/qcom-deb-imagesfragments: kernel-configs/*.config
- uses: actions/upload-artifact@v4with:
name: linux-${{ steps.build.outputs.kernelversion }}-debpath: | ${{ steps.build.outputs.deb-dir }}/*.deb ${{ steps.build.outputs.deb-dir }}/config-* ${{ steps.build.outputs.deb-dir }}/SHA256SUMS

Plain defconfig, no fragments

 - uses: EmbeddedAndroid/kbuild-deb@v1with:
kernel-repo: https://github.com/torvalds/linuxkernel-ref: masterarch: x86_64defconfig: x86_64_defconfig

In-tree fragments (no external repo)

 - uses: EmbeddedAndroid/kbuild-deb@v1with:
kernel-repo: ...kernel-ref: ...arch: arm64fragments: | arch/arm64/configs/virt.config kernel/configs/debug.config

Inputs

inputrequireddefaultdescription
kernel-repoyesKernel git URL to clone.
kernel-refyesBranch or tag to build (git clone --branch).
archnoarm64Kernel ARCH (arm64, x86_64, arm, riscv, powerpc, s390).
defconfignodefconfigBase config make target.
cross-compilenoautoCROSS_COMPILE prefix; auto-derived from arch. Empty + matching host arch = native build.
deb-archnoautoDEB_HOST_ARCH for the packages; auto-derived from arch.
fragmentsno(none)Newline-separated fragment paths/globs to merge.
fragments-repono(none)owner/repo to resolve fragments within.
fragments-refnodefaultRef for fragments-repo.

Architectures outside the built-in map are supported by passing both cross-compile and deb-arch explicitly.

Outputs

outputdescription
deb-dirDirectory holding the .debs, the config-*, and SHA256SUMS.
config-filePath to the exact .config used (captured after olddefconfig).
kernelversionmake kernelversion of the built tree.

Notes

  • Runner arch. Cross builds assume a Debian/Ubuntu amd64 runner with ports.ubuntu.com reachable (used to install the target libssl-dev:<arch>).
  • The package version is whatever the kernel's mkdebian generates; tag/name your release in the calling workflow if you want run-numbered versions.

About

GitHub Action that builds a Linux kernel into Debian packages (bindeb-pkg) with configurable arch, defconfig, and config fragments merged from any repo. Cross-compiles or builds natively.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors