forked from natsumerinchan/KernelSU_Oneplus_martini_Guide
-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (102 loc) · 4.04 KB
/
eva-kernel.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
name: Eva Kernel
on:
workflow_dispatch:
inputs:
RELEASE_CONFIG:
description: 'Upload to Releases'
required: true
default: "true"
type: boolean
KERNELSU_CONFIG:
description: 'Compile KernelSU'
required: true
default: "true"
type: boolean
KERNELSU_TAG:
description: 'Choose KernelSU branch or tag'
required: false
default: "main"
type: string
CCACHE_CONFIG:
description: 'Use Ccache'
required: true
default: "true"
type: boolean
jobs:
build-martini-clang:
runs-on: ubuntu-latest
steps:
- name: Setup repo
run: sudo apt update -y && sudo apt install -y repo elfutils libarchive-tools
- name: Repo sync
run: |
repo init -u https://github.com/mvaisakh/android_kernel_manifest -b eva-oneplus-5.4 --depth=1
repo sync --no-tags --no-clone-bundle -j$(nproc --all)
echo "TAG_NAME=$(date -u +%d%m%Y%I%M)" >> $GITHUB_ENV
- name: Sync Clang
run: |
mkdir -p prebuilts-master/clang/host/linux-x86/clang-r450784d/
cd prebuilts-master/clang/host/linux-x86/clang-r450784d/
curl -LO "https://raw.githubusercontent.com/Neutron-Toolchains/antman/main/antman"
bash antman -S=latest
bash antman --patch=glibc
- name: Setup KernelSU
if: github.event.inputs.KERNELSU_CONFIG == 'true'
run: |
cd $GITHUB_WORKSPACE/kernel/msm-5.4
curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s "${{ github.event.inputs.KERNELSU_TAG }}"
wget https://gist.githubusercontent.com/natsumerinchan/cebf0d64ea10a5deecec74fb7803d72a/raw/f9b6539e81ec6e97792f16c4a68b25752e43ba47/0001-kallsyms-strip-LTO-suffixes-from-static-functions.patch
git apply ./0001-kallsyms-strip-LTO-suffixes-from-static-functions.patch
about_kprobe="
CONFIG_MODULES=y
CONFIG_KPROBES=y
CONFIG_HAVE_KPROBES=y
CONFIG_TRACING_SUPPORT=y
CONFIG_FTRACE=y
CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
CONFIG_KPROBE_EVENTS=y
"
for config_name in $about_kprobe
do
printf "\n$config_name\n" >> "arch/arm64/configs/vendor/lahaina_NQGKI.config"
done
- name: Setup ccache
if: github.event.inputs.CCACHE_CONFIG == 'true'
uses: hendrikmuhs/[email protected]
with:
key: eva-martini-clang
max-size: 2G
save: true
- name: Apply ccache patch
if: github.event.inputs.CCACHE_CONFIG == 'true'
run: |
cd $GITHUB_WORKSPACE/kernel/msm-5.4
wget https://gist.githubusercontent.com/natsumerinchan/77d5ad9ea42b5a1b4667de9f54c69d8e/raw/03cbe567e798cef5261f551668310067a878ffef/0003-Makefile-Use-CCACHE-for-faster-compilation.patch
git apply ./0003-Makefile-Use-CCACHE-for-faster-compilation.patch
- name: Clang Build
run: |
sed -i s/build-user/mvaisakh/g build/_setup_env.sh
sed -i s/build-host/statixos/g build/_setup_env.sh
CCACHE="/usr/bin/ccache" BUILD_CONFIG=kernel/msm-5.4/build.config.msm.lahaina VARIANT=nqgki DEVICE=9RT LTO=thin POLLY=1 BUILD_KERNEL=1 build/build.sh
- name: Create zip
run: |
cp out/msm-5.4-lahaina-nqgki/dist/Image ak3/
cat out/msm-5.4-lahaina-nqgki/dist/*.dtb > ak3/dtb
cp out/msm-5.4-lahaina-nqgki/dist/dtbo.img ak3/
cd ak3/ && zip -r9 eva-martini-${{ env.TAG_NAME }}-clang.zip * -x .git README.md ./*/placeholder
cd ../
- uses: actions/upload-artifact@main
if: github.event.inputs.RELEASE_CONFIG != 'true'
with:
name: release-zip
path: ak3/*.zip
- name: Upload to Release
if: github.event.inputs.RELEASE_CONFIG == 'true'
uses: ncipollo/release-action@v1
with:
artifacts: "ak3/*.zip"
tag: "Eva-martini-${{ env.TAG_NAME }}"
name: "Eva-martini-${{ env.TAG_NAME }}"
allowUpdates: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}