-
Notifications
You must be signed in to change notification settings - Fork 58
82 lines (70 loc) · 3.38 KB
/
main.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
on: [ push, pull_request ]
permissions:
contents: read
env:
COMPILE_CFLAGS: -Werror
PREPARE_CFLAGS:
jobs:
compile:
runs-on: ubuntu-20.04
strategy:
matrix:
kernel: ["6.3", "5.15", "5.10", "5.4", "5.0", "4.19"]
include:
- kernel: "4.19"
compile_cflags: -Wno-error=format-truncation -Wno-error=pointer-sign
- kernel: "5.0"
compile_cflags: -Wno-error=format-truncation -Wno-error=pointer-sign
- kernel: "5.4"
compile_cflags: -Wno-error=format-truncation -Wno-error=pointer-sign
- kernel: "5.10"
compile_cflags: -Wno-error=format-truncation -Wno-error=pointer-sign
- kernel: "5.15"
compile_cflags: -Wno-error=format-truncation -Wno-error=pointer-sign
- kernel: "6.3"
compile_cflags: -Wno-error=format-truncation -Wno-error=pointer-sign
build_makeflags: KBUILD_MODPOST_WARN=1
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install gcc-9-plugin-dev libelf-dev
gcc -print-file-name=plugin
- name: Checkout the repo
uses: actions/checkout@v4
- name: Download and extract v${{ matrix.kernel }} kernel
run: |
KERNELVER=${{ matrix.kernel }}
KERNELDIR=${HOME}/kernel
KERNELROOT=${KERNELDIR}/linux-${KERNELVER}
# Generate the "v{major}.x" URL path component from the kernel
# version and then download and unpack the sources
SERIES=v$(awk -vFS=. -vOFS=. '{$2="x"; print}' <<< ${KERNELVER})
URL=https://cdn.kernel.org/pub/linux/kernel/${SERIES}/linux-${KERNELVER}.tar.xz
mkdir -p ${KERNELDIR}
rm -rf ${KERNELROOT}
curl ${URL} | tar xJC ${KERNELDIR}
- name: Prepare v${{ matrix.kernel }} kernel sources
run: |
KERNELVER=${{ matrix.kernel }}
KERNELDIR=${HOME}/kernel
KERNELROOT=${KERNELDIR}/linux-${KERNELVER}
# Make sure the kernel can find a header for this compiler if necessary
GCC_MAJOR_VER=$(gcc -dumpversion | cut -d'.' -f1)
if [[ ! -f "${KERNELROOT}/include/linux/compiler-gcc${GCC_MAJOR_VER}.h" ]]; then
COMPILER_H=$(ls -v ${KERNELROOT}/include/linux/compiler-gcc*.h | tail -n1)
ln -s "${COMPILER_H}" "${KERNELROOT}/include/linux/compiler-gcc${GCC_MAJOR_VER}.h"
fi
# Fix issue preventing some late-version 4.x kenels from completing config
if [[ "${KERNELVER}" == "4."* || "${KERNELVER}" == "5.1" ]]; then
curl "https://github.com/torvalds/linux/commit/dfbd199a7cfe3e3cd8531e1353cdbd7175bfbc5e.patch" | patch -t -N -r - -p1 -d "${KERNELROOT}" || true
fi
make -C ${KERNELROOT} defconfig
${KERNELROOT}/scripts/config --file ${KERNELROOT}/.config --disable UNWINDER_ORC --enable UNWINDER_FRAME_POINTER
make -C ${KERNELROOT} prepare modules_prepare EXTRA_CFLAGS="${PREPARE_CFLAGS} ${{ matrix.prepare_cflags }}"
- name: Build input-wacom for v${{ matrix.kernel }} kernel
run: |
KERNELDIR=${HOME}/kernel
KERNELROOT=${KERNELDIR}/linux-${{ matrix.kernel }}
./autogen.sh --with-kernel=${KERNELROOT}
make V=1 EXTRA_CFLAGS="${COMPILE_CFLAGS} ${{ matrix.compile_cflags }}" EXTRA_MAKEFLAGS="${BUILD_MAKEFLAGS} ${{ matrix.build_makeflags }}"