forked from linuxwacom/input-wacom
-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (90 loc) · 4.53 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
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.10", "4.19", "4.14", "4.10", "4.6", "4.5", "4.2", "4.1", "3.19", "3.18", "3.17"]
include:
- kernel: "3.17"
compile_cflags: -fno-pie -Wno-error=format-truncation
prepare_cflags: -fno-pie -no-pie
- kernel: "3.18"
compile_cflags: -fno-pie -Wno-error=format-truncation
prepare_cflags: -fno-pie -no-pie
- kernel: "3.19"
compile_cflags: -fno-pie -Wno-error=format-truncation
prepare_cflags: -fno-pie -no-pie
- kernel: "4.1"
compile_cflags: -fno-pie -Wno-error=format-truncation
prepare_cflags: -fno-pie -no-pie
- kernel: "4.2"
compile_cflags: -fno-pie -Wno-error=format-truncation
prepare_cflags: -fno-pie -no-pie
- kernel: "4.5"
compile_cflags: -fno-pie -Wno-error=format-truncation -Wno-error=pointer-sign -Wno-error=unused-result
prepare_cflags: -fno-pie -no-pie
- kernel: "4.6"
compile_cflags: -fno-pie -Wno-error=format-truncation -Wno-error=pointer-sign -Wno-error=unused-result
prepare_cflags: -fno-pie -no-pie
- kernel: "4.10"
compile_cflags: -fno-pie -Wno-error=format-truncation -Wno-error=pointer-sign -Wno-error=unused-result
prepare_cflags: -fno-pie -no-pie
- kernel: "4.14"
compile_cflags: -Wno-error=format-truncation -Wno-error=pointer-sign -Wno-error=unused-result
- kernel: "4.19"
compile_cflags: -Wno-error=format-truncation -Wno-error=pointer-sign -Wno-error=unused-result
- kernel: "5.10"
compile_cflags: -Wno-error=format-truncation -Wno-error=pointer-sign -Wno-error=unused-result
- kernel: "6.3"
compile_cflags: -Wno-error=format-truncation -Wno-error=pointer-sign -Wno-error=unused-result
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 }}"