Add support for ChromeOS ARM64 ARCVM (#1642)
1. Add support for ChromeOS ARM64 ARCVM. 2. Optimization of intermediate variable naming. 3. Optimization of kernel version acquisition logic for file names, obtaining the kernel version directly from Makefile.
This commit is contained in:
48
.github/workflows/build-kernel-arcvm.yml
vendored
48
.github/workflows/build-kernel-arcvm.yml
vendored
@@ -13,17 +13,23 @@ on:
|
|||||||
workflow_call:
|
workflow_call:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
git_tag: chromeos-5.10-arcvm
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
if: github.event_name != 'pull_request' || (github.event_name == 'pull_request' && !github.event.pull_request.draft)
|
if: github.event_name != 'pull_request' || (github.event_name == 'pull_request' && !github.event.pull_request.draft)
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
arch: [x86_64]
|
|
||||||
version: ["5.10.213"]
|
|
||||||
include:
|
include:
|
||||||
- arch: x86_64
|
- arch: x86_64
|
||||||
git_tag: chromeos-5.10-arcvm
|
kernel_image_name: bzImage
|
||||||
file_name: "bzImage"
|
build_config: build.config.gki.x86_64
|
||||||
|
defconfig: x86_64_arcvm_defconfig
|
||||||
|
- arch: arm64
|
||||||
|
kernel_image_name: Image
|
||||||
|
build_config: build.config.gki.aarch64
|
||||||
|
defconfig: arm64_arcvm_defconfig
|
||||||
|
|
||||||
name: Build ChromeOS ARCVM kernel
|
name: Build ChromeOS ARCVM kernel
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
@@ -66,7 +72,16 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup kernel source
|
- name: Setup kernel source
|
||||||
run: git clone https://chromium.googlesource.com/chromiumos/third_party/kernel.git -b ${{ matrix.git_tag }} --depth=1
|
run: git clone https://chromium.googlesource.com/chromiumos/third_party/kernel.git -b ${{ env.git_tag }} --depth=1
|
||||||
|
|
||||||
|
- name: Extract version from Makefile
|
||||||
|
working-directory: kernel
|
||||||
|
run: |
|
||||||
|
VERSION=$(grep -E '^VERSION = ' Makefile | awk '{print $3}')
|
||||||
|
PATCHLEVEL=$(grep -E '^PATCHLEVEL = ' Makefile | awk '{print $3}')
|
||||||
|
SUBLEVEL=$(grep -E '^SUBLEVEL = ' Makefile | awk '{print $3}')
|
||||||
|
echo "ChromeOS ARCVM Linux kernel version: $VERSION.$PATCHLEVEL.$SUBLEVEL"
|
||||||
|
echo "version=$VERSION.$PATCHLEVEL.$SUBLEVEL" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Setup KernelSU
|
- name: Setup KernelSU
|
||||||
working-directory: kernel
|
working-directory: kernel
|
||||||
@@ -89,15 +104,18 @@ jobs:
|
|||||||
|
|
||||||
echo "[+] KernelSU setup done."
|
echo "[+] KernelSU setup done."
|
||||||
cd $GITHUB_WORKSPACE/KernelSU
|
cd $GITHUB_WORKSPACE/KernelSU
|
||||||
VERSION=$(($(git rev-list --count HEAD) + 10200))
|
KSU_VERSION=$(($(git rev-list --count HEAD) + 10200))
|
||||||
echo "VERSION: $VERSION"
|
echo "KernelSU version: $KSU_VERSION"
|
||||||
echo "kernelsu_version=$VERSION" >> $GITHUB_ENV
|
echo "kernelsu_version=$KSU_VERSION" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Build Kernel
|
- name: Build Kernel
|
||||||
working-directory: kernel
|
working-directory: kernel
|
||||||
|
env:
|
||||||
|
KERNEL_IMAGE_NAME: ${{ matrix.kernel_image_name }}
|
||||||
|
ARCH: ${{ matrix.arch }}
|
||||||
run: |
|
run: |
|
||||||
set -a && . build.config.gki.x86_64; set +a
|
set -a && . ${{ matrix.build_config }}; set +a
|
||||||
export DEFCONFIG=x86_64_arcvm_defconfig
|
export DEFCONFIG=${{ matrix.defconfig }}
|
||||||
if [ ! -z ${{ vars.EXPECTED_SIZE }} ] && [ ! -z ${{ vars.EXPECTED_HASH }} ]; then
|
if [ ! -z ${{ vars.EXPECTED_SIZE }} ] && [ ! -z ${{ vars.EXPECTED_HASH }} ]; then
|
||||||
export KSU_EXPECTED_SIZE=${{ vars.EXPECTED_SIZE }}
|
export KSU_EXPECTED_SIZE=${{ vars.EXPECTED_SIZE }}
|
||||||
export KSU_EXPECTED_HASH=${{ vars.EXPECTED_HASH }}
|
export KSU_EXPECTED_HASH=${{ vars.EXPECTED_HASH }}
|
||||||
@@ -106,12 +124,12 @@ jobs:
|
|||||||
make LLVM=1 LLVM_IAS=1 DEPMOD=depmod DTC=dtc O=${PWD} mrproper
|
make LLVM=1 LLVM_IAS=1 DEPMOD=depmod DTC=dtc O=${PWD} mrproper
|
||||||
make LLVM=1 LLVM_IAS=1 DEPMOD=depmod DTC=dtc O=${PWD} ${DEFCONFIG} < /dev/null
|
make LLVM=1 LLVM_IAS=1 DEPMOD=depmod DTC=dtc O=${PWD} ${DEFCONFIG} < /dev/null
|
||||||
scripts/config --file .config -e LTO_CLANG -d LTO_NONE -e LTO_CLANG_THIN -d LTO_CLANG_FULL -e THINLTO
|
scripts/config --file .config -e LTO_CLANG -d LTO_NONE -e LTO_CLANG_THIN -d LTO_CLANG_FULL -e THINLTO
|
||||||
make LLVM=1 LLVM_IAS=1 DEPMOD=depmod DTC=dtc O=${PWD} -j$(nproc) bzImage modules prepare-objtool
|
make LLVM=1 LLVM_IAS=1 DEPMOD=depmod DTC=dtc O=${PWD} -j$(nproc) ${KERNEL_IMAGE_NAME} modules prepare-objtool
|
||||||
|
ls -l -h ${PWD}/arch/${ARCH}/boot
|
||||||
|
echo "file_path=${PWD}/arch/${ARCH}/boot/${KERNEL_IMAGE_NAME}" >> $GITHUB_ENV
|
||||||
|
|
||||||
echo "file_path=${PWD}/arch/x86/boot/bzImage" >> $GITHUB_ENV
|
- name: Upload kernel-ARCVM-${{ matrix.arch }}-${{ env.version }}
|
||||||
|
|
||||||
- name: Upload kernel-ARCVM-${{ matrix.arch }}-${{ matrix.version }}
|
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: kernel-ARCVM-${{ matrix.arch }}-${{ matrix.version }}
|
name: kernel-ARCVM-${{ matrix.arch }}-${{ env.version }}
|
||||||
path: "${{ env.file_path }}"
|
path: "${{ env.file_path }}"
|
||||||
Reference in New Issue
Block a user