From 8361a1a7f444b60567f35fab2ecac105cb5f740f Mon Sep 17 00:00:00 2001 From: ophub Date: Thu, 27 Jan 2022 22:46:55 +0800 Subject: [PATCH] Add use actions compile kernel templates --- .github/workflows/compile-kernel.yml | 14 +-- README.cn.md | 13 ++- README.md | 13 ++- action.yml | 166 ++++++++++++++++++--------- compile-kernel/README.cn.md | 35 +++++- compile-kernel/README.md | 36 +++++- 6 files changed, 213 insertions(+), 64 deletions(-) diff --git a/.github/workflows/compile-kernel.yml b/.github/workflows/compile-kernel.yml index 27ff65875c..9132313cb4 100644 --- a/.github/workflows/compile-kernel.yml +++ b/.github/workflows/compile-kernel.yml @@ -13,10 +13,10 @@ on: description: "Source: kernel.org / unifreq" required: false default: "unifreq" - kernel_ver: + kernel_version: description: "Kernel version: 5.4.170" required: false - default: "5.4.170_5.10.90" + default: "5.10.90_5.4.170" env: TZ: Asia/Shanghai @@ -46,15 +46,15 @@ jobs: [ -z "${kernel_repo}"] && kernel_repo="kernel.org" echo "KERNEL_REPO=${kernel_repo}" >> $GITHUB_ENV - kernel_ver="${{ github.event.inputs.kernel_ver }}" - [ -z "${kernel_ver}" ] && kernel_ver="5.4.170_5.10.90" - echo "KERNEL_VER=${kernel_ver}" >> $GITHUB_ENV + kernel_version="${{ github.event.inputs.kernel_version }}" + [ -z "${kernel_version}" ] && kernel_version="5.4.170_5.10.90" + echo "KERNEL_VERSION=${kernel_version}" >> $GITHUB_ENV - - name: Compile the Kernel [ -k ${{ env.KERNEL_VER }} -r ${{ env.KERNEL_REPO }} ] + - name: Compile the kernel for Amlogic s9xxx id: compile run: | sudo chmod +x recompile - sudo ./recompile -d -k ${{ env.KERNEL_VER }} -r ${{ env.KERNEL_REPO }} + sudo ./recompile -d -k ${{ env.KERNEL_VERSION }} -r ${{ env.KERNEL_REPO }} output_dirname="${PWD}/compile-kernel/output" output_tags="$(ls ${output_dirname}/*.tar.gz -l | awk '{print $9}' | grep -oE '[1-9].[0-9]{1,3}.[0-9]+' | xargs | tr "[ ]" "_")" echo "PACKAGED_OUTPUTTAGS=${output_tags}" >> $GITHUB_ENV diff --git a/README.cn.md b/README.cn.md index 6d25305481..fb0bab91f7 100644 --- a/README.cn.md +++ b/README.cn.md @@ -191,9 +191,10 @@ sudo apt-get install -y $(curl -fsSL git.io/ubuntu-2004-server) 你可以使用其他方式构建 Armbian 固件。或者使用 [Armbian](https://armbian.tnahosting.net/dl/) 官方提供的 [lepotato](https://armbian.tnahosting.net/dl/lepotato/archive/) 等分支的固件,仅在流程控制文件 [.yml](.github/workflows/rebuild-armbian.yml) 中引入本仓库的脚本进行 Armbian 重构,适配 Amlogic S9xxx 系列盒子的使用。在 [Action](https://github.com/ophub/amlogic-s9xxx-armbian/actions) 页面里选择 ***`Rebuild armbian`*** ,输入 Armbian 的网络下载地址如 `https://dl.armbian.com/*/Armbian_*.img.xz` ,或者在流程控制文件 [.yml](.github/workflows/rebuild-armbian.yml) 中通过 `armbian_path` 参数设定重构文件的加载路径。代码如下: ```yaml -- name: Rebuild Armbian for Amlogic s9xxx +- name: Rebuild the Armbian for Amlogic s9xxx uses: ophub/amlogic-s9xxx-armbian@main with: + build_target: armbian armbian_path: build/output/images/*.img armbian_soc: s905d_s905x3_s922x_s905x armbian_kernel: 5.15.13_5.4.170 @@ -222,6 +223,16 @@ sudo apt-get install -y $(curl -fsSL git.io/ubuntu-2004-server) 自定义内核的编译方法详见 [compile-kernel](compile-kernel/README.cn.md) +```yaml +- name: Compile the kernel for Amlogic s9xxx + uses: ophub/amlogic-s9xxx-armbian@main + with: + build_target: kernel + kernel_version: 5.15.13_5.4.170 + kernel_auto: true + kernel_sign: -meson64-dev +``` + ## Armbian 贡献者名单 首先感谢 [150balbes](https://github.com/150balbes) 为在 Amlogic 盒子中使用 Armbian 所做出的杰出贡献和奠定的良好基础。这里编译的 [armbian](https://github.com/armbian/build) 系统直接使用了官方当前的最新源码进行实时编译。为不同的盒子制作专用的 Armbian 系统时采用了 [unifreq](https://github.com/unifreq/openwrt_packit) 为 `amlogic s9xxx openwrt` 制作的内核、脚本及 `u-boot` 等资源。程序的开发思路来自 [ebkso](https://www.kflyo.com/howto-compile-armbian-for-n1-box) 等作者的教程。感谢各位的奉献和分享,让我们可以在 Amlogic s9xxx 盒子里使用 Armbian 系统。 diff --git a/README.md b/README.md index 6d65d6bf66..4c636589cd 100644 --- a/README.md +++ b/README.md @@ -191,9 +191,10 @@ sudo apt-get install -y $(curl -fsSL git.io/ubuntu-2004-server) You can use other methods to build the Armbian system. Or use [Armbian](https://armbian.tnahosting.net/dl/) officially provided [lepotato](https://armbian.tnahosting.net/dl/lepotato/archive/) and other branch firmware. and only import the Action from this repository in the process control file [.yml](.github/workflows/rebuild-armbian.yml) to rebuild Armbian to adapt to the use of Amlogic S9xxx series boxes. In the [Action](https://github.com/ophub/amlogic-s9xxx-armbian/actions) page, select ***`Rebuild armbian`***, and enter the Armbian network download url such as `https://dl.armbian.com/*/Armbian_*.img.xz`, or in the process control file [.yml](.github/workflows/rebuild-armbian.yml), set the load path of the rebuild file through the `armbian_path` parameter. code show as below: ```yaml -- name: Rebuild Armbian for Amlogic s9xxx +- name: Rebuild the Armbian for Amlogic s9xxx uses: ophub/amlogic-s9xxx-armbian@main with: + build_target: armbian armbian_path: build/output/images/*.img armbian_soc: s905d_s905x3_s922x_s905x armbian_kernel: 5.15.13_5.4.170 @@ -222,6 +223,16 @@ You can use other methods to build the Armbian system. Or use [Armbian](https:// For the compilation method of the custom kernel, see [compile-kernel](compile-kernel) +```yaml +- name: Compile the kernel for Amlogic s9xxx + uses: ophub/amlogic-s9xxx-armbian@main + with: + build_target: kernel + kernel_version: 5.15.13_5.4.170 + kernel_auto: true + kernel_sign: -meson64-dev +``` + ## Armbian contributor list First of all, I would like to thank [150balbes](https://github.com/150balbes) for his outstanding contributions and a good foundation for using Armbian in the Amlogic box. The [armbian](https://github.com/armbian/build) system compiled here directly uses the latest official source code for real-time compilation, When making dedicated Armbian systems for different boxes, the kernel, scripts, u-boot and other resources made by [unifreq](https://github.com/unifreq/openwrt_packit) for `Amlogic s9xxx openwrt` are used. The development idea of the program comes from the tutorials of authors such as [ebkso](https://www.kflyo.com/howto-compile-armbian-for-n1-box). Thank you for your dedication and sharing, so that we can use the Armbian system in the Amlogic s9xxx box. diff --git a/action.yml b/action.yml index a965440a93..a035c72883 100644 --- a/action.yml +++ b/action.yml @@ -1,11 +1,13 @@ -name: "Rebuild armbian for Amlogic s9xxx tv box" -author: "ophub" +name: "Rebuild armbian and kernel for Amlogic s9xxx tv box" +author: "https://github.com/ophub" description: "Support Amlogic s9xxx tv box are s922x, s905x3, s905x2, s912, s905d, s905x, s905w, s905, etc." inputs: - mode: - description: "Choose script." + # Choose build target + build_target: + description: "Choose build target: armbian / kernel" required: false - default: "ophub" + default: "armbian" + # For build armbian ----- armbian_soc: description: "Set Amlogic SoC." required: false @@ -30,6 +32,23 @@ inputs: description: "Set armbian original file path." required: false default: "build/output/images/*.img" + # For compile kernel ----- + kernel_repo: + description: "select kernel repository" + required: false + default: "unifreq" + kernel_version: + description: "select kernel version" + required: false + default: "5.10.90_5.4.170" + kernel_auto: + description: "Auto use the latest kernel" + required: false + default: "true" + kernel_sign: + description: "Set the kernel custom signature" + required: false + default: "-meson64-dev" runs: using: "composite" @@ -37,59 +56,100 @@ runs: - shell: bash run: | cd ${GITHUB_ACTION_PATH} - echo -e "Armbian rebuild actions path: ${PWD}" + build_target="${{ inputs.build_target }}" + [ -z "${build_target}" ] && build_target="armbian" - armbian_file="${{ inputs.armbian_path }}" - armbian_filepath="build/output/images" - echo -e "Get armbian file input parameters: [ ${armbian_file} ]" - [ -z "${armbian_file}" ] && echo -e "The [ armbian_path ] variable must be specified." && exit 1 - [ -d "${armbian_filepath}" ] || sudo mkdir -p ${armbian_filepath} - if [[ "${armbian_file}" == http* ]]; then - echo -e "Use wget to download file: [ ${armbian_file} ]" - sudo wget ${armbian_file} -q -P ${armbian_filepath} 2>/dev/null - elif [[ "${armbian_file:0:6}" != "build/" && "${armbian_file:0:8}" != "./build/" ]]; then - echo -e "Copy files: [ ${armbian_file} ]" - sudo cp -f ${GITHUB_WORKSPACE}/${armbian_file} ${armbian_filepath} 2>/dev/null - else - echo -e "Use armbian files: [ ${armbian_file} ]" - fi - sync - echo -e "About the ${armbian_filepath} directory: \n $(ls ${armbian_filepath} -l 2>/dev/null)" + if [ "${build_target}" == "armbian" ]; then - cd ${GITHUB_ACTION_PATH}/${armbian_filepath} - echo -e "Check the armbian file format..." - down_file="$(ls . -l 2>/dev/null | grep "^-" | awk '{print $9}' | head -n 1)" - [ -z "${down_file}" ] && echo -e "The [ ${armbian_file} ] is invalid." && exit 1 - [ "${down_file:0-7}" == ".img.gz" ] && sudo gzip -df ${down_file} 2>/dev/null && sync - [ "${down_file:0-7}" == ".img.xz" ] && sudo xz -d ${down_file} 2>/dev/null && sync - [ "${down_file:0-4}" == ".zip" ] && sudo unzip -o ${down_file} 2>/dev/null && sync - echo -e "Armbian file: [ $(ls *.img -l 2>/dev/null) ]" + cd ${GITHUB_ACTION_PATH} + echo -e "Rebuild the armbian actions path: ${PWD}" - cd ${GITHUB_ACTION_PATH} - echo -e "Start to rebuild armbian..." - make_command=" -d" - [ -n ${{ inputs.armbian_soc }} ] && make_command="${make_command} -b ${{ inputs.armbian_soc }}" - [ -n ${{ inputs.armbian_kernel }} ] && make_command="${make_command} -k ${{ inputs.armbian_kernel }}" - [ -n ${{ inputs.version_branch }} ] && make_command="${make_command} -v ${{ inputs.version_branch }}" - [ -n ${{ inputs.auto_kernel }} ] && make_command="${make_command} -a ${{ inputs.auto_kernel }}" - [ -n ${{ inputs.armbian_size }} ] && make_command="${make_command} -s ${{ inputs.armbian_size }}" - sudo chmod +x rebuild - sudo ./rebuild ${make_command} + armbian_file="${{ inputs.armbian_path }}" + armbian_filepath="build/output/images" + echo -e "Get armbian file input parameters: [ ${armbian_file} ]" + [ -z "${armbian_file}" ] && echo -e "The [ armbian_path ] variable must be specified." && exit 1 + [ -d "${armbian_filepath}" ] || sudo mkdir -p ${armbian_filepath} + if [[ "${armbian_file}" == http* ]]; then + echo -e "Use wget to download file: [ ${armbian_file} ]" + sudo wget ${armbian_file} -q -P ${armbian_filepath} 2>/dev/null + elif [[ "${armbian_file:0:6}" != "build/" && "${armbian_file:0:8}" != "./build/" ]]; then + echo -e "Copy files: [ ${armbian_file} ]" + sudo cp -f ${GITHUB_WORKSPACE}/${armbian_file} ${armbian_filepath} 2>/dev/null + else + echo -e "Use armbian files: [ ${armbian_file} ]" + fi + sync + echo -e "About the ${armbian_filepath} directory: \n $(ls ${armbian_filepath} -l 2>/dev/null)" - cd ${GITHUB_ACTION_PATH}/${armbian_filepath} - echo -e "Compress the .img file in the [ ${armbian_filepath} ] directory. \n" - sudo gzip *.img && sync + cd ${GITHUB_ACTION_PATH}/${armbian_filepath} + echo -e "Check the armbian file format..." + down_file="$(ls . -l 2>/dev/null | grep "^-" | awk '{print $9}' | head -n 1)" + [ -z "${down_file}" ] && echo -e "The [ ${armbian_file} ] is invalid." && exit 1 + [ "${down_file:0-7}" == ".img.gz" ] && sudo gzip -df ${down_file} 2>/dev/null && sync + [ "${down_file:0-7}" == ".img.xz" ] && sudo xz -d ${down_file} 2>/dev/null && sync + [ "${down_file:0-4}" == ".zip" ] && sudo unzip -o ${down_file} 2>/dev/null && sync + echo -e "Armbian file: [ $(ls *.img -l 2>/dev/null) ]" - cd ${GITHUB_ACTION_PATH} - echo -e "Output environment variables." - echo "PACKAGED_OUTPUTPATH=${PWD}/${armbian_filepath}" >> $GITHUB_ENV - echo "PACKAGED_OUTPUTDATE=$(date +"%Y.%m.%d.%H%M")" >> $GITHUB_ENV - echo "PACKAGED_STATUS=success" >> $GITHUB_ENV - echo -e "PACKAGED_OUTPUTPATH: ${PWD}/${armbian_filepath}" - echo -e "PACKAGED_OUTPUTDATE: $(date +"%Y.%m.%d.%H%M")" - echo -e "PACKAGED_STATUS: success" - echo -e "PACKAGED_OUTPUTPATH files list:" - echo -e "$(ls ${PWD}/${armbian_filepath} 2>/dev/null) \n" + cd ${GITHUB_ACTION_PATH} + echo -e "Start to rebuild armbian..." + make_command=" -d" + [ -n ${{ inputs.armbian_soc }} ] && make_command="${make_command} -b ${{ inputs.armbian_soc }}" + [ -n ${{ inputs.armbian_kernel }} ] && make_command="${make_command} -k ${{ inputs.armbian_kernel }}" + [ -n ${{ inputs.version_branch }} ] && make_command="${make_command} -v ${{ inputs.version_branch }}" + [ -n ${{ inputs.auto_kernel }} ] && make_command="${make_command} -a ${{ inputs.auto_kernel }}" + [ -n ${{ inputs.armbian_size }} ] && make_command="${make_command} -s ${{ inputs.armbian_size }}" + sudo chmod +x rebuild + sudo ./rebuild ${make_command} + + cd ${GITHUB_ACTION_PATH}/${armbian_filepath} + echo -e "The armbian files in the [ ${armbian_filepath} ] directory. \n" + sudo gzip *.img && sync + + cd ${GITHUB_ACTION_PATH} + echo -e "Output environment variables." + echo "PACKAGED_OUTPUTPATH=${PWD}/${armbian_filepath}" >> $GITHUB_ENV + echo "PACKAGED_OUTPUTDATE=$(date +"%Y.%m.%d.%H%M")" >> $GITHUB_ENV + echo "PACKAGED_STATUS=success" >> $GITHUB_ENV + echo -e "PACKAGED_OUTPUTPATH: ${PWD}/${armbian_filepath}" + echo -e "PACKAGED_OUTPUTDATE: $(date +"%Y.%m.%d.%H%M")" + echo -e "PACKAGED_STATUS: success" + echo -e "PACKAGED_OUTPUTPATH files list:" + echo -e "$(ls ${PWD}/${armbian_filepath} 2>/dev/null) \n" + + elif [ "${build_target}" == "kernel" ]; then + + cd ${GITHUB_ACTION_PATH} + echo -e "Compile the kernel actions path: ${PWD}" + + make_command=" -d" + [ -n ${{ inputs.kernel_repo }} ] && make_command="${make_command} -r ${{ inputs.kernel_repo }}" + [ -n ${{ inputs.kernel_version }} ] && make_command="${make_command} -k ${{ inputs.kernel_version }}" + [ -n ${{ inputs.kernel_auto }} ] && make_command="${make_command} -a ${{ inputs.kernel_auto }}" + [ -n ${{ inputs.kernel_sign }} ] && make_command="${make_command} -n ${{ inputs.kernel_sign }}" + sudo chmod +x recompile + sudo ./recompile ${make_command} + + kernel_filepath="compile-kernel/output" + echo -e "The kernel files in the [ ${kernel_filepath} ] directory. \n" + + cd ${GITHUB_ACTION_PATH} + output_tags="$(ls ${PWD}/${kernel_filepath}/*.tar.gz -l | awk '{print $9}' | grep -oE '[1-9].[0-9]{1,3}.[0-9]+' | xargs | tr "[ ]" "_")" + echo -e "Output environment variables." + echo "PACKAGED_OUTPUTTAGS=${output_tags}" >> $GITHUB_ENV + echo "PACKAGED_OUTPUTPATH=${PWD}/${kernel_filepath}" >> $GITHUB_ENV + echo "PACKAGED_OUTPUTDATE=$(date +"%Y.%m.%d.%H%M")" >> $GITHUB_ENV + echo "PACKAGED_STATUS=success" >> $GITHUB_ENV + echo -e "PACKAGED_OUTPUTTAGS: ${output_tags}" + echo -e "PACKAGED_OUTPUTPATH: ${PWD}/${kernel_filepath}" + echo -e "PACKAGED_OUTPUTDATE: $(date +"%Y.%m.%d.%H%M")" + echo -e "PACKAGED_STATUS: success" + echo -e "PACKAGED_OUTPUTPATH files list:" + echo -e "$(ls ${PWD}/${kernel_filepath} 2>/dev/null) \n" + + else + echo -e "Please select a build target: armbian / kernel" + exit 1 + fi branding: icon: "terminal" diff --git a/compile-kernel/README.cn.md b/compile-kernel/README.cn.md index 9229d7f0a2..fae352e490 100644 --- a/compile-kernel/README.cn.md +++ b/compile-kernel/README.cn.md @@ -4,7 +4,7 @@ 根据需要,编译自定义内核。此内核可用于 [Armbian](https://github.com/ophub/amlogic-s9xxx-armbian) 和 [OpenWrt](https://github.com/ophub/amlogic-s9xxx-openwrt) 系统,在以 [unifreq](https://github.com/unifreq/openwrt_packit) 标准制作的同类系统中可通用。 -## 编译命令说明 +## 本地编译命令说明 | 参数 | 含义 | 说明 | | ---- | ---- | ---- | @@ -44,6 +44,39 @@ sudo apt-get install -y $(curl -fsSL git.io/ubuntu-2004-server) 2. 在 [Action](https://github.com/ophub/amlogic-s9xxx-armbian/actions) 页面里选择 ***`Compile the armbian kernel`*** ,点击 ***`Run workflow`*** 按钮即可编译。 +- ### 仅单独引入 GitHub Action 编译内核 + +可以在你的 github.com 仓库中通过 Actions 调用本仓库的内核编译脚本,制作个性化内核。详见使用模板 [compile-kernel.yml](https://github.com/ophub/amlogic-s9xxx-openwrt/blob/main/.github/workflows/compile-kernel.yml) 。代码如下: + +```yaml +- name: Compile the kernel for Amlogic s9xxx + uses: ophub/amlogic-s9xxx-armbian@main + with: + build_target: kernel + kernel_version: 5.15.13_5.4.170 + kernel_auto: true + kernel_sign: -meson64-dev +``` + +- GitHub Action 输入参数说明 + +| 参数 | 默认值 | 说明 | +|------------------------|------------------------|------------------------------------------------| +| build_target | kernel | 固定参数 `kernel`,设置编译目标为内核。 | +| kernel_repo | unifreq | 指定编译内核的源代码仓库。默认为 `unifreq` 。可选择 `kernel.org` 的源码和 `github.com` 的内核源代码仓库。例如 `kernel.org` 或 `unifreq` 或 `chewitt/linux@amlogic-5.4.y` 。当使用 `github.com` 的内核源代码仓库时,可设置参数格式为 `owner/repo@branch` 三项组合,参数中的所有者名称 `owner` 为必选参数,内核源代码仓库名称 `/repo` 和 仓库的分支名称 `@branch` 为可选参数。当仅指定所有者名称 `owner` 参数时,将自动匹配所有者的名称为 `linux-5.x.y` 格式且分支为 `main` 的内核源代码仓库。如果仓库名称或分支名称不同,请使用组合方式指定,如 `owner@branch` 或 `owner/repo` 或 `owner/repo@branch` | +| kernel_version | 5.15.13_5.4.170 | 指定 [kernel](https://cdn.kernel.org/pub/linux/kernel/v5.x/) 名称,如 `5.4.170` . 多个内核使用 `_` 进行连接,如 `5.15.13_5.4.170` | +| kernel_auto | true | 设置是否自动采用同系列最新版本内核。当为 `true` 时,将自动查找在指定的内核如 `5.4.170` 的 `5.4` 同系列是否有更新的版本,如有 `5.4.170` 之后的最新版本时,将自动更换为最新版。设置为 `false` 时将编译指定版本内核。默认值:`true` | +| kernel_sign | -meson64-dev | 设置内核自定义签名。默认值为 `-meson64-dev` ,生成的内核名称为 `5.4.170-meson64-dev` 。设置自定义签名时请勿包含空格。 | + +- GitHub Action 输出变量说明 + +| 参数 | 默认值 | 说明 | +|-----------------------------------|------------------------------|---------------------------| +| ${{ env.PACKAGED_OUTPUTTAGS }} | 5.15.13_5.4.170 | 编译好的内核的名称 | +| ${{ env.PACKAGED_OUTPUTPATH }} | ${PWD}/compile-kernel/output | 编译完成的内核所在文件夹的路径 | +| ${{ env.PACKAGED_OUTPUTDATE }} | 2021.04.13.1058 | 编译日期 | +| ${{ env.PACKAGED_STATUS }} | success / failure | 编译状态。成功 / 失败 | + ## 其他说明 1. 内核编译文件检查的优先级:如果 `compile-kernel/kernel` 目录下有指定内核的文件夹如 `linux-5.4.170` 时,将使用本地源码进行编译;当没有指定内核的文件夹,但有指定内核的压缩文件如 linux-5.4.170.tar.xz 时,将自动解压并进行编译;当本地没有指定内核时,将自动从服务器下载并编译。 diff --git a/compile-kernel/README.md b/compile-kernel/README.md index a7503fae8e..c6cacb84ce 100644 --- a/compile-kernel/README.md +++ b/compile-kernel/README.md @@ -4,7 +4,7 @@ View Chinese description | [查看中文说明](README.cn.md) Compile a custom kernel as needed. This kernel can be used in [Armbian](https://github.com/ophub/amlogic-s9xxx-armbian) and [OpenWrt](https://github.com/ophub/amlogic-s9xxx-openwrt) systems. Commonly used in systems made with the [unifreq](https://github.com/unifreq/openwrt_packit) standard. -## Compile command description +## Local compile command description | Parameter | Meaning | Description | | ---- | ---- | ---- | @@ -44,6 +44,40 @@ sudo apt-get install -y $(curl -fsSL git.io/ubuntu-2004-server) 2. Select ***`Compile Armbian For Amlogic`*** on the [Action](https://github.com/ophub/amlogic-s9xxx-armbian/actions) page. Click the ***`Run workflow`*** button. +- ### Only import GitHub Action to compile the kernel + +You can call the kernel compilation script of this repository through Actions in your github.com repository to make a personalized kernel. For details, see Using Templates [compile-kernel.yml](https://github.com/ophub/amlogic-s9xxx-openwrt/blob/main/.github/workflows/compile-kernel.yml). The code is as follows: + +```yaml +- name: Compile the kernel for Amlogic s9xxx + uses: ophub/amlogic-s9xxx-armbian@main + with: + build_target: kernel + kernel_version: 5.15.13_5.4.170 + kernel_auto: true + kernel_sign: -meson64-dev +``` + +- GitHub Action Input parameter description + +| Parameter | Meaning | Description | +| ---- | ---- | ---- | +| build_target | kernel | Fixed parameter `kernel`, set the compilation target to the kernel. | +| kernel_repo | unifreq | Specifies the source code repository for the compiled kernel. Defaults to `unifreq` . You can choose the source code of `kernel.org` and the kernel source of `github.com` code repository. For example `kernel.org` or `unifreq` or `chewitt/linux@amlogic-5.4.y` . When using the kernel source code repository of `github.com`, the parameter format can be set to the three-item combination of `owner/repo@branch` , The owner name `owner` in the parameters is a required parameter, the kernel source code repository name `/repo` and the repository branch name `@branch` are optional parameters. When only the owner name `owner` parameter is specified, it will automatically match kernel source code repositories whose owner's name is in `linux-5.x.y` format and branch is `main`. If the repository name or branch name is different, use a combination, such as `owner@branch` or `owner/repo` or `owner/repo@branch` | +| kernel_version | 5.15.13_5.4.170 | Specify [kernel](https://cdn.kernel.org/pub/linux/kernel/v5.x/) name, such as `5.4.170`. Multiple kernels use `_` to connect, such as `5.15.13_5.4.170` | +| kernel_auto | true | Set whether to automatically adopt the latest version of the kernel of the same series. When it is `true`, it will automatically find whether there is a newer version of the kernel such as `5.4.170` of the `5.4` series. If there is the latest version after `5.4.170`, it will be automatically replaced with the latest version . When set to `false`, the specified version of the kernel will be compiled. Default value: `true` | +| kernel_sign | -meson64-dev | Set the kernel custom signature. The default value is `-meson64-dev` and the generated kernel is `5.4.170-meson64-dev`. Do not include spaces when setting a custom signature. | + + +- GitHub Action Output variable description + +| Parameter | For example | Description | +|-----------------------------------|------------------------------|---------------------------| +| ${{ env.PACKAGED_OUTPUTTAGS }} | 5.15.13_5.4.170 | The name of the compiled kernel | +| ${{ env.PACKAGED_OUTPUTPATH }} | ${PWD}/compile-kernel/output | kernel files storage path | +| ${{ env.PACKAGED_OUTPUTDATE }} | 2021.04.13.1058 | compile date | +| ${{ env.PACKAGED_STATUS }} | success | Compile status. success / failure | + ## Other instructions 1. Priority of kernel compilation file inspection: If there is a folder of the specified kernel in the `compile-kernel/kernel` directory, such as `linux-5.4.170`, the local source code will be used for compilation; when there is no specified kernel folder, but there is a compressed file of the specified kernel, such as linux -5.4.170.tar.xz, it will be automatically decompressed and compiled; when no kernel is specified locally, it will be automatically downloaded and compiled from the server.