-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Expand file tree
/
Copy pathmain.yml
More file actions
185 lines (157 loc) ยท 6.71 KB
/
Copy pathmain.yml
File metadata and controls
185 lines (157 loc) ยท 6.71 KB
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
185
name: Defconfig Inspection & Build
on:
workflow_dispatch:
jobs:
inspect_and_build:
runs-on: ubuntu-20.04
steps:
- name: Checkout Source
uses: actions/checkout@v3
- name: Install Legacy Python & Tools
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
bc \
libncurses5-dev \
libssl-dev \
flex \
bison \
libelf-dev \
python2 \
git-core \
curl \
rsync
sudo ln -sf /usr/bin/python2 /usr/bin/python
- name: Print Defconfig Content
run: |
echo "===================== DANDELION_DEFCONFIG ANALYSIS ====================="
echo ""
echo "๐ File: arch/arm64/configs/dandelion_defconfig"
echo "๐ Total lines: $(wc -l < arch/arm64/configs/dandelion_defconfig)"
echo ""
# ุชุญููู ุงูู defconfig
echo "๐ Key Configurations Found:"
echo "----------------------------"
grep -E "^(CONFIG_WERROR|CONFIG_ARM64|CONFIG_CPU|CONFIG_ARCH|CONFIG_COMPAT|CONFIG_MODULES)" arch/arm64/configs/dandelion_defconfig || true
echo ""
echo "๐ Full Defconfig Content:"
echo "=========================="
cat arch/arm64/configs/dandelion_defconfig
echo ""
echo "โ ๏ธ WARNING Check:"
echo "----------------"
if grep -q "CONFIG_WERROR=y" arch/arm64/configs/dandelion_defconfig; then
echo "โ CONFIG_WERROR=y found! This will be disabled before build."
else
echo "โ
CONFIG_WERROR not set to 'y'"
fi
- name: Download Toolchains
run: |
echo "๐ฅ Downloading toolchains..."
# 64-bit toolchain (ู
ูู
)
if [ ! -d "toolchain-64" ]; then
git clone --depth=1 --branch lineage-19.1 \
https://github.com/LineageOS/android_prebuilts_gcc_linux-x86_aarch64_aarch64-linux-android-4.9 toolchain-64
fi
# 32-bit toolchain (ู
ูู
ุฌุฏุงู ูู MediaTek)
if [ ! -d "toolchain-32" ]; then
git clone --depth=1 --branch lineage-19.1 \
https://github.com/LineageOS/android_prebuilts_gcc_linux-x86_arm_arm-linux-androideabi-4.9 toolchain-32
fi
echo "โ
Toolchains ready:"
ls -la toolchain-*/bin/* | head -10
- name: Apply Critical Fixes
run: |
echo "๐ง Applying critical source fixes..."
# 1. ุฅุตูุงุญ ู
ุดููุฉ yylloc (ุงูุณุจุจ ุงูุฑุฆูุณู ูููุดู)
if [ -f "scripts/dtc/dtc-lexer.lex.c_shipped" ]; then
echo "Fixing yylloc in dtc-lexer.lex.c_shipped..."
sed -i 's/^YYLTYPE yylloc;/extern YYLTYPE yylloc;/' scripts/dtc/dtc-lexer.lex.c_shipped
fi
if [ -f "scripts/dtc/dtc-parser.tab.c_shipped" ]; then
echo "Fixing yylloc in dtc-parser.tab.c_shipped..."
sed -i 's/^YYLTYPE yylloc;/extern YYLTYPE yylloc;/' scripts/dtc/dtc-parser.tab.c_shipped
fi
# 2. ุชุนุทูู CONFIG_WERROR ูู ุงูู defconfig
if [ -f "arch/arm64/configs/dandelion_defconfig" ]; then
echo "Disabling CONFIG_WERROR..."
sed -i 's/CONFIG_WERROR=y/CONFIG_WERROR=n/' arch/arm64/configs/dandelion_defconfig
fi
# 3. ุฅุตูุงุญุงุช ุชูุงูู GCC
echo "Applying GCC compatibility fixes..."
find . -name "*.c" -type f -exec grep -l "__attribute__((weak))" {} \; 2>/dev/null | \
head -5 | while read file; do
sed -i 's/static \(.*\) __attribute__((weak));/static \1 __attribute__((weak, unused));/g' "$file" 2>/dev/null || true
done
- name: Configure and Build Kernel
run: |
echo "๐ Starting kernel build process..."
# ุฅุนุฏุงุฏ ู
ุชุบูุฑุงุช ุงูุจูุฆุฉ
export ARCH=arm64
export SUBARCH=arm64
export CROSS_COMPILE=$(pwd)/toolchain-64/bin/aarch64-linux-android-
export CROSS_COMPILE_ARM32=$(pwd)/toolchain-32/bin/arm-linux-androideabi-
echo "๐ Build Environment:"
echo " ARCH: $ARCH"
echo " CROSS_COMPILE: $CROSS_COMPILE"
echo " CROSS_COMPILE_ARM32: $CROSS_COMPILE_ARM32"
# 1. ุชุญู
ูู ุงูู defconfig
echo "๐ Loading defconfig..."
make dandelion_defconfig
# 2. ุนุฑุถ ุงูู config ุงููุงุชุฌ
echo "๐ Running config:"
grep -E "^(CONFIG_WERROR|CONFIG_ARM64|CONFIG_CPU|CONFIG_MODULES)" .config || true
# 3. ุงูุจูุงุก ู
ุน flags ุงูุชูุงูู
echo "๐จ Building kernel..."
time make -j$(nproc) \
KCFLAGS="-fcommon -w -O2" \
HOSTCFLAGS="-fcommon -w" \
CFLAGS_MODULE="-fno-pic"
# 4. ุงูุชุญูู ู
ู ุงููุงุชุฌ
echo "โ
Build completed. Checking outputs..."
if [ -f "arch/arm64/boot/Image.gz-dtb" ]; then
echo "๐ SUCCESS: Image.gz-dtb created!"
ls -lh arch/arm64/boot/Image*
else
echo "โ ERROR: Image.gz-dtb not found!"
echo "Checking for other outputs..."
ls -la arch/arm64/boot/ || true
exit 1
fi
- name: Analyze Build Results
if: always()
run: |
echo "๐ Build Analysis Report"
echo "========================"
# ุชุญููู ุญุฌู
ุงูู
ุฎุฑุฌุงุช
if [ -f "arch/arm64/boot/Image.gz-dtb" ]; then
echo "๐ฆ Kernel size: $(ls -lh arch/arm64/boot/Image.gz-dtb | awk '{print $5}')"
fi
# ุชุญููู ู
ูู ุงูู config ุงูููุงุฆู
if [ -f ".config" ]; then
echo ""
echo "๐ง Final Config Highlights:"
echo "---------------------------"
grep -E "^(CONFIG_LOCALVERSION|CONFIG_CMDLINE|CONFIG_KERNEL_|CONFIG_MODULES)" .config | head -20 || true
fi
- name: Upload Artifacts
if: success()
uses: actions/upload-artifact@v4
with:
name: kernel-build-artifacts
path: |
.config
arch/arm64/boot/Image.gz-dtb
arch/arm64/boot/Image
Module.symvers
System.map
retention-days: 7
- name: Upload Config Comparison
if: always()
uses: actions/upload-artifact@v4
with:
name: config-comparison
path: |
arch/arm64/configs/dandelion_defconfig
.config