OpenWrt Forum Archive

Topic: git or svn?

The content of this topic has been archived on 9 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I try to compile:

git clone git://git.openwrt.org/openwrt.git

but it always end with a failure in gcc where some dependency to libc are missing.

Now i try

svn co svn://svn.openwrt.org/openwrt/trunk/

is it the same sources??? At least when using svn i see the revision number which looks current.

Looks I don't get further...all I want is to compile a driver for my usb wifi....

Is there a other way to get this compiled for openwrt Raspberry PI 2 ?

http://www.edimax.com/edimax/download/d … ew-7811uac

it can't be that complicate to get a compiler on a existing snapshot or not?

(Last edited by Argosy on 6 Jan 2016, 23:26)

You can see the svn revision number in git log, and you can see from the commit dates that those are the same source and synced.


You have to create an OpenWrt Makefile where you compile that driver as a module for OpenWrt.
There are other drivers in OpenWrt: mt76 or mwlwifi
Look at those Makefiles and you see how compiling a driver for OpenWrt works.

If its more complicated you might complain to Realtek or Edimax for not providing a driver thats integrated into Linux Kernel like many other wireless drivers.

as a reference: https://wikidevi.com/wiki/Edimax_EW-7811UAC

Afaik there might be some USB sticks or solutions that provide ac over USB (Mediatek mt7601u hardware is enabled in OpenWrt)

Hello zloop,

thanks for your help.

So I need to crosscompile the driver? I though i could just install gcc on the openwrt and compile that little piece of software there.

Well...then i try this road now :-)

Argosy wrote:

So I need to crosscompile the driver?

Yes.

And Openwrt's kernel module checksum system is so strict that you can't install that new kernel module to be used with an old kernel. You have to cross-compile the kernel at the same time. (In practice, the whole firmware)

Anyone has a documentation to the buildroot system used for openwrt?

I was reading buildroot.org but i strugle with the different directory structur.

Argosy wrote:

Looks I don't get further...all I want is to compile a driver for my usb wifi....

Is there a other way to get this compiled for openwrt Raspberry PI 2 ?

http://www.edimax.com/edimax/download/d … ew-7811uac

it can't be that complicate to get a compiler on a existing snapshot or not?

HI
another device I maybe need in may (home) lab,
for RTL8812/RTL8821 driver check
Is this antenna detachable ??

(Last edited by elektroman on 7 Jan 2016, 18:27)

HI
another device I maybe need in may (home) lab,
for RTL8812/RTL8821 driver check
Is this antenna detachable ??


Well yes it is since, raspberry Pi dosn't have a Wifi you need to use a usb wifi wich of course is detachable, like any other usb device. Or did i misunderstood you somehow?

Argosy wrote:

HI
another device I maybe need in may (home) lab,
for RTL8812/RTL8821 driver check
Is this antenna detachable ??


Well yes it is since, raspberry Pi dosn't have a Wifi you need to use a usb wifi wich of course is detachable, like any other usb device. Or did i misunderstood you somehow?

Good.
I've plenty of this devices laying around here for testing, your is the newest.

for the driver itself to work with openwrt read here
https://github.com/ulli-kroll/rtl8821au
This is my repo

The time I wrote this README I've tested some devices on Carambola 1,
some RT3052 platform.

You don't need to change your buildsystem

(Last edited by elektroman on 8 Jan 2016, 15:19)

@elektroman Thanks..i will check your link

I found some documentation and can now compile the rtl8812au drivers in openwrt...well at least for x86. But when I choose Target ARM i get this here:

make[3]: Entering directory `/home/stg/openwrt/package/kernel/rtl8812au'
CFLAGS="-Os -pipe -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro  -I/home/stg/openwrt/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl-1.1.11_eabi/usr/include -I/home/stg/openwrt/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl-1.1.11_eabi/include -I/home/stg/openwrt/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-5.2.0_musl-1.1.11_eabi/usr/include -I/home/stg/openwrt/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-5.2.0_musl-1.1.11_eabi/include/fortify -I/home/stg/openwrt/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-5.2.0_musl-1.1.11_eabi/include " CXXFLAGS="-Os -pipe -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro  -I/home/stg/openwrt/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl-1.1.11_eabi/usr/include -I/home/stg/openwrt/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl-1.1.11_eabi/include -I/home/stg/openwrt/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-5.2.0_musl-1.1.11_eabi/usr/include -I/home/stg/openwrt/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-5.2.0_musl-1.1.11_eabi/include/fortify -I/home/stg/openwrt/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-5.2.0_musl-1.1.11_eabi/include " LDFLAGS="-L/home/stg/openwrt/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl-1.1.11_eabi/usr/lib -L/home/stg/openwrt/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl-1.1.11_eabi/lib -L/home/stg/openwrt/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-5.2.0_musl-1.1.11_eabi/usr/lib -L/home/stg/openwrt/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-5.2.0_musl-1.1.11_eabi/lib -znow -zrelro " make -j1 -C /home/stg/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl-1.1.11_eabi/linux-brcm2708_bcm2709/rtl8812au-0.9.2/. AR="arm-openwrt-linux-muslgnueabi-gcc-ar" AS="arm-openwrt-linux-muslgnueabi-gcc -c -Os -pipe -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" LD=arm-openwrt-linux-muslgnueabi-ld NM="arm-openwrt-linux-muslgnueabi-gcc-nm" CC="arm-openwrt-linux-muslgnueabi-gcc" GCC="arm-openwrt-linux-muslgnueabi-gcc" CXX="arm-openwrt-linux-muslgnueabi-g++" RANLIB="arm-openwrt-linux-muslgnueabi-gcc-ranlib" STRIP=arm-openwrt-linux-muslgnueabi-strip OBJCOPY=arm-openwrt-linux-muslgnueabi-objcopy OBJDUMP=arm-openwrt-linux-muslgnueabi-objdump SIZE=arm-openwrt-linux-muslgnueabi-size CROSS="arm-openwrt-linux-muslgnueabi-" ARCH="arm" ;
make[4]: Entering directory `/home/stg/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl-1.1.11_eabi/linux-brcm2708_bcm2709/rtl8812au-0.9.2'
make ARCH=arm CROSS_COMPILE= -C /lib/modules/3.19.0-43-generic/build M=/home/stg/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl-1.1.11_eabi/linux-brcm2708_bcm2709/rtl8812au-0.9.2  modules
make[5]: Entering directory `/usr/src/linux-headers-3.19.0-43-generic'
  CC [M]  /home/stg/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl-1.1.11_eabi/linux-brcm2708_bcm2709/rtl8812au-0.9.2/core/rtw_cmd.o
In file included from include/asm-generic/int-ll64.h:10:0,
                 from ./arch/arm/include/asm/types.h:4,
                 from include/uapi/linux/types.h:4,
                 from include/linux/types.h:5,
                 from /home/stg/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl-1.1.11_eabi/linux-brcm2708_bcm2709/rtl8812au-0.9.2/include/basic_types.h:80,
                 from /home/stg/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl-1.1.11_eabi/linux-brcm2708_bcm2709/rtl8812au-0.9.2/include/drv_types.h:31,
                 from /home/stg/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl-1.1.11_eabi/linux-brcm2708_bcm2709/rtl8812au-0.9.2/core/rtw_cmd.c:22:
include/uapi/asm-generic/int-ll64.h:11:29: fatal error: asm/bitsperlong.h: No such file or directory
compilation terminated.


anyone know what is wrong?

Please post your cmdline for compiling the module

As I can see this is not "my" source
-> rtl8812au-0.9.2

This is the problem:

Argosy wrote:

make ARCH=arm CROSS_COMPILE= -C /lib/modules/3.19.0-43-generic/build M=/home/stg/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl-1.1.11_eabi/linux-brcm2708_bcm2709/rtl8812au-0.9.2  modules
make[5]: Entering directory `/usr/src/linux-headers-3.19.0-43-generic'

The build is using the host kernel source dir, instead of the openwrt one.

Oha !

I'm not the Makefile specialist. Can someone help me correct this?

elektroman wrote:

Please post your cmdline for compiling the module

As I can see this is not "my" source
-> rtl8812au-0.9.2

doch doch war dein Sources...ich hab im Makefile noch ein PKG_VERSION drin.

Wie kann ich denn deine Source in Buildroot Compilieren? ich hab es mit diesem Makefile versucht:

#
# Copyright (C) 2008 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
I2CMENU:=rtl8812au

include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk


PKG_NAME:=rtl8812au
PKG_RELEASE:=2
PKG_VERSION:=0.9.2

PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)


include $(INCLUDE_DIR)/package.mk

define KernelPackage/rtl8812au
        SUBMENU:=Wireless Drivers
        TITLE:=rtl8812au device
        FILES:=$(PKG_BUILD_DIR)/8812au.ko
        AUTOLOAD:=$(call AutoLoad,50,rtl8812au)
endef

define KernelPackage/i2c-gpio-custom/description
Kernel module rtl8812au device.
endef

MAKE_OPTS:= \
        ARCH="$(LINUX_KARCH)" \
        CROSS_COMPILE="$(TARGET_CROSS)" \
        SUBDIRS="$(PKG_BUILD_DIR)" \
        EXTRA_CFLAGS="$(EXTRA_CFLAGS) \
        $(EXTRA_KCONFIG)

define Build/Prepare
        mkdir -p $(PKG_BUILD_DIR)
        $(CP) ./src/* $(PKG_BUILD_DIR)/
endef



$(eval $(call KernelPackage,rtl8812au))

Hi,

use
package/kernel/mt76/
as template
i.e
package/kernel/rtl8812au

and so on
please checkout a new branch, so you didn't lost your local changes

The discussion might have continued from here.