Coder Social home page Coder Social logo

android-kernel-actions's Introduction

Android Kernel Actions

Shell check

Builds Android kernel from the kernel repository.

Note: You don't have to fork this repository, see the examples.

Action Vars

Inputs

Input Description
arch Specify what Architecture target to use, currently only supports arm64
compiler Specify which toochain to use
defconfig Specify what defconfig command used to generate .config file
image Specify what is the final build file, usually it's Image.gz-dtb or Image-dtb

Environment Variables

Variable Description
NAME Specify the name of the release file, defaults to the name of the repository
KERNEL_PATH Specify the path of the kernel source, defaults to .
ZIPPER_PATH Specify the path of the zip template, defaults to zipper
PYTHON_VERSION Specify the version of Python to use, either 3, or 2. defaults to 3

Outputs

Output Description
elapsed_time Time elapsed from building the kernel in seconds, excluding zipping and downloading toolchains
outfile Path to the final build file
hash Kernel 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 build
  uses: ncipollo/release-action@v1
  with:
    artifacts: ${{ steps.<step id>.outputs.outfile }}
    token: ${{ secrets.GITHUB_TOKEN }}

Or with appleboy/telegram-action:

- name: Release build
  uses: appleboy/telegram-action@master
  with:
    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

For older GCC use v0.4.0 action version

  • gcc/9
  • gcc/10
  • gcc/11
  • gcc/12

Ubuntu's Clang

For older Clang use v0.4.0 action version

  • clang/11, clang/11/binutils
  • clang/12, clang/12/binutils
  • clang/13, clang/13/binutils
  • clang/14, clang/14/binutils
  • clang/15, clang/15/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 Tag

on:
  push:
    tags: '*'

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout kernel source
      uses: actions/checkout@v2

    - name: Checkout zipper
      uses: actions/checkout@v2
      with:
        repository: lemniskett/AnyKernel3
        path: zipper

    - name: Android kernel build
      uses: lemniskett/android-kernel-actions@master
      id: build
      env:
        NAME: Dark-Ages-Último
      with:
        arch: arm64
        compiler: gcc/10
        defconfig: vince_defconfig
        image: Image.gz-dtb

    - name: Release build
      uses: ncipollo/release-action@v1
      with:
        artifacts: ${{ steps.build.outputs.outfile }}
        token: ${{ secrets.GITHUB_TOKEN }}
name: Build on push master

on:
  push:
    branches: [ master ]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout kernel source
      uses: actions/checkout@v2

    - name: Checkout zipper
      uses: actions/checkout@v2
      with:
        repository: lemniskett/AnyKernel3
        path: zipper

    - name: Android kernel build
      uses: lemniskett/android-kernel-actions@master
      id: build
      env:
        NAME: Dark-Ages-Último
      with:
        arch: arm64
        compiler: gcc/10
        defconfig: vince_defconfig
        image: Image.gz-dtb

    - name: Release build
      uses: appleboy/telegram-action@master
      with:
        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

Script InvalidSyntax exceptions

Your kernel source scripts might not support Python 3 yet, set PYTHON_VERSION environment variable to "2".

Error codes

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

android-kernel-actions's People

Contributors

lemniskett avatar nit-in avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

android-kernel-actions's Issues

kernel build fails with error in make

ld.lld: error: target emulation unknown: -m or at least one .o file required
make[4]: *** [../scripts/Makefile.build:426: drivers/gpu/drm/built-in.o] Error 1
make[3]: *** [../scripts/Makefile.build:492: drivers/gpu/drm] Error 2
make[2]: *** [../scripts/Makefile.build:492: drivers/gpu] Error 2
make[2]: *** Waiting for unfinished jobs....

Investigating the error led me to this forum post where someone had a similar issue. tried picking the mentioned fix but it didn't resolve the issue.

I should also say that the source builds successfully on my local machine and on a docker instance with jenkins using the same toolchains on all occasions (proton-clang 13.0)

Add xz-utils

Hello, I write this little issue just for saying you should add xz-utils while apt-intalling clang,binutils,... because don't have xz command can make crash if you compile a samsung kernel like the A32 one. Have a nice day!

cannot use CONFIG_LTO_CLANG : requires GNU gold 1.12 or later

make[1]: Entering directory '/github/workspace/out'
GEN ./Makefile
scripts/kconfig/conf --silentoldconfig Kconfig
CHK include/config/kernel.release
Cannot use CONFIG_LTO_CLANG: requires GNU gold 1.12 or later
make[1]: *** [/github/workspace/Makefile:1206: prepare-compiler-check] Error 1
make[1]: *** Waiting for unfinished jobs....
UPD include/config/kernel.release
make[1]: Leaving directory '/github/workspace/out'
make: *** [Makefile:152: sub-make] Error 2
make[1]: Entering directory '/github/workspace/out'
CHK include/config/kernel.release
Cannot use CONFIG_LTO_CLANG: requires GNU gold 1.12 or later
make[1]: *** [/github/workspace/Makefile:1206: prepare-compiler-check] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/github/workspace/out'
make: *** [Makefile:152: sub-make] Error 2

==> Failed building kernel, probably the toolchain is not compatible with the kernel, or kernel source problem

Missing telegram token or user list

The title is the only error message I get.
Occurs when it's time to send with my bot using appleboy's telegram action as suggested in the README.
Configured secrets properly (?) but no success.

See the following for reference:
https://github.com/crazo7924/android_kernel_realme_RMX3241/runs/6123676660?check_suite_focus=true#step:7:6

PS: I have forked and slightly modified your GitHub action just for the untrusted /github/workspace/ folder error and aosp-clang toolchains.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.