Skip to content
This repository was archived by the owner on Oct 12, 2025. It is now read-only.

Commit 668d372

Browse files
committed
b4s4: speed up the build
* Use container by Tedomi * use --depth=1 Signed-off-by: Onelots <onelots@onelots.fr>
1 parent 5005c05 commit 668d372

2 files changed

Lines changed: 67 additions & 51 deletions

File tree

.github/workflows/kernel_build_b4s4.yml

Lines changed: 32 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
jobs:
1313
build:
1414
runs-on: ubuntu-22.04
15+
container: ghcr.io/tedomi2705/kernel_builder_image:latest
1516

1617
steps:
1718

@@ -20,7 +21,7 @@ jobs:
2021

2122
- name: ⚡ Checkout kernel's sourcecode and clone submodules
2223
run: |
23-
git clone https://github.com/Evolution-X-Devices/kernel_google_b4s4 -b vic
24+
git clone --depth=1 https://github.com/Evolution-X-Devices/kernel_google_b4s4 -b vic
2425
2526
- name: 📅 Export date of build
2627
run: |
@@ -30,59 +31,18 @@ jobs:
3031
run: |
3132
cd kernel_google_b4s4
3233
rm -rf KernelSU-Next
33-
git clone https://github.com/KernelSU-Next/KernelSU-Next -b v1.0.5
34+
git clone --depth=1 https://github.com/KernelSU-Next/KernelSU-Next -b v1.0.5
3435
3536
- name: 📥 Clone AnyKernel3
3637
run: |
3738
cd kernel_google_b4s4
38-
git clone -b b4s4 https://github.com/Oneloutre/AnyKernel3.git anykernel
39+
git clone --depth=1 -b b4s4 https://github.com/Oneloutre/AnyKernel3.git anykernel
3940
rm -rf anykernel/.git
40-
41-
- name: 📦 Install dépendencies
42-
run: |
43-
sudo apt-get update -y -qq
44-
sudo apt-get install -y --no-install-recommends \
45-
python3-pip \
46-
git \
47-
zip \
48-
unzip \
49-
gcc \
50-
g++ \
51-
make \
52-
ninja-build \
53-
file \
54-
bc \
55-
bison \
56-
flex \
57-
libfl-dev \
58-
libssl-dev \
59-
libelf-dev \
60-
wget \
61-
build-essential \
62-
python3-dev \
63-
python3-setuptools \
64-
rsync \
65-
ccache \
66-
llvm-dev
67-
sudo apt install flex libncurses6 libncurses5 binutils-aarch64-linux-gnu device-tree-compiler \
68-
android-sdk-libsparse-utils
69-
sudo apt install -y gcc-arm-linux-gnueabi
70-
echo "CROSS_COMPILE_ARM32=arm-linux-gnueabi-" >> $GITHUB_ENV
71-
72-
- name: 🔧 Install Clang from a Github action
73-
uses: KyleMayes/install-llvm-action@v2
74-
with:
75-
version: "18.1.8"
76-
directory: ${{ runner.temp }}/llvm
77-
78-
- name: 🔧 Add Clang to the PATH
79-
run: |
80-
echo "${{ runner.temp }}/llvm/bin" >> $GITHUB_PATH
8141
8242
- name: 🛠 Use repo's mkdtimg
8343
run: |
8444
chmod +x tools/mkdtimg
85-
sudo mv tools/mkdtimg /usr/local/bin/mkdtimg
45+
mv tools/mkdtimg /usr/local/bin/mkdtimg
8646
8747
- name: 🔍 Device's codename and kernel's version
8848
run: |
@@ -101,6 +61,13 @@ jobs:
10161
with:
10262
max-size: 7G
10363

64+
- name: 📦 Install dependencies
65+
run: |
66+
apt-get update
67+
apt-get install -y \
68+
device-tree-compiler \
69+
lz4
70+
10471
- name: 🛠️ Build the kramel
10572
run: |
10673
cd kernel_google_b4s4
@@ -160,11 +127,25 @@ jobs:
160127
draft: false
161128
prerelease: false
162129

163-
- name: 🚀 Notify people on Discord
164-
env:
165-
DEVICE_CODENAME: ${{ env.DEVICE_CODENAME }}
166-
KERNEL_VERSION: ${{ env.KERNEL_VERSION }}
130+
notification:
131+
runs-on: ubuntu-22.04
132+
needs: build
133+
steps:
134+
135+
- name: 📂 Checkout builder's sourcecode and get files
136+
uses: actions/checkout@v4
137+
138+
- name: 📅 Export date of build
139+
run: |
140+
echo "DATE=$(date +%d%m%Y)" >> $GITHUB_ENV
141+
142+
- name: 🚀 Notify people on Discord
143+
env:
144+
DEVICE_CODENAME: sargo-bonito
145+
KERNEL_VERSION: 4.9
167146
WEBHOOK: ${{ secrets.WEBHOOK }}
168-
NAME: ${{ env.ZIP_NAME }}
169-
run: |
147+
NAME: Kernel-Caelum-sargo-bonito-4.9-${{ env.DATE }}.zip"
148+
run: |
170149
python3 .github/webhook.py
150+
151+

build.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
3+
# Usage: ./build.sh <device_codename>
4+
5+
DEVICE_CODENAME=$1
6+
7+
if [ -z "$DEVICE_CODENAME" ]; then
8+
echo "Error: Device codename not provided"
9+
echo "Usage: ./build.sh <device_codename>"
10+
exit 1
11+
fi
12+
13+
cd kernel_google_b4s4
14+
15+
# Export required variables
16+
export ARCH=arm64
17+
export SUBARCH=arm64
18+
export KBUILD_COMPILER_STRING=$(clang --version | head -n 1)
19+
export CCACHE_EXEC=$(which ccache)
20+
export KBUILD_BUILD_HOST="Caelum-Github-actions-Onelots"
21+
22+
# Configure kernel
23+
make O=out ARCH=arm64 bonito_defconfig vendor/kernelsu.config V=1
24+
make O=out ARCH=arm64 olddefconfig
25+
./scripts/config --file out/.config -e CONFIG_BUILD_ARM64_APPENDED_DTB_IMAGE
26+
27+
# Build kernel
28+
make -j$(nproc --all) O=out \
29+
ARCH=arm64 \
30+
CC="ccache clang" \
31+
LLVM=1 \
32+
LLVM_IAS=1 \
33+
CLANG_TRIPLE=aarch64-linux-gnu- \
34+
CROSS_COMPILE=aarch64-linux-android- \
35+
CROSS_COMPILE_ARM32=arm-linux-androideabi-

0 commit comments

Comments
 (0)