Skip to content

EmbeddedAndroid/kbuild-deb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

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 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

Plain defconfig, no fragments

      - uses: EmbeddedAndroid/kbuild-deb@v1
        with:
          kernel-repo: https://github.com/torvalds/linux
          kernel-ref: master
          arch: x86_64
          defconfig: x86_64_defconfig

In-tree fragments (no external repo)

      - uses: EmbeddedAndroid/kbuild-deb@v1
        with:
          kernel-repo: ...
          kernel-ref: ...
          arch: arm64
          fragments: |
            arch/arm64/configs/virt.config
            kernel/configs/debug.config

Inputs

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.

Outputs

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.

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

Watchers

Forks

Packages

 
 
 

Contributors