无法为 AWUS036ACH 制作驱动程序
Can't make driver for AWUS036ACH
我有一个 Raspberry Pi 4,我需要创建一个支持 AWUS036ACH 的基于 openwrt 的系统的映像。
我已完成以下步骤:
- 为 buildroot 工具创建了自己的包,其 makefile 包含 "Build/Compile" 部分:
define Build/Compile
@echo "-----------------"
@echo "CC=$(TARGET_CC)"
@echo "-----------------"
$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
CC="$(TARGET_CC)" \
KERNEL_SOURCE="$(LINUX_DIR)" \
TARGET_CFLAGS="$(TARGET_CFLAGS)" \
TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \
M="$(PKG_BUILD_DIR)"
endef
- 我从 https://github.com/aircrack-ng/rtl8812au/ 下载了驱动程序源并对它们的 Makefile 进行了更改:
modules:
$(MAKE) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KERNEL_SOURCE) M=$(M) LDFLAGS="$(TARGET_LDFLAGS)" CFLAGS="$(TARGET_CFLAGS)" modules
@echo "---------------------------------------------------------------------------"
@echo "Visit https://github.com/aircrack-ng/rtl8812au for support/reporting issues"
@echo "or check for newer versions (branches) of these drivers. "
@echo "---------------------------------------------------------------------------"
但是,当我开始构建系统时,出现错误:
make -j1 -C "/home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0" CC="aarch64-openwrt-linux-musl-gcc" KERNEL_SOURCE="/home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/linux-5.4.31" TARGET_CFLAGS="-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0=Alfa-WiFi-1.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" TARGET_LDFLAGS="-L/home/aleks/openwrt/source/staging_dir/target-aarch64_cortex-a72_musl/usr/lib -L/home/aleks/openwrt/source/staging_dir/target-aarch64_cortex-a72_musl/lib -L/home/aleks/openwrt/source/staging_dir/toolchain-aarch64_cortex-a72_gcc-8.4.0_musl/usr/lib -L/home/aleks/openwrt/source/staging_dir/toolchain-aarch64_cortex-a72_gcc-8.4.0_musl/lib -znow -zrelro" M="/home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0"
make[4]: Entering directory '/home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0'
make ARCH=arm64 CC=aarch64-openwrt-linux-musl-gcc CROSS_COMPILE= -C /home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/linux-5.4.31 M=/home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0 LDFLAGS="-L/home/aleks/openwrt/source/staging_dir/target-aarch64_cortex-a72_musl/usr/lib -L/home/aleks/openwrt/source/staging_dir/target-aarch64_cortex-a72_musl/lib -L/home/aleks/openwrt/source/staging_dir/toolchain-aarch64_cortex-a72_gcc-8.4.0_musl/usr/lib -L/home/aleks/openwrt/source/staging_dir/toolchain-aarch64_cortex-a72_gcc-8.4.0_musl/lib -znow -zrelro" CFLAGS="-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0=Alfa-WiFi-1.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" modules
make[5]: Entering directory '/home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/linux-5.4.31'
arch/arm64/Makefile:27: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum
CC [M] /home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0/core/rtw_cmd.o
CC [M] /home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0/core/rtw_security.o
....
....
CC [M] /home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0/core/rtw_mp.o
LD [M] /home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0/88XXau.o
ld: unrecognised emulation mode: aarch64linux
Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu i386linux elf_l1om elf_k1om i386pep i386pe
scripts/Makefile.build:437: recipe for target '/home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0/88XXau.o' failed
请帮帮我!
看起来您正在使用主机工具链(至少是 ld)。
您的 CROSS_COMPILE 选项为空。
我有一个 Raspberry Pi 4,我需要创建一个支持 AWUS036ACH 的基于 openwrt 的系统的映像。
我已完成以下步骤:
- 为 buildroot 工具创建了自己的包,其 makefile 包含 "Build/Compile" 部分:
define Build/Compile
@echo "-----------------"
@echo "CC=$(TARGET_CC)"
@echo "-----------------"
$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
CC="$(TARGET_CC)" \
KERNEL_SOURCE="$(LINUX_DIR)" \
TARGET_CFLAGS="$(TARGET_CFLAGS)" \
TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \
M="$(PKG_BUILD_DIR)"
endef
- 我从 https://github.com/aircrack-ng/rtl8812au/ 下载了驱动程序源并对它们的 Makefile 进行了更改:
modules:
$(MAKE) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KERNEL_SOURCE) M=$(M) LDFLAGS="$(TARGET_LDFLAGS)" CFLAGS="$(TARGET_CFLAGS)" modules
@echo "---------------------------------------------------------------------------"
@echo "Visit https://github.com/aircrack-ng/rtl8812au for support/reporting issues"
@echo "or check for newer versions (branches) of these drivers. "
@echo "---------------------------------------------------------------------------"
但是,当我开始构建系统时,出现错误:
make -j1 -C "/home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0" CC="aarch64-openwrt-linux-musl-gcc" KERNEL_SOURCE="/home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/linux-5.4.31" TARGET_CFLAGS="-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0=Alfa-WiFi-1.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" TARGET_LDFLAGS="-L/home/aleks/openwrt/source/staging_dir/target-aarch64_cortex-a72_musl/usr/lib -L/home/aleks/openwrt/source/staging_dir/target-aarch64_cortex-a72_musl/lib -L/home/aleks/openwrt/source/staging_dir/toolchain-aarch64_cortex-a72_gcc-8.4.0_musl/usr/lib -L/home/aleks/openwrt/source/staging_dir/toolchain-aarch64_cortex-a72_gcc-8.4.0_musl/lib -znow -zrelro" M="/home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0"
make[4]: Entering directory '/home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0'
make ARCH=arm64 CC=aarch64-openwrt-linux-musl-gcc CROSS_COMPILE= -C /home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/linux-5.4.31 M=/home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0 LDFLAGS="-L/home/aleks/openwrt/source/staging_dir/target-aarch64_cortex-a72_musl/usr/lib -L/home/aleks/openwrt/source/staging_dir/target-aarch64_cortex-a72_musl/lib -L/home/aleks/openwrt/source/staging_dir/toolchain-aarch64_cortex-a72_gcc-8.4.0_musl/usr/lib -L/home/aleks/openwrt/source/staging_dir/toolchain-aarch64_cortex-a72_gcc-8.4.0_musl/lib -znow -zrelro" CFLAGS="-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0=Alfa-WiFi-1.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" modules
make[5]: Entering directory '/home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/linux-5.4.31'
arch/arm64/Makefile:27: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum
CC [M] /home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0/core/rtw_cmd.o
CC [M] /home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0/core/rtw_security.o
....
....
CC [M] /home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0/core/rtw_mp.o
LD [M] /home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0/88XXau.o
ld: unrecognised emulation mode: aarch64linux
Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu i386linux elf_l1om elf_k1om i386pep i386pe
scripts/Makefile.build:437: recipe for target '/home/aleks/openwrt/source/build_dir/target-aarch64_cortex-a72_musl/linux-bcm27xx_bcm2711/Alfa-WiFi-1.0/88XXau.o' failed
请帮帮我!
看起来您正在使用主机工具链(至少是 ld)。 您的 CROSS_COMPILE 选项为空。