-
Notifications
You must be signed in to change notification settings - Fork 16
346 lines (298 loc) · 11.5 KB
/
cks.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
#
# Copyright (C) 2022 Ing <https://github.com/wjz304>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
name: Build cks
on:
workflow_dispatch:
inputs:
version:
description: "format %y.%-m.$i or auto"
required: false
type: string
prerelease:
description: "pre release"
default: false
type: boolean
jobs:
build:
strategy:
matrix:
include:
#- version: 7.1
# platform: epyc7002
# config: ""
#- version: 7.1
# platform: epyc7002
# config: "drm"
- version: 7.2
platform: epyc7002
config: ""
- version: 7.2
platform: epyc7002
config: "drm"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
- name: Checkout
uses: actions/checkout@main
with:
repository: RROrg/rp-modules
token: ${{ secrets.RRORG }}
path: rp-modules
- name: Checkout
uses: actions/checkout@main
with:
repository: RROrg/rr-cks
token: ${{ secrets.RRORG }}
path: rr-cks
- name: Init Env
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
sudo timedatectl set-timezone "Asia/Shanghai"
sudo apt update
sudo apt install -y curl build-essential bison flex dwarves ruby libncurses-dev libssl-dev libelf-dev
- name: Make modules
run: |
ROOT_PATH=${{ github.workspace }}
VERSION=${{ matrix.version }}
PLATFORM=${{ matrix.platform }}
CONFIG=${{ matrix.config }}
if [ "${VERSION}" = "7.2" ]; then
git clone --depth=1 https://github.com/RROrg/linux_dsm_epyc7002.git
git clone --depth=1 https://github.com/MoetaYuko/intel-gpu-i915-backports.git
else
echo "Only support 7.2"
exit 1
fi
. ${ROOT_PATH}/rp-modules/compile-ck.sh
echo "makeEnvDeploy"
makeEnvDeploy "${ROOT_PATH}" "${VERSION}" "${PLATFORM}"
echo "makekernel"
if [ -n "${CONFIG}" ]; then
if [ -f "${ROOT_PATH}/linux_dsm_epyc7002/synology/synoconfigs/${PLATFORM}_${CONFIG}" ]; then
cp -f "${ROOT_PATH}/linux_dsm_epyc7002/synology/synoconfigs/${PLATFORM}_${CONFIG}" "${ROOT_PATH}/linux_dsm_epyc7002/synology/synoconfigs/${PLATFORM}"
else
echo "Config ${PLATFORM}_${CONFIG} does not exist."
exit 1
fi
fi
makekernel "${ROOT_PATH}" "${VERSION}" "${PLATFORM}" "${ROOT_PATH}/linux_dsm_epyc7002" "${ROOT_PATH}/output"
echo "makemodules"
KVER="$(getKver "${ROOT_PATH}" "${VERSION}" "${PLATFORM}" "${ROOT_PATH}/linux_dsm_epyc7002")"
cp -f "${ROOT_PATH}/rp-modules/src/${KVER}-ck/defines.${PLATFORM}" "${ROOT_PATH}/rp-modules/src/${KVER}-ck/defines"
makemodules "${ROOT_PATH}" "${VERSION}" "${PLATFORM}" "${ROOT_PATH}/linux_dsm_epyc7002" "${ROOT_PATH}/rp-modules/src/${KVER}-ck" "${ROOT_PATH}/modules"
cp -rf "${ROOT_PATH}/modules/"* "${ROOT_PATH}/output"
if [ ! "${CONFIG}" = "drm" ]; then
echo "makei915"
makei915 "${ROOT_PATH}" "${VERSION}" "${PLATFORM}" "${ROOT_PATH}/linux_dsm_epyc7002" "${ROOT_PATH}/intel-gpu-i915-backports" "${ROOT_PATH}/i915"
cp -rf "${ROOT_PATH}/i915/"* "${ROOT_PATH}/output"
fi
- name: Tar to Artifacts
run: |
ROOT_PATH=${{ github.workspace }}
VERSION=${{ matrix.version }}
PLATFORM=${{ matrix.platform }}
. ${ROOT_PATH}/rp-modules/compile-ck.sh
KVER="$(getKver "${ROOT_PATH}" "${VERSION}" "${PLATFORM}" "linux_dsm_epyc7002")"
if [ "${PLATFORM}" = "epyc7002" ]; then
PARTY3RD_PATH="${ROOT_PATH}/rr-cks/thirdparty/${PLATFORM}-${VERSION}-${KVER}"
else
PARTY3RD_PATH="${ROOT_PATH}/rr-cks/thirdparty/${PLATFORM}-${KVER}"
fi
echo "copy 3rd modules"
[ -d "${PARTY3RD_PATH}" ] && sudo cp -rf "${PARTY3RD_PATH}/." "${ROOT_PATH}/output/modules"
echo "check depends"
for M in $(ls ${ROOT_PATH}/output/modules 2>/dev/null); do
function _copydepends() {
if [ ! -f "${ROOT_PATH}/output/modules/${1}" ] && [ ! -f "${OFFICIAL_PATH/hda1/rd}/${1}" ]; then
if [ -f "${OFFICIAL_PATH}/${1}" ]; then
sudo cp -f "${OFFICIAL_PATH}/${1}" "${ROOT_PATH}/output/modules"
else
echo "[E] '${PLATFORM}-${KVER}' - '${M}' depends '${1}' does not exist."
fi
fi
D=""
[ -z "${D}" ] && [ -f "${ROOT_PATH}/output/modules/${1}" ] && D="${ROOT_PATH}/output/modules/${1}"
[ -z "${D}" ] && [ -f "${OFFICIAL_PATH/hda1/rd}/${1}" ] && D="${OFFICIAL_PATH/hda1/rd}/${1}"
if [ -n "${D}" ]; then
# modinfo "${D}" || true
depends=($(modinfo "${D}" 2>/dev/null | grep depends: | awk -F: '{print $2}' | awk '$1=$1' | sed 's/,/ /g')) || true
if [ ${#depends[*]} -gt 0 ]; then
for k in ${depends[@]}; do
[ -f "${ROOT_PATH}/output/modules/${k}.ko" ] && continue # Recursively skip wext-priv and wext-core dependencies on each other.
_copydepends "${k}.ko"
done
fi
fi
}
_copydepends "${M}"
done
if [ "${PLATFORM}" = "epyc7002" ]; then
tar -zcf ${ROOT_PATH}/modules-${PLATFORM}-${VERSION}-${KVER}.tgz -C ${ROOT_PATH}/output/modules .
gzip -c ${ROOT_PATH}/output/bzImage >${ROOT_PATH}/bzImage-${PLATFORM}-${VERSION}-${KVER}.gz
else
tar -zcf ${ROOT_PATH}/${PLATFORM}-${KVER}.tgz -C ${ROOT_PATH}/output/modules .
gzip -c ${ROOT_PATH}/output/bzImage >${ROOT_PATH}/bzImage-${PLATFORM}-${KVER}.gz
fi
- name: Upload to Artifacts
uses: actions/upload-artifact@v4
with:
name: rr-cks${{ matrix.config }}-${{ matrix.version }}-${{ matrix.platform }}
path: |
*.tgz
*.gz
firmware:
needs: build
strategy:
matrix:
include:
- config: ""
- config: "drm"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
- name: Checkout
uses: actions/checkout@main
with:
repository: RROrg/rr-cks
token: ${{ secrets.RRORG }}
path: rr-cks
- name: Init Env
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
sudo timedatectl set-timezone "Asia/Shanghai"
- name: download to artifacts
uses: actions/download-artifact@v4
with:
path: output
pattern: rr-cks${{ matrix.config }}-*
merge-multiple: true
- name: firmware
run: |
ROOT_PATH=${{ github.workspace }}
mkdir -p ${ROOT_PATH}/firmware
echo "copy 3rd modules"
PARTY3RD_PATH="${ROOT_PATH}/rr-cks/thirdparty/firmware"
cp -rf ${PARTY3RD_PATH}/* ${ROOT_PATH}/firmware/
echo "extract all modules"
for F in output/*.tgz; do
echo "${F}"
mkdir -p "${F%.tgz}"
tar -zxf "${F}" -C "${F%.tgz}" || echo "Failed to extract ${F}"
done
echo "get firmware"
SOURCE=/tmp/linux-firmware
git clone --depth=1 https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git ${SOURCE}
while read L; do
if [ -e "${SOURCE}/${L}" ]; then
mkdir -p "$(dirname firmware/${L})"
cp "${SOURCE}/${L}" "firmware/${L}"
else
[ -e "firmware/${L}" ] && echo "Used thirdparty ${L}" || echo "Missing ${L}"
fi
done <<<$(find output -name \*.ko -exec sh -c '/sbin/modinfo {} | grep ^firmware' \; | awk '{print $2}')
tar -zcf firmware.tgz -C firmware .
- name: Upload to Artifacts
uses: actions/upload-artifact@v4
with:
name: rr-cks${{ matrix.config }}-firmware
path: |
firmware.tgz
release:
runs-on: ubuntu-latest
needs: firmware
steps:
- name: Checkout
uses: actions/checkout@main
- name: Init Env
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
sudo timedatectl set-timezone "Asia/Shanghai"
- name: Calculate version
run: |
# Calculate version
VERSION=""
if [ -n "${{ inputs.version }}" ]; then
if [ "$(echo ${{ inputs.version }} | cut -d '.' -f 1,2)" = "$(date +'%y.%-m')" ]; then
VERSION="${{ inputs.version }}"
else
LATEST_TAG="$(curl -skLH "Authorization: token ${{ secrets.RRORG }}" "https://api.github.com/repos/RROrg/rr-cks/releases" | jq -r ".[0].tag_name" 2>/dev/null)"
if [ -n "${LATEST_TAG}" ] && [ "$(echo ${LATEST_TAG} | cut -d '.' -f 1,2)" = "$(date +'%y.%-m')" ]; then # format %y.%-m.$i
VERSION="$(echo ${LATEST_TAG} | awk -F '.' '{$3=$3+1}1' OFS='.')"
else
VERSION="$(date +'%y.%-m').0"
fi
fi
else
VERSION=""
fi
echo "VERSION: ${VERSION}"
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: download to artifacts
uses: actions/download-artifact@v4
with:
path: output
pattern: rr-cks-*
merge-multiple: true
- name: delete-artifact
uses: geekyeggo/delete-artifact@v5
with:
name: |
rr-cks-*
- name: Zip modules
run: |
VERSION="${{ env.VERSION }}"
VERSION="${VERSION:-"test"}"
echo "${VERSION}" > "output/VERSION"
zip -9 rr-cks-${VERSION}.zip -j output/*
- name: Upload to Artifacts
if: success() && env.VERSION == ''
uses: actions/upload-artifact@v4
with:
name: rr-cks
path: |
rr-cks-*.zip
retention-days: 5
- name: download to artifacts
uses: actions/download-artifact@v4
with:
path: outputdrm
pattern: rr-cksdrm-*
merge-multiple: true
- name: delete-artifact
uses: geekyeggo/delete-artifact@v5
with:
name: |
rr-cksdrm-*
- name: Zip modules
run: |
VERSION="${{ env.VERSION }}"
VERSION="${VERSION:-"test"}"
echo "${VERSION}" > "outputdrm/VERSION"
zip -9 rr-cksdrm-${VERSION}.zip -j outputdrm/*
#- name: Upload to Artifacts
# if: success() && env.VERSION == ''
# uses: actions/upload-artifact@v4
# with:
# name: rr-cksdrm
# path: |
# rr-cksdrm-*.zip
# retention-days: 5
- name: Release
if: success() && env.VERSION != ''
uses: ncipollo/release-action@v1
with:
tag: ${{ env.VERSION }}
prerelease: ${{ inputs.prerelease }}
artifacts: rr-cks*.zip
owner: RROrg
repo: rr-cks
token: ${{ secrets.RRORG }}