Driver For mt7662u_sta WiFi

Hi,

I’m away from my vero at the moment, but I think you the linux-compiler package, I’m not sure if that’s the name of the package; try apt search

I’ll try an verify the package later on this evening.

Thanks Tom.

Tom,

apt search yielded linux-compiler-gcc-6-arm so I installed this (sudo apt-get install linux-compiler-gcc-6-arm). Sadly I get the same error on make

I did some Googling, there are some Pi OSMC posts, but not sure these are relevant (sorry, a bit beyond me), plus some Odroid ones. All seem to reference that the memory.h file is not properly installed by apt-get

For reference:

RPi3 TP-link T1U kernel module build: missing mach/memory.h

Compiling TV4l drivers failure

fatal error: mach/memory.h: No such file - ODROID

Arch Linux ARM • View topic - Odroid C1: Issue compiling application: mach/memory.h

I tried make ARCH=arm as suggested by one post, but same outcome, and sudo find /usr | grep mach/memory\\.h yields no results (I used \\ to ‘escape’ the . - hopefully that’s right…)

osmc@VERO2OSMC:~$ sudo find /usr | grep mach/memory\\.h
osmc@VERO2OSMC:~$ 

As always, any thoughts welcome.

Tony

Probably easier to just build a kernel and you’ll have all headers.

git clone GitHub - osmc/osmc: OSMC (Open Source Media Center) is a free and open source media center distribution
cd package/kernel-osmc
make vero2

1 Like

Hi,

I’ve just checked and linux-compiler-gcc-6-arm is the package I was referring to. I would do as Sam suggests and compile the kernel.

Thanks Tom.

Doing it now - it takes a while!! :slight_smile:

1 Like

So, the make of the kernel finally competed, and I returned to try to make the driver - which gave the same error, as below… :frowning:

/usr/src/vero2-headers-3.10.105-12-osmc/arch/arm/include/asm/memory.h:22:25: fatal error: mach/memory.h: No such file or directory
 #include <mach/memory.h>
                         ^
compilation terminated.

Regards,

Tony

Hi,

Where did you build the source, the folder location?

Also have you tried doing a find mach/memory.h

May need a symlink?

Thanks Tom.

I built the kernel source in ~/osmc/package/kernel-osmc/ and the driver source in ~/Netgear-A6210

sudo find /usr | grep mach/memory\\.h still returns nothing.

Hi,

Please provide the output:

ls -lah ~/osmc/package/kernel-osmc/

Thanks Tom.

Here you go:

osmc@VERO2OSMC:~$ ls -lah ~/osmc/package/kernel-osmc/
total 124M
drwxr-xr-x  8 osmc osmc 4.0K May 11 00:59 .
drwxr-xr-x 69 osmc osmc 4.0K May 10 22:51 ..
-rw-r--r--  1 osmc osmc  481 May 10 22:51 Makefile
-rwxr-xr-x  1 osmc osmc  15K May 10 22:51 build.sh
drwxr-xr-x  4 osmc osmc 4.0K May 10 22:51 files
drwxr-xr-x  5 root root 4.0K May 11 00:58 files-headers
drwxr-xr-x  7 root root 4.0K May 11 00:57 files-image
drwxr-xr-x  7 osmc osmc 4.0K May 10 23:14 initramfs-src
drwxr-xr-x  2 osmc osmc  12K May 10 22:51 patches
drwxr-xr-x  3 root root 4.0K May 11 00:56 src
-rw-r--r--  1 root root 6.3M May 11 00:59 vero2-headers-3.10.105-12-osmc.deb
-rw-r--r--  1 root root 9.9M May 11 00:58 vero2-image-3.10.105-12-osmc.deb
-rw-r--r--  1 root root  952 May 11 00:59 vero2-kernel-3.10.105-12-osmc.deb
-rw-r--r--  1 root root 108M May 11 00:50 vero2-source-3.10.105-12-osmc_12_all.deb
osmc@VERO2OSMC:~$

Hi,

I’ve had a look at the build.sh, from looking at this, I’m guessing the file is located something like:

~/osmc/package/kernel-osmc/files-headers/usr/src/*-headers-${VERSION}-${REV}-osmc/include/asm/

I would check there.

Thanks Tom.

Tom,

Thanks for your continued patience on this.

The contents of that directory are as below. No memory.h, plus asm-arm is linked to itself which doesn’t seem right…

Regards,

Tony

osmc@VERO2OSMC:~/osmc/package/kernel-osmc/files-headers/usr/src/vero2-headers-3.10.105-12-osmc/include/asm$ ls -lah
total 164K
drwxr-xr-x  2 root root 4.0K May 11 00:58 .
drwxr-xr-x 31 root root 4.0K May 11 00:58 ..
-rw-r--r--  1 root root 1.6K May 11 00:22 ..install.cmd
-rw-r--r--  1 root root    0 May 11 00:22 .install
lrwxrwxrwx  1 root root    7 May 11 00:22 asm-arm -> asm-arm
-rw-r--r--  1 root root   32 May 11 00:22 auxvec.h
-rw-r--r--  1 root root   37 May 11 00:22 bitsperlong.h
-rw-r--r--  1 root root  648 May 11 00:22 byteorder.h
-rw-r--r--  1 root root   31 May 11 00:22 errno.h
-rw-r--r--  1 root root  292 May 11 00:22 fcntl.h
-rw-r--r--  1 root root  869 May 11 00:22 hwcap.h
-rw-r--r--  1 root root   31 May 11 00:22 ioctl.h
-rw-r--r--  1 root root  120 May 11 00:22 ioctls.h
-rw-r--r--  1 root root   32 May 11 00:22 ipcbuf.h
-rw-r--r--  1 root root 5.7K May 11 00:22 kvm.h
-rw-r--r--  1 root root   34 May 11 00:22 kvm_para.h
-rw-r--r--  1 root root  145 May 11 00:22 mman.h
-rw-r--r--  1 root root   32 May 11 00:22 msgbuf.h
-rw-r--r--  1 root root   31 May 11 00:22 param.h
-rw-r--r--  1 root root   30 May 11 00:22 poll.h
-rw-r--r--  1 root root 1000 May 11 00:22 posix_types.h
-rw-r--r--  1 root root 3.4K May 11 00:22 ptrace.h
-rw-r--r--  1 root root   34 May 11 00:22 resource.h
-rw-r--r--  1 root root   32 May 11 00:22 sembuf.h
-rw-r--r--  1 root root 3.9K May 11 00:22 setup.h
-rw-r--r--  1 root root   32 May 11 00:22 shmbuf.h
-rw-r--r--  1 root root  768 May 11 00:22 sigcontext.h
-rw-r--r--  1 root root   33 May 11 00:22 siginfo.h
-rw-r--r--  1 root root 2.7K May 11 00:22 signal.h
-rw-r--r--  1 root root   32 May 11 00:22 socket.h
-rw-r--r--  1 root root   33 May 11 00:22 sockios.h
-rw-r--r--  1 root root 1.9K May 11 00:22 stat.h
-rw-r--r--  1 root root  360 May 11 00:22 statfs.h
-rw-r--r--  1 root root 1.3K May 11 00:22 swab.h
-rw-r--r--  1 root root   34 May 11 00:22 termbits.h
-rw-r--r--  1 root root   33 May 11 00:22 termios.h
-rw-r--r--  1 root root   31 May 11 00:22 types.h
-rw-r--r--  1 root root  20K May 11 00:22 unistd.h

I Hi,

Sorry not sure, @sam_nazarko any further ideas?

Thanks Tom.

@tmenzies I’ve being doing some more digging, but I’m not sure if its right or; I would reccomend waiting for @sam_nazarko to confirm the below:

I think memory.h is located in vero2-source-$(uname -r) (sudo apt-get install)
It get installed as tar.bz2 which needs to be extracted.

memory.h still isn’t located as you would expect:

/usr/src/vero2-headers-3.10.105-4-osmc/arch/arm/include/asm/mach/

Its located in the mach folder based on the cpu I belive, so I think its:

/vero2-source-3.10.105-4-osmc/arch/arm/mach-meson8b/include/mach/

I think the correct memory.h is located in that folder. S805 SoC = meson8b, Sam it would be good if you please confirm this.

You can either copy the memory.h to /usr/src/vero2-headers-3.10.105-4-osmc/arch/arm/include/asm/mach/ or make a symlink.

Tom.

@Tom_Doyle, thanks for sticking with it. Sounds complicated :persevere: so, as you suggest, I’ll wait for @sam_nazarko to confirm before I embark upon this one!! :grin:

Are we getting close to the point where we decide that my existing WiFi dongle is good enough… :thinking:

This is what I’d do:

Build Vero 2 kernel
cd to osmc git directory
mount --bind $(pwd) /opt/osmc-tc/armv7-toolchain-osmc/mnt
chroot /opt/osmc-tc/armv7-toolchain-osmc
cd mnt/package/kernel-osmc/src/*
mkdir -p drivers/net/wireless
add your source there

Use a patch similar to Fix ksrc · osmc/rtl8812au-osmc@ddcabb6 · GitHub on the Makefile to fix the directory to use current source kernel path

run make

copy .ko to /lib/modules/($uname -r)

1 Like

Dumb question - I have already built the Vero2 kernel as part of our earlier steps, so is it correct to assume that I don’t need to repeat that step?

OK, so I have proceeded on the basis of the above assumption. When I used git to download the OSMC kernel it put it in a directory called osmc off of the osmc user’s home directory (ie ~/osmc) so I am assuming this is the ‘osmc git directory’.

Also, in order to make the Netgear-A6210 source available to me after the mount/chroot I moved it into the ‘osmc git directory’ (ie ~/osmc/Netgear-A6210) so it was accessible at /mnt/Netgear-A6210 after the mount/chroot.

Then, off we go:

osmc@VERO2OSMC:~$ cd osmc
osmc@VERO2OSMC:~/osmc$ sudo mount --bind $(pwd) /opt/osmc-tc/armv7-toolchain-osmc/mnt
osmc@VERO2OSMC:~/osmc$ sudo chroot /opt/osmc-tc/armv7-toolchain-osmc
root@VERO2OSMC:/# cd mnt/package/kernel-osmc/src/*
root@VERO2OSMC:/mnt/package/kernel-osmc/src/vero2-linux-master# mkdir -p drivers/net/wireless
root@VERO2OSMC:/mnt/package/kernel-osmc/src/vero2-linux-master# cd  drivers/net/wireless
root@VERO2OSMC:/mnt/package/kernel-osmc/src/vero2-linux-master/drivers/net/wireless# cp -R -i -v /mnt/Netgear-A6210/os/linux/* .
cp: overwrite './Kconfig'? n
'/mnt/Netgear-A6210/os/linux/Kconfig.ap.soc' -> './Kconfig.ap.soc'
'/mnt/Netgear-A6210/os/linux/Kconfig.ap.usb' -> './Kconfig.ap.usb'
'/mnt/Netgear-A6210/os/linux/Kconfig.rlt_wifi' -> './Kconfig.rlt_wifi'
'/mnt/Netgear-A6210/os/linux/Kconfig.rlt_wifi_ap' -> './Kconfig.rlt_wifi_ap'
'/mnt/Netgear-A6210/os/linux/Kconfig.rlt_wifi_sta' -> './Kconfig.rlt_wifi_sta'
'/mnt/Netgear-A6210/os/linux/Kconfig.sta.soc' -> './Kconfig.sta.soc'
'/mnt/Netgear-A6210/os/linux/Kconfig.wifi' -> './Kconfig.wifi'
cp: overwrite './Makefile'? n
'/mnt/Netgear-A6210/os/linux/Makefile.6' -> './Makefile.6'
'/mnt/Netgear-A6210/os/linux/Makefile.clean' -> './Makefile.clean'
'/mnt/Netgear-A6210/os/linux/cfg80211' -> './cfg80211'
'/mnt/Netgear-A6210/os/linux/cfg80211/cfg80211.c' -> './cfg80211/cfg80211.c'
'/mnt/Netgear-A6210/os/linux/cfg80211/cfg80211_ap.c' -> './cfg80211/cfg80211_ap.c'
'/mnt/Netgear-A6210/os/linux/cfg80211/cfg80211_inf.c' -> './cfg80211/cfg80211_inf.c'
'/mnt/Netgear-A6210/os/linux/cfg80211/cfg80211_p2p.c' -> './cfg80211/cfg80211_p2p.c'
'/mnt/Netgear-A6210/os/linux/cfg80211/cfg80211_rx.c' -> './cfg80211/cfg80211_rx.c'
'/mnt/Netgear-A6210/os/linux/cfg80211/cfg80211_scan.c' -> './cfg80211/cfg80211_scan.c'
'/mnt/Netgear-A6210/os/linux/cfg80211/cfg80211_tx.c' -> './cfg80211/cfg80211_tx.c'
'/mnt/Netgear-A6210/os/linux/cfg80211/cfg80211_util.c' -> './cfg80211/cfg80211_util.c'
'/mnt/Netgear-A6210/os/linux/cfg80211/cfg80211drv.c' -> './cfg80211/cfg80211drv.c'
'/mnt/Netgear-A6210/os/linux/config.mk' -> './config.mk'
'/mnt/Netgear-A6210/os/linux/rt_linux.c' -> './rt_linux.c'
'/mnt/Netgear-A6210/os/linux/rt_main_dev.c' -> './rt_main_dev.c'
'/mnt/Netgear-A6210/os/linux/rt_proc.c' -> './rt_proc.c'
'/mnt/Netgear-A6210/os/linux/rt_profile.c' -> './rt_profile.c'
'/mnt/Netgear-A6210/os/linux/rt_usb.c' -> './rt_usb.c'
'/mnt/Netgear-A6210/os/linux/rt_usb_util.c' -> './rt_usb_util.c'
'/mnt/Netgear-A6210/os/linux/sta_ioctl.c' -> './sta_ioctl.c'
'/mnt/Netgear-A6210/os/linux/usb_main_dev.c' -> './usb_main_dev.c'
root@VERO2OSMC:/mnt/package/kernel-osmc/src/vero2-linux-master/drivers/net/wireless# 

I was cautious with the cp and chose not to overwrite the duplicate Kconfig and Makefile when prompted.

So two questions before I proceed onto the next steps:

  • Was I correct not to overwrite these two files?
  • Have I performed the steps correctly thus far?

Regards,

Tony