Skip to content

Commit d201431

Browse files
committed
add sample script to build 3rd r8125 driver
1 parent beb42bd commit d201431

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

.github/workflows/build.yml

+5
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,11 @@ jobs:
257257
cd project
258258
./build.sh uboot
259259
./build.sh kernel
260+
case ${{ matrix.CPU }} in
261+
rk3568)
262+
../scripts/3rd/add_r8125.sh
263+
;;
264+
esac
260265
261266
- name: Build sd image
262267
id: build_sd_image

scripts/3rd/add_r8125.sh

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
set -eu
3+
top_path=$(pwd)
4+
5+
# prepare toolchain and get the kernel version
6+
export PATH=/opt/FriendlyARM/toolchain/11.3-aarch64/bin/:$PATH
7+
pushd kernel
8+
kernel_ver=`make CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 kernelrelease`
9+
popd
10+
modules_dir=$(readlink -f ./out/output_*_kmodules/lib/modules/${kernel_ver})
11+
[ -d ${modules_dir} ] || {
12+
echo "please build kernel first."
13+
exit 1
14+
}
15+
16+
# build kernel driver
17+
git clone https://github.com/zeroday0619/r8125 -b main
18+
pushd r8125/src
19+
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -C ${top_path}/kernel M=$(pwd)
20+
aarch64-linux-gnu-strip --strip-unneeded r8125.ko
21+
cp r8125.ko ${modules_dir}/
22+
popd
23+
24+
# prepare rootfs overlay
25+
tmp_dir="${top_path}/r8125-files/etc/modules.d/"
26+
mkdir ${tmp_dir} -p
27+
echo "r8125" > ${tmp_dir}/10-r8125
28+
echo "FRIENDLYWRT_FILES+=(r8125-files)" >> .current_config.mk

scripts/wifi/add_rtl8852be.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ wget https://github.com/armbian/firmware/blob/master/rtl8852bu_fw -O ${firmware_
2525
git clone https://github.com/lwfinger/rtw89.git -b main
2626
(cd rtw89 && {
2727
git reset 38b8a48d04b8440266db6ea730e9b9cf84463981 --hard
28-
export PATH=/opt/FriendlyARM/toolchain/11.3-aarch64:$PATH
28+
export PATH=/opt/FriendlyARM/toolchain/11.3-aarch64/bin/:$PATH
2929

3030
if grep 'symbol:backport' ${modules_dir}/modules.symbols >/dev/null; then
3131
# kernel with backports

0 commit comments

Comments
 (0)