diff --git a/build.sh b/build.sh index b593bbd..bbd939e 100755 --- a/build.sh +++ b/build.sh @@ -31,6 +31,8 @@ RTL_8812BU_BRANCH=master RTL_8812CU_REPO=https://github.com/OpenHD/rtl88x2cu RTL_8812CU_BRANCH=master +RTL_8812EU_REPO=https://github.com/OpenHD/rtl88x2eu +RTL_8812EU_BRANCH=v5.15.0.1 RTL_8188EUS_REPO=https://github.com/gglluukk/rtl8188eus RTL_8188EUS_BRANCH=v5.3.9 @@ -133,6 +135,7 @@ build_pi_kernel() { build_rtl8812au_driver build_rtl8812bu_driver build_rtl8812cu_driver + build_rtl8812eu_driver #build_rtl8188eus_driver #build_reterminal_driver @@ -237,6 +240,8 @@ build_jetson_kernel() { build_rtl8812bu_driver fetch_rtl8812cu_driver build_rtl8812cu_driver + fetch_rtl8812eu_driver + build_rtl8812eu_driver depmod -b ${PACKAGE_DIR} ${KERNEL_VERSION} @@ -255,6 +260,7 @@ prepare_build() { fetch_rtl8812au_driver fetch_rtl8812bu_driver fetch_rtl8812cu_driver + fetch_rtl8812eu_driver #fetch_rtl8188eus_driver fetch_v4l2loopback_driver #fetch_reterminal_driver diff --git a/scripts/realtek.sh b/scripts/realtek.sh index ac1b3d9..eb8b6e7 100644 --- a/scripts/realtek.sh +++ b/scripts/realtek.sh @@ -139,6 +139,46 @@ function build_rtl8812cu_driver() { install -p -m 644 8812cu.ko "${PACKAGE_DIR}/lib/modules/${KERNEL_VERSION}/kernel/drivers/net/wireless/realtek/rtl88x2cu/" || exit 1 popd } + +function fetch_rtl8812eu_driver() { + + if [[ ! "$(ls -A rtl88x2eu)" ]]; then + echo "Download the rtl8812eu driver" + git clone ${RTL_8812CU_REPO} || exit 1 + fi + + pushd rtl88x2eu + git fetch || exit 1 + git reset --hard || exit 1 + git checkout ${RTL_8812EU_BRANCH} || exit 1 + git pull || exit 1 + + if [[ "${PLATFORM}" == "pi" ]]; then + sed -i 's/CONFIG_PLATFORM_I386_PC = y/CONFIG_PLATFORM_I386_PC = n/' Makefile || exit 1 + sed -i 's/CONFIG_PLATFORM_ARM_RPI = n/CONFIG_PLATFORM_ARM_RPI = y/' Makefile || exit 1 + fi + + sed -i 's/CONFIG_WIFI_MONITOR = n/CONFIG_WIFI_MONITOR = y\nCONFIG_AP_MODE = y/' Makefile || exit 1 + + sed -i 's/export TopDIR ?= $(shell pwd)/export TopDIR2 ?= $(shell pwd)/' Makefile || exit 1 + sed -i '/export TopDIR2 ?= $(shell pwd)/a export TopDIR := $(TopDIR2)/drivers/net/wireless/realtek/rtl88x2eu/' Makefile || exit 1 + popd +} + +function build_rtl8812eu_driver() { + pushd rtl88x2eu + if [[ "${PLATFORM}" == "jetson" ]]; then + export KERNEL_VERSION="4.9.253OpenHD-2.1-tegra" + export CROSS_COMPILE=$Tools/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- + make KSRC=${LINUX_DIR}/build -j $J_CORES M=$(pwd) modules || exit 1 + else + make KSRC=${LINUX_DIR} -j $J_CORES M=$(pwd) modules || exit 1 + fi + + mkdir -p ${PACKAGE_DIR}/lib/modules/${KERNEL_VERSION}/kernel/drivers/net/wireless/realtek/rtl88x2eu || exit 1 + install -p -m 644 8812cu.ko "${PACKAGE_DIR}/lib/modules/${KERNEL_VERSION}/kernel/drivers/net/wireless/realtek/rtl88x2eu/" || exit 1 + popd +} # ========================================================== # function fetch_rtl8188eus_driver() {