-
Notifications
You must be signed in to change notification settings - Fork 19
184 lines (147 loc) · 7.39 KB
/
build-kernel-a15-zumapro.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
name: Build A15 Zuma Pro Kernel
on:
workflow_dispatch:
workflow_call: # This allows this workflow to be called from another workflow
jobs:
build-kernel-a15-zumapro-kernelsu-susfs:
runs-on: ubuntu-latest
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 8192
temp-reserve-mb: 2048
swap-size-mb: 8192
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
- name: Installing dependencies
run: |
sudo apt install -y gcc-aarch64-linux-gnu
- name: Set CONFIG Environment Variable
run: |
CONFIG="android_kernel_google_zumapro"
# Set CONFIG as an environment variable for future steps
echo "CONFIG=$CONFIG" >> $GITHUB_ENV
echo "CONFIG set to: $CONFIG"
- name: Clone AnyKernel3 and Other Dependencies
run: |
echo "Cloning AnyKernel3 and other dependencies..."
# Define the branch names using the matrix values
ANYKERNEL_BRANCH="15.0.0-sultan-zumapro"
SUSFS_BRANCH="gki-android14-6.1"
# Debug print the branches
echo "Using branch for AnyKernel3: $ANYKERNEL_BRANCH"
echo "Using branch for SUSFS: $SUSFS_BRANCH"
# Clone repositories using the branch names
git clone https://github.com/TheWildJames/AnyKernel3.git -b "$ANYKERNEL_BRANCH"
git clone https://gitlab.com/simonpunk/susfs4ksu.git -b "$SUSFS_BRANCH"
git clone https://github.com/TheWildJames/kernel_patches.git
git clone https://github.com/kerneltoast/android_kernel_google_zumapro
- name: Add KernelSU
run: |
echo "Changing to configuration directory: $CONFIG..."
cd "$CONFIG"
echo "Adding KernelSU..."
curl -LSs "https://raw.githubusercontent.com/rifsxd/KernelSU-Next/next/kernel/setup.sh" | bash -
- name: Apply SUSFS Patches
run: |
echo "Changing to configuration directory: $CONFIG..."
cd "$CONFIG"
echo "Applying SUSFS patches..."
# Copy SUSFS patches
cp ../susfs4ksu/kernel_patches/50_add_susfs_in_gki-android14-6.1.patch ./
cp ../susfs4ksu/kernel_patches/fs/* ./fs/
cp ../susfs4ksu/kernel_patches/include/linux/* ./include/linux/
cd ./KernelSU-Next
echo "Applying next SUSFS patches..."
cp ../../kernel_patches/0001-kernel-patch-susfs-v1.5.5-to-KernelSU-Next-v1.0.5.patch ./
patch -p1 --forward < 0001-kernel-patch-susfs-v1.5.5-to-KernelSU-Next-v1.0.5.patch || true
# Change to common directory and apply SUSFS patch
cd ..
patch -p1 < 50_add_susfs_in_gki-android14-6.1.patch || true
- name: Apply KSU Hooks
run: |
echo "Changing to configuration directory: $CONFIG..."
cd "$CONFIG"
# Apply additional patch
cp ../kernel_patches/new_hooks.patch ./
patch -p1 --fuzz=3 < ./new_hooks.patch
- name: Apply Hide Stuff Patches
run: |
echo "Changing to configuration directory: $CONFIG..."
cd "$CONFIG"
# Apply additional patch
cp ../kernel_patches/69_hide_stuff.patch ./
patch -p1 -F 3 < 69_hide_stuff.patch
- name: Apply KernelSU & SUSFS SUltan Fixes
run: |
echo "Changing to configuration directory: $CONFIG..."
cd "$CONFIG"
# Apply additional patch
cp ../kernel_patches/sys.c_fix.patch ./
patch -p1 --fuzz=3 < ./sys.c_fix.patch
sed -i "s/poofed_size: '%u'/poofed_size: '%llu'/g" ./fs/susfs.c
sed -i "s/length of string: %u/length of string: %lu/g" ./fs/susfs.c
- name: Add SUSFS Configuration Settings
run: |
echo "Changing to configuration directory: $CONFIG..."
cd "$CONFIG"
echo "Adding configuration settings to zumapro_defconfig..."
# Add SUSFS configuration settings
echo "CONFIG_KSU=y" >> ./arch/arm64/configs/zuma_defconfig
echo "CONFIG_KSU_SUSFS=y" >> ./arch/arm64/configs/zumapro_defconfig
echo "CONFIG_KSU_SUSFS_HAS_MAGIC_MOUNT=y" >> ./arch/arm64/configs/zumapro_defconfig
echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./arch/arm64/configs/zumapro_defconfig
echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./arch/arm64/configs/zumapro_defconfig
echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_KSU_DEFAULT_MOUNT=y" >> ./arch/arm64/configs/zumapro_defconfig
echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_BIND_MOUNT=y" >> ./arch/arm64/configs/zumapro_defconfig
echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./arch/arm64/configs/zumapro_defconfig
echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./arch/arm64/configs/zumapro_defconfig
echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./arch/arm64/configs/zumapro_defconfig
echo "CONFIG_KSU_SUSFS_AUTO_ADD_TRY_UMOUNT_FOR_BIND_MOUNT=y" >> ./arch/arm64/configs/zumapro_defconfig
echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./arch/arm64/configs/zumapro_defconfig
echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./arch/arm64/configs/zumapro_defconfig
echo "CONFIG_KSU_SUSFS_HIDE_KSU_SUSFS_SYMBOLS=y" >> ./arch/arm64/configs/zumapro_defconfig
echo "CONFIG_KSU_SUSFS_SPOOF_CMDLINE_OR_BOOTCONFIG=y" >> ./arch/arm64/configs/zumapro_defconfig
echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./arch/arm64/configs/zumapro_defconfig
echo "CONFIG_KSU_SUSFS_SUS_SU=n" >> ./arch/arm64/configs/zumapro_defconfig
# Add additional tmpfs config setting
echo "CONFIG_TMPFS_XATTR=y" >> ./arch/arm64/configs/zumapro_defconfig
echo "CONFIG_TMPFS_POSIX_ACL=y" >> ./arch/arm64/configs/zumapro_defconfig
- name: Run sed and perl Commands
run: |
echo "Changing to configuration directory: $CONFIG..."
cd "$CONFIG"
echo "Running sed commands..."
sed -i 's/CONFIG_LOCALVERSION="-Sultan"/CONFIG_LOCALVERSION="-Sultan-Wild+"/' ./arch/arm64/configs/zumapro_defconfig
- name: Build the Kernel
run: |
echo "Changing to configuration directory: $CONFIG..."
cd "$CONFIG"
echo "ARCH=arm64" >> $GITHUB_ENV
echo "Building the kernel..."
make zumapro_defconfig -j$(nproc --all)
make -j$(nproc --all)
- name: Copy Images
run: |
echo "Changing to configuration directory: $CONFIG..."
cd "$CONFIG"
echo "Copying Image.lz4 and concatenating DTB files..."
cp ./out/arch/arm64/boot/Image.lz4 ../AnyKernel3/Image.lz4
cat ./out/google-modules/soc/gs/arch/arm64/boot/dts/google/*.dtb > ../AnyKernel3/dtb
- name: Create ZIP Files for Different Formats
run: |
echo "Navigating to AnyKernel3 directory..."
cd ./AnyKernel3
# Zip the files in the AnyKernel3 directory with a new naming convention
ZIP_NAME="A15_Sultan_KernelSU_SUSFS_ZumaPro.zip"
echo "Creating zip file $ZIP_NAME..."
zip -r "../$ZIP_NAME" ./*
- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
name: kernel-zumapro
path: |
*.zip