@@ -20,56 +20,63 @@ jobs:
20
20
lint :
21
21
runs-on : ubuntu-latest
22
22
steps :
23
- - uses : actions/checkout@v3
23
+ - uses : actions/checkout@v4
24
24
25
- - uses : actions/setup-python@v4
25
+ - uses : actions/setup-python@v5
26
26
with :
27
27
python-version : ' 3.x'
28
28
29
29
- name : Lint
30
30
run : |
31
31
./.test/lint.sh
32
+
32
33
build :
33
34
needs : lint
34
35
strategy :
35
36
fail-fast : false
36
37
matrix :
37
38
env :
38
- - { RPI_LINUX_VER: rpi-5.4.y, CONFIG_FILE: config-5.4.83-v7+, RPI_LINUX_COMMIT_HASH: 76c49e6, GCC_VER: 8.3 }
39
- - { RPI_LINUX_VER: rpi-5.10.y, CONFIG_FILE: config-5.10.11-v7+, RPI_LINUX_COMMIT_HASH: 6af8ae3, GCC_VER: 8.3 }
40
- - { RPI_LINUX_VER: rpi-5.15.y, CONFIG_FILE: config-5.15.61-v7l+, RPI_LINUX_COMMIT_HASH: 5b775d7, GCC_VER: 10.2 }
41
- - { RPI_LINUX_VER: rpi-5.15.y, CONFIG_FILE: config-5.15.76-v7l+, RPI_LINUX_COMMIT_HASH: 45d339389bb85588b8045dd40a00c54d01e2e711, GCC_VER: 10.2 }
42
- runs-on : ubuntu-latest
43
- steps :
44
- - uses : actions/checkout@v3
39
+ - { HOST: 20.04, KERNEL_VER: rpi-5.4.y, OS_BIT: armhf } # Debian 10 (Buster)
40
+ - { HOST: 20.04, KERNEL_VER: rpi-5.10.y, OS_BIT: armhf } # Debian 11 (Bullseye)
41
+ - { HOST: 22.04, KERNEL_VER: rpi-5.15.y, OS_BIT: armhf } # Debian 11 (Bullseye)
42
+ # - { HOST: 24.04, KERNEL_VER: rpi-6.6.y, OS_BIT: armhf } # Debian 12 (Bookworm) 32-bit
43
+ # - { HOST: 24.04, KERNEL_VER: rpi-6.6.y, OS_BIT: arm64 } # Debian 12 (Bookworm) 64-bit
45
44
46
- - name : Install cross-build settings
47
- id : gcc
48
- env :
49
- GCC_VER : ${{ matrix.env.GCC_VER }}
50
- SRC_DIR : ${{ github.workspace }}
51
- run : |
52
- source ./.test/step0.sh
53
- prepare_cross_compiler
54
- echo "path=${CROSS_COMPILE_PATH}" >> $GITHUB_OUTPUT
45
+ runs-on : ubuntu-${{ matrix.env.HOST }}
55
46
56
- - name : Install kernel headers
57
- env :
58
- RPI_LINUX_VER : ${{ matrix.env.RPI_LINUX_VER }}
59
- CONFIG_FILE : ${{ matrix.env.CONFIG_FILE }}
60
- RPI_LINUX_COMMIT_HASH : ${{ matrix.env.RPI_LINUX_COMMIT_HASH }}
61
- GCC_VER : ${{ matrix.env.GCC_VER }}
62
- CROSS_COMPILE_PATH : ${{ steps.gcc.outputs.path }}
63
- SRC_DIR : ${{ github.workspace }}
64
- run : |
65
- source ./.test/step1.sh
66
- install_kernel_headers
47
+ steps :
48
+ - name : Checkout source code
49
+ uses : actions/checkout@v4
67
50
68
- - name : Build kernel module
69
- env :
70
- CROSS_COMPILE_PATH : ${{ steps.gcc.outputs.path }}
71
- SRC_DIR : ${{ github.workspace }}
72
- run : |
73
- source ./.test/step2.sh
74
- build_kernel_module
51
+ - name : Set up cross-compilation toolchain
52
+ run : |
53
+ sudo apt update
54
+ sudo apt install -y bc bison flex libssl-dev make libc6-dev libncurses5-dev
55
+ if [ "${{ matrix.env.OS_BIT }}" == "armhf" ]; then
56
+ sudo apt install -y crossbuild-essential-armhf
57
+ else
58
+ sudo apt install -y crossbuild-essential-arm64
59
+ fi
60
+
61
+ - name : Clone Raspberry Pi Linux Kernel
62
+ run : |
63
+ git clone --branch ${{ matrix.env.KERNEL_VER }} --depth=1 https://github.com/raspberrypi/linux
64
+ cd linux
65
+ if [ "${{ matrix.env.OS_BIT }}" == "armhf" ]; then
66
+ KERNEL=kernel7l
67
+ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2711_defconfig
68
+ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules_prepare
69
+ else
70
+ KERNEL=kernel8
71
+ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- bcm2711_defconfig
72
+ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- modules_prepare
73
+ fi
75
74
75
+ - name : Build the kernel module
76
+ run : |
77
+ cd linux
78
+ if [ "${{ matrix.env.OS_BIT }}" == "armhf" ]; then
79
+ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- M=$GITHUB_WORKSPACE/src/drivers V=1 modules
80
+ else
81
+ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- M=$GITHUB_WORKSPACE/src/drivers V=1 modules
82
+ fi
0 commit comments