Skip to content

Latest commit

History

61 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Android Kernel Actions

Shell check

Builds Android kernel from the kernel repository.

Action Vars

Inputs

InputDescription
archSpecify what Architecture target to use, currently only supports arm64
compilerSpecify which toochain to use
defconfigSpecify what defconfig command used to generate .config file
imageSpecify what is the final build file, usually it's Image.gz-dtb or Image-dtb

Environment Variables

VariableDescription
NAMESpecify the name of the release file, defaults to the name of the repository
KERNEL_PATHSpecify the path of the kernel source, defaults to .
ZIPPER_PATHSpecify the path of the zip template, defaults to zipper

Outputs

OutputDescription
elapsed_timeTime elapsed from building the kernel in seconds, excluding zipping and downloading toolchains
outfilePath to the final build file
hashKernel commit hash

AnyKernel3

Put the AnyKernel3 template to zipper. Providing AnyKernel3 template is optional, the outfile output varies based on this. If AnyKernel3 template is provided, this Action will create a flashable zip file based on the AnyKernel3 template and the outfile output will be the path to the zipfile. if not the outfile will be the path to the kernel image. See the examples.

Getting the build

Use other action to actually get the file, for example, with ncipollo/release-action:

- name: Release builduses: ncipollo/release-action@v1with:
artifacts: ${{ steps.<step id>.outputs.outfile }}token: ${{ secrets.GITHUB_TOKEN }}

Or with appleboy/telegram-action:

- name: Release builduses: appleboy/telegram-action@masterwith:
to: ${{ secrets.CHANNEL_ID }}token: ${{ secrets.TELEGRAM_BOT_TOKEN }}message: ${{ github.repository }} on ${{ github.sha }} is built!document: ${{ steps.<step id>.outputs.outfile }}

Available toolchains

If you want to compile with Clang and LLVM without any of GNU's binutils, make sure your kernel source already supports LLVM options, otherwise compilation may fails. In that case, use clang toolchain with /binutils.

ARM64

Ubuntu's GCC

  • gcc/7
  • gcc/8
  • gcc/9
  • gcc/10

Ubuntu's Clang

  • clang/6.0, clang/6.0/binutils
  • clang/7, clang/7/binutils
  • clang/8, clang/8/binutils
  • clang/9, clang/9/binutils
  • clang/10, clang/10/binutils
  • clang/11, clang/11/binutils
  • proton-clang/<branch, commit hash or tag>, proton-clang/<branch, commit hash or tag>/binutils

Example : proton-clang/master, proton-clang/09fb113/binutils

  • aosp-clang/<branch>/<clang version>, aosp-clang/<branch>/<clang version>/binutils

Example : aosp-clang/master/clang-r416183b, aosp-clang/android11-release/clang-r365631c/binutils

Example usage

name: Build on Tagon:
push:
tags: '*'jobs:
build:
runs-on: ubuntu-lateststeps:
- name: Checkout kernel sourceuses: actions/checkout@v2
- name: Checkout zipperuses: actions/checkout@v2with:
repository: lemniskett/AnyKernel3path: zipper
- name: Android kernel builduses: lemniskett/android-kernel-actions@masterid: buildenv:
NAME: Dark-Ages-Últimowith:
arch: arm64compiler: gcc/10defconfig: vince_defconfigimage: Image.gz-dtb
- name: Release builduses: ncipollo/release-action@v1with:
artifacts: ${{ steps.build.outputs.outfile }}token: ${{ secrets.GITHUB_TOKEN }}
name: Build on push masteron:
push:
branches: [ master ]jobs:
build:
runs-on: ubuntu-lateststeps:
- name: Checkout kernel sourceuses: actions/checkout@v2
- name: Checkout zipperuses: actions/checkout@v2with:
repository: lemniskett/AnyKernel3path: zipper
- name: Android kernel builduses: lemniskett/android-kernel-actions@masterid: buildenv:
NAME: Dark-Ages-Últimowith:
arch: arm64compiler: gcc/10defconfig: vince_defconfigimage: Image.gz-dtb
- name: Release builduses: appleboy/telegram-action@masterwith:
to: ${{ secrets.CHANNEL_ID }}token: ${{ secrets.TELEGRAM_BOT_TOKEN }}message: Kernel is built!, took ${{ steps.build.outputs.elapsed_time }} seconds.document: ${{ steps.build.outputs.outfile }}

Troubleshooting

Error codes

  • 1: Packages fails to install
  • 2: .config fails to be generated
  • 3: Build fails
  • 100: Unsupported usage
  • 127: Unexpected error

About

An action to build an Android kernel with specified toolchains.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages