forked from intel-gpu/intel-gpu-i915-backports
-
Notifications
You must be signed in to change notification settings - Fork 30
142 lines (123 loc) · 4.13 KB
/
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
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
name: Build
on:
workflow_dispatch:
push:
tags:
- "*-[0-9]+"
jobs:
build_dsm:
strategy:
matrix:
version: [7.1, 7.2]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download toolchain
run: |
env_tarball=ds.epyc7002-${{ matrix.version }}.env.txz
wget https://global.synologydownload.com/download/ToolChain/toolkit/${{ matrix.version }}/epyc7002/$env_tarball
mkdir toolchain
tar xf $env_tarball -C toolchain
- name: Download kernel headers
run: |
dev_tarball=ds.epyc7002-${{ matrix.version }}.dev.txz
wget https://global.synologydownload.com/download/ToolChain/toolkit/${{ matrix.version }}/epyc7002/$dev_tarball
mkdir ksrc
tar xf $dev_tarball -C ksrc
- name: Build
run: |
export KLIB_BUILD=$PWD/ksrc/usr/local/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/sys-root/usr/lib/modules/DSM-${{ matrix.version }}/build
export CROSS_COMPILE=$PWD/toolchain/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-
make defconfig-drm
make -j$(nproc)
MODULES_INTERMEDIATES=$PWD/out/intermediates
OUT_MODULES=$PWD/out/modules
mkdir -p $OUT_MODULES
make -C $KLIB_BUILD M=$PWD \
INSTALL_MOD_PATH=$MODULES_INTERMEDIATES \
INSTALL_MOD_STRIP=1 CONFIG_MODULE_SIG_ALL= \
_emodinst_
find $MODULES_INTERMEDIATES -type f -name '*.ko' \
-exec mv {} $OUT_MODULES \;
- name: Checkout firmware
run: |
git clone https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git \
-b 20240115 \
--depth 1
- name: Copy necessary firmware
run: |
SOURCE=linux-firmware/i915
DEST=out/firmware/i915
mkdir -p $DEST
while read L; do
L=$(basename $L)
if [ -e "$SOURCE/$L" ]; then
cp "$SOURCE/$L" $DEST
else
echo "::warning ::Missing $L"
fi
done < <(find out/modules -name \*.ko -exec /sbin/modinfo {} -F firmware \;)
chmod 644 $DEST/*
- name: Pack modules and firmware
working-directory: out
run: zip -r i915_dsm-${{ matrix.version }}_epyc7002.zip firmware modules
- name: Save to artifacts
uses: actions/upload-artifact@v4
with:
name: i915_dsm-${{ matrix.version }}_epyc7002
path: out/i915_dsm-${{ matrix.version }}_epyc7002.zip
build_pve:
runs-on: ubuntu-latest
container: debian:12
env:
DEBIAN_FRONTEND: noninteractive
DPKG_COLORS: always
FORCE_UNSAFE_CONFIGURE: 1
steps:
- name: Install Dependencies
run: |
echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/00noconfirm
apt-get update && \
apt-get install -yq build-essential devscripts dkms dh-dkms
- name: Checkout
uses: actions/checkout@v4
with:
path: src
- name: Build
working-directory: src
run: |
REF=${{ github.event.ref }}
case "$REF" in
refs/tags/*) BUILD_VERSION=${REF##*-} ;;
*) BUILD_VERSION= ;;
esac
make BUILD_CONFIG=nodrm BUILD_VERSION=$BUILD_VERSION i915dkmsdeb-pkg
- name: Save to artifacts
uses: actions/upload-artifact@v4
with:
name: i915_pve
path: "*.deb"
release:
if: startsWith(github.ref, 'refs/tags/')
needs: [build_dsm, build_pve]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Append tag to filename
run: |
find . -name "i915_dsm-*.zip" -print0 | while read -d $'\0' f; do
mv $f ${f%.*}_${GITHUB_REF##*/}.zip
done
- name: Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
*.zip
*.deb