forked from raspberrypi/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (69 loc) · 2.49 KB
/
rpi4-kernel-build.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
name: Raspberry Pi 4 kernel CI
on:
pull_request:
paths-ignore:
- '.github/**'
branches: [ "rpi-*" ]
push:
paths-ignore:
- '.github/**'
branches: [ "rpi-*" ]
workflow_dispatch:
env:
NUM_JOBS: 3
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: bcm2711_arm64
arch: arm64
defconfig: bcm2711_defconfig
kernel: kernel8
steps:
- name: Update install
run:
sudo apt-get update
- name: Install toolchain
run:
if [[ "${{matrix.arch}}" == "arm64" ]]; then
sudo apt-get install gcc-aarch64-linux-gnu;
else
sudo apt-get install gcc-arm-linux-gnueabihf;
fi
timeout-minutes: 5
- uses: actions/checkout@v3
with:
fetch-depth: 1
clean: true
- name: Build kernel ${{matrix.name}}
run: |
mkdir ${{github.workspace}}/build
export ARCH=${{matrix.arch}}
if [[ "$ARCH" == "arm64" ]]; then
export CROSS_COMPILE=aarch64-linux-gnu-
export DTS_SUBDIR=broadcom
export IMAGE=Image.gz
else
export CROSS_COMPILE=arm-linux-gnueabihf-
export DTS_SUBDIR=
export IMAGE=zImage
fi
make O=${{github.workspace}}/build ${{matrix.defconfig}}
scripts/config --file ${{github.workspace}}/build/.config --set-val CONFIG_WERROR y
make O=${{github.workspace}}/build -j ${{env.NUM_JOBS}} $IMAGE modules dtbs
mkdir -p ${{github.workspace}}/install/boot/overlays
make O=${{github.workspace}}/build INSTALL_MOD_PATH=${{github.workspace}}/install modules_install
cp ${{github.workspace}}/build/arch/${ARCH}/boot/dts/${DTS_SUBDIR}/*.dtb ${{github.workspace}}/install/boot/
cp ${{github.workspace}}/build/arch/${ARCH}/boot/dts/overlays/*.dtb* ${{github.workspace}}/install/boot/overlays/
cp ${{github.workspace}}/arch/${ARCH}/boot/dts/overlays/README ${{github.workspace}}/install/boot/overlays/
cp ${{github.workspace}}/build/arch/${ARCH}/boot/$IMAGE ${{github.workspace}}/install/boot/${{matrix.kernel}}.img
- name: Tar build
run: tar -cvf ${{matrix.name}}_build.tar -C ${{github.workspace}}/install .
- name: Upload results
uses: actions/upload-artifact@v3
with:
name: ${{matrix.name}}_build
path: ${{matrix.name}}_build.tar
retention-days: 90