1
0
mirror of https://github.com/aircrack-ng/rtl8812au.git synced 2024-11-22 13:24:36 +00:00
rtl8812au/.github/workflows/raspberry.yml

108 lines
4.9 KiB
YAML
Raw Normal View History

2022-07-31 18:23:17 +00:00
name: Raspberry Pi Build
on:
create:
tags:
- '/^v[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+[A-Za-z0-9]*$/'
workflow_dispatch:
jobs:
build:
2023-04-18 20:07:17 +00:00
strategy:
matrix:
version: ["buster", "bullseye"]
2022-07-31 18:23:17 +00:00
runs-on: ubuntu-22.04
name: Build RTL8812AU driver for Raspberry Pi
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y curl gnupg2 curl
sudo apt-get install -y gcc-arm-linux-gnueabihf crossbuild-essential-arm64 make
sudo curl -fsSL http://archive.raspberrypi.org/debian/raspberrypi.gpg.key --output /usr/share/keyrings/raspberrypi.gpg.key
2023-04-18 20:07:17 +00:00
echo "deb [arch=amd64, signed-by=/usr/share/keyrings/raspberrypi.gpg.key] http://archive.raspberrypi.org/debian/ ${{ matrix.version }} main" | sudo tee /etc/apt/sources.list.d/raspberrypi.list > /dev/null
sudo apt-get update
sudo apt-get install -y raspberrypi-kernel-headers
2022-07-31 18:23:17 +00:00
- name: Build Pi kernel drivers
id: build_raspberry
run: |
sed -i 's/CONFIG_PLATFORM_I386_PC = y/CONFIG_PLATFORM_I386_PC = n/g' Makefile
sed -i 's/CONFIG_PLATFORM_ARM_RPI = n/CONFIG_PLATFORM_ARM_RPI = y/g' Makefile
for kernel_folder in /lib/modules/*+; do
kver=`basename "$kernel_folder"`
if [[ $kver =~ "v8" ]]; then
2022-07-31 18:23:17 +00:00
target_arch="arm64"
cross="aarch64-linux-gnu-"
else
target_arch="arm"
cross="arm-linux-gnueabihf-"
fi
echo "Cross compiling" "$kver" "for arch" "$target_arch"
make clean > log.txt
make ARCH=$target_arch CROSS_COMPILE=$cross KVER=$kver -j$(nproc) > log.txt && mkdir -p build/raspberrypi/$kver/ && cp 88XXau.ko build/raspberrypi/$kver/
echo kernel_ver="$(echo $kver | cut -f 1 -d -)" >> $GITHUB_OUTPUT
2022-07-31 18:23:17 +00:00
done
2023-04-18 20:07:17 +00:00
- name: Compress artifacts
run: |
tar czvf rtl8812au-raspberrypi-${{ steps.build_raspberry.outputs.kernel_ver }}.tar.gz -C build/raspberrypi/ .
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: RPi ${{ matrix.version }} kernel drivers
path: rtl8812au*.tar.gz
kalibuild:
runs-on: ubuntu-22.04
2023-05-02 11:43:54 +00:00
name: Build RTL8812AU driver for Raspberry Pi (re4son)
2023-04-18 20:07:17 +00:00
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y curl gnupg2 curl
sudo apt-get install -y gcc-arm-linux-gnueabihf crossbuild-essential-arm64 make
2022-07-31 18:23:17 +00:00
- name: Build Re4son kernel drivers
id: build_kali
run: |
sudo apt-get -y install qemu-system-arm qemu-user-static binfmt-support > /dev/null
curl -fsSL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x96d00b0c4b00fd5360cc087711764ee8ac24832f" | sudo gpg --dearmor -o /usr/share/keyrings/kali.gpg
echo "deb [arch=armel,armhf,arm64 signed-by=/usr/share/keyrings/kali.gpg] http://http.re4son-kernel.com/re4son/ kali-pi main" | sudo tee /etc/apt/sources.list.d/kali.list
sudo sed -i 's/deb http/deb [arch=amd64] http/g' /etc/apt/sources.list
2022-07-31 18:23:17 +00:00
sed -i 's/CONFIG_PLATFORM_I386_PC = y/CONFIG_PLATFORM_I386_PC = n/g' Makefile
sed -i 's/CONFIG_PLATFORM_ARM_RPI = n/CONFIG_PLATFORM_ARM_RPI = y/g' Makefile
for arch in "armel" "armhf" "arm64"; do
echo "Adding arch" "$arch"
sudo dpkg --add-architecture "$arch"
sudo apt-get update
sudo apt-get install -y kalipi-kernel-headers:"$arch"
2022-07-31 18:23:17 +00:00
for kernel_folder in /lib/modules/*Re4son*; do
kver=`basename "$kernel_folder"`
if [[ $kver =~ "v8" ]]; then
target_arch="arm64"
cross="aarch64-linux-gnu-"
sudo ln -fs /usr/aarch64-linux-gnu/lib/libc.so.6 /lib/libc.so.6
sudo ln -fs /usr/aarch64-linux-gnu/lib/ld-linux-aarch64.so.1 /lib/ld-linux-aarch64.so.1
else
target_arch="arm"
cross="arm-linux-gnueabihf-"
sudo ln -fs /usr/arm-linux-gnueabihf/lib/libc.so.6 /lib/libc.so.6
sudo ln -fs /usr/arm-linux-gnueabihf/lib/ld-linux-armhf.so.3 /lib/ld-linux-armhf.so.3
sudo ln -fs /usr/arm-linux-gnueabihf/lib/ld-linux.so.3 /lib/ld-linux.so.3
fi
2022-07-31 18:23:17 +00:00
echo "Cross compiling" "$kver" "for arch" "$target_arch"
make clean > log.txt
make ARCH=$target_arch CROSS_COMPILE=$cross KVER=$kver -j$(nproc) > log.txt && mkdir -p build/kalipi/$kver/ && cp 88XXau.ko build/kalipi/$kver/
echo kernel_ver="$(echo $kver | cut -f 1 -d -)" >> $GITHUB_OUTPUT
2022-07-31 18:23:17 +00:00
done
done
- name: Compress artifacts
run: |
tar czvf rtl8812au-kalipi-${{ steps.build_kali.outputs.kernel_ver }}.tar.gz -C build/kalipi/ .
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
2023-04-18 20:07:17 +00:00
name: RPi re4son kernel drivers
path: rtl8812au*.tar.gz