-
Notifications
You must be signed in to change notification settings - Fork 43
328 lines (280 loc) · 12 KB
/
bsa-acs_build_check.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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
name: BSA-ACS Build Check
on:
push:
branches: # trigger on push to master
- main
pull_request: # trigger on pull requests to master
branches:
- main
workflow_dispatch: # to dispatch from Github Actions
jobs:
build_bsa_acpi:
name: BSA-ACS UEFI build for ACPI target
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y git build-essential nasm
- name: Download edk2 and its submodules
run: |
git clone --recursive https://github.com/tianocore/edk2
cd edk2
git checkout 836942fbadb629050b866a8052e6af755bcdf623
cd ..
git clone https://github.com/tianocore/edk2-libc edk2/edk2-libc
- name: Checkout bsa-acs repository
uses: actions/checkout@v4
with:
path: 'edk2/ShellPkg/Application/bsa-acs'
- name: Apply edk2 BSA patch for ACPI target
run: |
cd edk2
git apply ShellPkg/Application/bsa-acs/patches/edk2-202208-bsa-acpi.diff
- name: Download Arm GCC cross-compiler
run: |
mkdir -p /opt/cross
cd /opt/cross
wget https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-aarch64-none-linux-gnu.tar.xz
tar -xf arm-gnu-toolchain-13.2.rel1-x86_64-aarch64-none-linux-gnu.tar.xz
- name: Set up EDK2 environment and build Bsa.efi
run: |
cd edk2
export GCC49_AARCH64_PREFIX=/opt/cross/arm-gnu-toolchain-13.2.Rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-
export PACKAGES_PATH=$PWD/edk2-libc
source edksetup.sh
make -C BaseTools/Source/C
source ShellPkg/Application/bsa-acs/tools/scripts/acsbuild.sh
- name: Save Bsa.efi as an artifact
uses: actions/upload-artifact@v4
with:
name: Bsa_acpi_target.efi
path: edk2/Build/Shell/DEBUG_GCC49/AARCH64/Bsa.efi
if-no-files-found: error
build_sbsa_acpi:
name: SBSA-ACS UEFI build for ACPI target
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y git build-essential nasm
- name: Download edk2 and its submodules
run: |
git clone --recursive https://github.com/tianocore/edk2
cd edk2
git checkout 836942fbadb629050b866a8052e6af755bcdf623
cd ..
git clone https://github.com/tianocore/edk2-libc edk2/edk2-libc
- name: Checkout bsa-acs repository
uses: actions/checkout@v4
with:
path: 'edk2/ShellPkg/Application/bsa-acs'
- name: Checkout sbsa-acs repository
run: |
cd edk2
git clone https://github.com/ARM-software/sbsa-acs.git ShellPkg/Application/sbsa-acs
- name: Apply edk2 sbsa patch
run: |
cd edk2
git apply ShellPkg/Application/sbsa-acs/patches/edk2-sbsa.diff
- name: Download Arm GCC cross-compiler
run: |
mkdir -p /opt/cross
cd /opt/cross
wget https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-aarch64-none-linux-gnu.tar.xz
tar -xf arm-gnu-toolchain-13.2.rel1-x86_64-aarch64-none-linux-gnu.tar.xz
- name: Set up EDK2 environment and build Sbsa.efi
run: |
cd edk2
export GCC49_AARCH64_PREFIX=/opt/cross/arm-gnu-toolchain-13.2.Rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-
export PACKAGES_PATH=$PWD/edk2-libc
source edksetup.sh
make -C BaseTools/Source/C
source ShellPkg/Application/sbsa-acs/tools/scripts/acsbuild.sh
ls Build/Shell/DEBUG_GCC49/AARCH64/Sbsa.efi
- name: Save Sbsa.efi as an artifact
uses: actions/upload-artifact@v4
with:
name: Sbsa.efi
path: edk2/Build/Shell/DEBUG_GCC49/AARCH64/Sbsa.efi
if-no-files-found: error
build_dt:
name: BSA-ACS UEFI build for DT target
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y git build-essential nasm
- name: Download edk2 and its submodules
run: |
git clone --recursive https://github.com/tianocore/edk2
cd edk2
git checkout 836942fbadb629050b866a8052e6af755bcdf623
cd ..
git clone https://github.com/tianocore/edk2-libc edk2/edk2-libc
- name: Checkout bsa-acs repository
uses: actions/checkout@v4
with:
path: 'edk2/ShellPkg/Application/bsa-acs'
- name: Apply edk2 BSA patch for DT target
run: |
cd edk2
git apply ShellPkg/Application/bsa-acs/patches/edk2-202208-bsa-dt.diff
- name: Download Arm GCC cross-compiler
run: |
mkdir -p /opt/cross
cd /opt/cross
wget https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-aarch64-none-linux-gnu.tar.xz
tar -xf arm-gnu-toolchain-13.2.rel1-x86_64-aarch64-none-linux-gnu.tar.xz
- name: Set up EDK2 environment and build Bsa.efi
run: |
cd edk2
export GCC49_AARCH64_PREFIX=/opt/cross/arm-gnu-toolchain-13.2.Rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-
export PACKAGES_PATH=$PWD/edk2-libc
source edksetup.sh
make -C BaseTools/Source/C
source ShellPkg/Application/bsa-acs/tools/scripts/acsbuild.sh
- name: Save Bsa.efi as an artifact
uses: actions/upload-artifact@v4
with:
name: Bsa_dt_target.efi
path: edk2/Build/Shell/DEBUG_GCC49/AARCH64/Bsa.efi
if-no-files-found: error
bsa_baremetal-compilation:
name: BSA-ACS Baremetal CMake compilation check
runs-on: ubuntu-latest
steps:
- name: Checkout bsa-acs repository
uses: actions/checkout@v4
- name: Remove build folder if present in BSA-ACS
run: |
rm -rf build
- name: Download Arm GCC cross-compiler
run: |
mkdir -p /opt/cross
cd /opt/cross
wget https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-aarch64-none-elf.tar.xz
tar -xf arm-gnu-toolchain-13.2.rel1-x86_64-aarch64-none-elf.tar.xz
- name: Compile BSA Baremetal ACS for RDN2 Platform
run: |
export CROSS_COMPILE=/opt/cross/arm-gnu-toolchain-13.2.Rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-
mkdir build
cd build
cmake ../ -G "Unix Makefiles" -DCROSS_COMPILE=$CROSS_COMPILE -DTARGET=RDN2
make
- name: Save Baremetel bsa.bin as an artifact
uses: actions/upload-artifact@v4
with:
name: Bsa_baremetal_RDN2.bin
path: build/output/bsa.bin
if-no-files-found: error
sbsa_baremetal-compilation:
name: SBSA-ACS Baremetal CMake compilation
runs-on: ubuntu-latest
steps:
- name: Checkout bsa-acs repository
uses: actions/checkout@v4
with:
repository: ARM-software/bsa-acs
- name: Git clone SBSA-ACS repository
run: |
git clone https://github.com/ARM-software/sbsa-acs.git ../sbsa-acs
- name: Remove build folder if present in SBSA-ACS
run: |
cd ../sbsa-acs
rm -rf build
- name: Download Arm GCC cross-compiler
run: |
mkdir -p /opt/cross
cd /opt/cross
wget https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-aarch64-none-elf.tar.xz
tar -xf arm-gnu-toolchain-13.2.rel1-x86_64-aarch64-none-elf.tar.xz
- name: Compile SBSA Baremetal ACS for RDN2 Platform
run: |
cd ../sbsa-acs
export CROSS_COMPILE=/opt/cross/arm-gnu-toolchain-13.2.Rel1-x86_64-aarch64-none-elf/bin/aarch64-none-elf-
mkdir build
cd build
cmake ../ -G "Unix Makefiles" -DCROSS_COMPILE=$CROSS_COMPILE -DTARGET=RDN2
make
- name: Save Baremetel sbsa.bin as an artifact
uses: actions/upload-artifact@v4
with:
name: Sbsa_baremetal_RDN2.bin
path: /home/runner/work/bsa-acs/sbsa-acs/build/output/sbsa.bin
if-no-files-found: error
linux-compilation:
name: BSA and SBSA linux compilation
runs-on: ubuntu-latest
steps:
- name: Checkout bsa-acs repository
uses: actions/checkout@v4
with:
repository: ARM-software/bsa-acs
- name: Download Arm GCC cross-compiler and Linux 6.8 and Linux ACS
run: |
cd ..
git clone https://github.com/torvalds/linux.git -b v6.8 linux6.8
git clone https://git.gitlab.arm.com/linux-arm/linux-acs.git
ls
mkdir -p /opt/cross
cd /opt/cross
wget https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-aarch64-none-linux-gnu.tar.xz
tar -xf arm-gnu-toolchain-13.2.rel1-x86_64-aarch64-none-linux-gnu.tar.xz
cd -
- name: Compile Linux
run: |
cd ..
export GCC=/opt/cross/arm-gnu-toolchain-13.2.Rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-
cd linux6.8
git apply ../linux-acs/kernel/src/0001-BSA-ACS-Linux-6.8.patch
mkdir out
cp arch/arm64/configs/defconfig out/.config
make ARCH=arm64 CROSS_COMPILE=$GCC O=out olddefconfig
make ARCH=arm64 CROSS_COMPILE=$GCC O=out -j $(nproc)
cd -
- name: Save Linux Kernel as an artifact
uses: actions/upload-artifact@v4
with:
name: Linux Kernel
path: /home/runner/work/bsa-acs/linux6.8/out/arch/arm64/boot/Image.gz
if-no-files-found: error
- name: Compile BSA Linux ACS module and app
run: |
cd ..
export CROSS_COMPILE=/opt/cross/arm-gnu-toolchain-13.2.Rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-
export KERNEL_SRC=$PWD/linux6.8/out
mkdir linux-bsa
cd linux-acs/acs-drv/files
./bsa_setup.sh $PWD/../../../bsa-acs
./linux_bsa_acs.sh
cp bsa_acs.ko /home/runner/work/bsa-acs/linux-bsa/
cd -
cd bsa-acs/linux_app/bsa-acs-app
make
cp bsa /home/runner/work/bsa-acs/linux-bsa/
- name: Save BSA kernel module and app as an artifact
uses: actions/upload-artifact@v4
with:
name: BSA Kernel Module and App
path: /home/runner/work/bsa-acs/linux-bsa/*
if-no-files-found: error
- name: Compile SBSA Linux ACS module and app
run: |
cd ..
git clone https://github.com/ARM-software/sbsa-acs.git
export CROSS_COMPILE=/opt/cross/arm-gnu-toolchain-13.2.Rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-
export KERNEL_SRC=$PWD/linux6.8/out
mkdir linux-sbsa
cd linux-acs/acs-drv/files
rm -r test_pool
rm -r val
./sbsa_setup.sh $PWD/../../../bsa-acs $PWD/../../../sbsa-acs
./linux_sbsa_acs.sh
cp sbsa_acs.ko /home/runner/work/bsa-acs/linux-sbsa/
cd -
cd sbsa-acs/linux_app/sbsa-acs-app
make
cp sbsa /home/runner/work/bsa-acs/linux-sbsa/
- name: Save SBSA kernel module and app as an artifact
uses: actions/upload-artifact@v4
with:
name: SBSA Kernel Module and App
path: /home/runner/work/bsa-acs/linux-sbsa/*
if-no-files-found: error