LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 09-16-2018, 08:40 PM   #1
disa
LQ Newbie
 
Registered: Sep 2018
Posts: 4

Rep: Reputation: Disabled
Kernel (3.4) module build error


Hello

I am kinda new to linux.
Recently i decided on installing debian on my old tablet(android) with allwinner CPU. I tried sticking with armbian ready images, but i couldn't get wifi to work.

After an investigation on android i found out that the kernel modules that're providing wifi functionality on android, are named nano_ksdio and nano_if.

I found the source code in linux kernel source for allwinners(legacy 3.4 linux-sunxi code)

Using standard compilation options:
Code:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- sun4i_defconfig
make -j$(nproc) ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- uImage modules
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=output modules_install
Compilation is successful however it does not produce the compiled nano-* modules.

When i enter module directory directly and execute make
Code:
cd modules/wifi/nano-c047.12
make all
or
Code:
./build.sh
I get the following error:
Code:
make -C kernel/ic -f Makefile PLATFORM=winner V=0 all strip
make[1]: Entering directory '/root/linux-sunxi/modules/wifi/nano-c047.12/kernel/ic'
make -C /root/linux-sunxi/output/lib/modules/3.4.104-gd47d3670-dirty/ SUBDIRS=/root/linux-sunxi/modules/wifi/nano-c047.12/kernel/ic modules
make[2]: Entering directory '/root/linux-sunxi/output/lib/modules/3.4.104-gd47d3670-dirty'
make[2]: *** No rule to make target 'modules'.  Stop.
make[2]: Leaving directory '/root/linux-sunxi/output/lib/modules/3.4.104-gd47d3670-dirty'
Makefile:25: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/root/linux-sunxi/modules/wifi/nano-c047.12/kernel/ic'
Makefile:31: recipe for target 'ic' failed
make: *** [ic] Error 2
How can i make this module to build?
Here is the link to the particular folder i am trying to build: https://github.com/linux-sunxi/linux...i/nano-c047.12
 
Old 09-17-2018, 02:22 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 9,356

Rep: Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980
Welcome to LQ, disa.

Quote:
Originally Posted by disa
make[2]: Entering directory '/root/linux-sunxi/output/lib/modules/3.4.104-gd47d3670-dirty'
make[2]: *** No rule to make target 'modules'. Stop.
I'm wondering where exactly things are. The 'make -C' bit tells it to change to the kernel source for files and use those. It's usually for things outside the kernel source tree, which need the sopurce to build.
  • Is your wifi module part of the kernel source? What directory is it in?
  • Is the kernel source a clean source tree, or have you just built the kernel?

If you haven't just built a kernel, it might be a good idea. If there's a file called .config in the kernel source, just run 'make'.
 
1 members found this post helpful.
Old 09-17-2018, 04:58 PM   #3
disa
LQ Newbie
 
Registered: Sep 2018
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thank you for your reply!

Firstly I've compiled the kernel and modules.
Nano module was not built.
Then I tried manually entering the build folder of the driver and building the module.

Changed path in build.sh
Code:
#!/bin/sh
set -e

make CROSS_COMPILE=~/workspace/exdroid/lichee/buildroot/output/external-toolchain/bin/arm-none-linux-gnueabi- \
	ARCH=arm KERNEL_DIR=~/workspace/exdroid/lichee/linux-2.6.36
to
Code:
KERNEL_DIR=/root/linux-sunxi/output/lib/modules/3.4.104-gd47d3670-dirty
as well as
Code:
KERNEL_DIR=/root/linux-sunxi/output/
or
Code:
KERNEL_DIR=/root/linux-sunxi
but each time the error is same.

I've also tried building it from root and executing
Code:
make M=modules/wifi/nano-c047.12
but it gave me the same error.

/root/linux-sunxi/ <--- github repository with kernel source
/root/linux-sunxi/output/ <--- where linux modules are going to be built
/root/linux-sunxi/modules/wifi/nano-c047.12 <--- driver source I need to build

Full dir list of /root/linux-sunxi: tree

Last edited by disa; 09-17-2018 at 05:01 PM.
 
Old 09-18-2018, 04:10 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 9,356

Rep: Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980
Sorry, I usually grok my email in the morning. From Post #1

Code:
make -C kernel/ic -f Makefile PLATFORM=winner V=0 all strip
make[1]: Entering directory '/root/linux-sunxi/modules/wifi/nano-c047.12/kernel/ic'
That's it changing directory to the directory shown - not the kernel. That caught me by surprise. Is that where you have the wifi driver source?
Code:
make -C /root/linux-sunxi/output/lib/modules/3.4.104-gd47d3670-dirty/ SUBDIRS=/root/linux-sunxi/modules/wifi/nano-c047.12/kernel/ic modules
make[2]: Entering directory '/root/linux-sunxi/output/lib/modules/3.4.104-gd47d3670-dirty'
make[2]: *** No rule to make target 'modules'.  Stop.
It then goes off to 'root/linux-sunxi/output/lib/modules/3.4.104-gd47d3670-dirty', finds nothing top make, and pukes. I would guess it has a Makefile in the top source dir, holds many modules, and you might have to configure it for the one you want Stop trying to build it for the moment. Go to the top source dir, and look for a Makefile, and a configure script.. If you're lucky, there'll be a configure script; run 'make clean' and then
Code:
./configure --help |less
. The thing you need to configure is what module(s) to build.
As a general rule, it's better to build as a user, and not in the /root dir. This is in case the build goes mad (Not unknown) because root is almighty. Just install as root.

If you can't make sense of it (there are other build systems) post a link to the driver and I'll have a quick look.
 
1 members found this post helpful.
Old 09-18-2018, 11:14 AM   #5
disa
LQ Newbie
 
Registered: Sep 2018
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thank you for your post.

As you suggested I inspected Makefiles in linux kernel root folder and other drivers' folders.

The code I am using does not include configure.sh files, instead I can use make menuconfig, but it does not include any option to build nanoradio nxr600 driver.

I decided to build it manually with correct dirs:
Code:
make PLATFORM=winner KERNEL_DIR=/root/linux-sunxi/ CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm all
Make enters KERNEL_DIR folder correctly and executes main Makefile to build module from subdir
Code:
make -C /root/linux-sunxi/ SUBDIRS=/root/linux-sunxi/modules/wifi/nano-c047.12/kernel/ic modules
Unfortunately the build is unsuccessful. I tried compiling it with 3 different gcc versions:
  • gcc-8
  • gcc-4.6(I compiled kernel 3.4 successfully using this compiler)
  • gcc-4.4
But the error is the same(I did make clean before each build:
Code:
make -C kernel/ic -f Makefile PLATFORM=winner V=0 all strip
make[1]: Entering directory '/root/linux-sunxi/modules/wifi/nano-c047.12/kernel/ic'
make -C /root/linux-sunxi/ SUBDIRS=/root/linux-sunxi/modules/wifi/nano-c047.12/kernel/ic modules
make[2]: Entering directory '/root/linux-sunxi'
  CC [M]  /root/linux-sunxi/modules/wifi/nano-c047.12/kernel/ic/../../driverenv/src/application.o
  CC [M]  /root/linux-sunxi/modules/wifi/nano-c047.12/kernel/ic/../../driverenv/src/driverenv.o
/root/linux-sunxi/modules/wifi/nano-c047.12/kernel/ic/../../driverenv/src/driverenv.c: In function ‘de_find_skb’:
/root/linux-sunxi/modules/wifi/nano-c047.12/kernel/ic/../../driverenv/src/driverenv.c:144: error: ‘struct net_device’ has no member named ‘priv’
/root/linux-sunxi/modules/wifi/nano-c047.12/kernel/ic/../../driverenv/src/driverenv.c: In function ‘DriverEnvironment_Startup’:
/root/linux-sunxi/modules/wifi/nano-c047.12/kernel/ic/../../driverenv/src/driverenv.c:163: error: ‘struct net_device’ has no member named ‘priv’
/root/linux-sunxi/modules/wifi/nano-c047.12/kernel/ic/../../driverenv/src/driverenv.c: In function ‘DriverEnvironment_Terminate’:
/root/linux-sunxi/modules/wifi/nano-c047.12/kernel/ic/../../driverenv/src/driverenv.c:185: error: ‘struct net_device’ has no member named ‘priv’
/root/linux-sunxi/modules/wifi/nano-c047.12/kernel/ic/../../driverenv/src/driverenv.c: In function ‘tx_alloc_unlink’:
/root/linux-sunxi/modules/wifi/nano-c047.12/kernel/ic/../../driverenv/src/driverenv.c:558: error: ‘struct net_device’ has no member named ‘priv’
/root/linux-sunxi/modules/wifi/nano-c047.12/kernel/ic/../../driverenv/src/driverenv.c: In function ‘DriverEnvironment__TX_Alloc’:
/root/linux-sunxi/modules/wifi/nano-c047.12/kernel/ic/../../driverenv/src/driverenv.c:591: error: ‘struct net_device’ has no member named ‘priv’
/root/linux-sunxi/modules/wifi/nano-c047.12/kernel/ic/../../driverenv/src/driverenv.c: In function ‘DriverEnvironment_indicate’:
/root/linux-sunxi/modules/wifi/nano-c047.12/kernel/ic/../../driverenv/src/driverenv.c:620: error: ‘struct net_device’ has no member named ‘priv’
/root/linux-sunxi/modules/wifi/nano-c047.12/kernel/ic/../../driverenv/src/driverenv.c: In function ‘DriverEnvironment_Core_Dump_Complete’:
/root/linux-sunxi/modules/wifi/nano-c047.12/kernel/ic/../../driverenv/src/driverenv.c:958: error: ‘struct net_device’ has no member named ‘priv’
scripts/Makefile.build:307: recipe for target '/root/linux-sunxi/modules/wifi/nano-c047.12/kernel/ic/../../driverenv/src/driverenv.o' failed
make[3]: *** [/root/linux-sunxi/modules/wifi/nano-c047.12/kernel/ic/../../driverenv/src/driverenv.o] Error 1
Makefile:1367: recipe for target '_module_/root/linux-sunxi/modules/wifi/nano-c047.12/kernel/ic' failed
make[2]: *** [_module_/root/linux-sunxi/modules/wifi/nano-c047.12/kernel/ic] Error 2
make[2]: Leaving directory '/root/linux-sunxi'
Makefile:25: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/root/linux-sunxi/modules/wifi/nano-c047.12/kernel/ic'
Makefile:31: recipe for target 'ic' failed
make: *** [ic] Error 2
I suspect that this code was never fully integrated into this kernel tree.
Also I can nowhere find any other version of this driver, and the manufacture website's disappeared as it was bought by Samsung in 2011.
The device name is: Nanoradio NXR600.
Here is the code of the driver I am building: nano-c-47.12

#edit:
I also found this chinese page about compiling this driver for linux but it's about 2.6 kernel version. View using google translate

Last edited by disa; 09-18-2018 at 11:15 AM.
 
Old 09-18-2018, 03:19 PM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 9,356

Rep: Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980
I was thinking there'd be either a configure script (usually named configure but config.sh would do) in the top driver source, or something maybe from cmake, or possibly an autogen.sh script which generates a configure. There should also be a readme!

Anyhow, that output is at least more specific. I googled that error struct net_device’ has no member named ‘priv'
struct net_device’ has no member named ‘priv'
https://ubuntuforums.org/archive/ind...t-2130030.html

always worth asking google.
 
1 members found this post helpful.
Old 09-19-2018, 01:22 PM   #7
disa
LQ Newbie
 
Registered: Sep 2018
Posts: 4

Original Poster
Rep: Reputation: Disabled
There is no such file as configure script, autogen, not even a readme.

After examining some google results about this particular error I found out that this error occurs because it was written for 2.6 kernel version.
I tried building it for 2.6 linux kernel and it went fine.
It was never updated to be built on higher linux kernel versions, and I do not have enough linux knowledge to do this, so I think I will stick to external USB wifi module.

Thank you so much for help.
 
Old 09-19-2018, 01:52 PM   #8
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 9,356

Rep: Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980
Quote:
Originally Posted by disa View Post
There is no such file as configure script, autogen, not even a readme.
Dodgy stuff, then. Unless they're hidden down in the subdirectories.
Quote:
Originally Posted by disa View Post
After examining some google results about this particular error I found out that this error occurs because it was written for 2.6 kernel version.
I tried building it for 2.6 linux kernel and it went fine.
It was never updated to be built on higher linux kernel versions, and I do not have enough linux knowledge to do this, so I think I will stick to external USB wifi module.
Thank you so much for help.
I am old enough to have been there for that change (2.6--> 3.0) and things moved fairly rapidly right then. I would regard you as foolhardy if you tried. That's the sort of job you subcontract out :-)), or don't do at all. Your choice is wise. You can mark this solved, then, as you found out what to do - in this case, bravely turn on your heels and flee:-). The one option is to use a retro arm distro, but the security fixes in recent stuff make that unwise.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error! Bad return status for module build on kernel: 4.15.0-24-generic (x86_64) Toadman Linux - Kernel 2 07-03-2018 03:02 PM
ZFS kernel module build error ReaperX7 Linux From Scratch 3 07-02-2015 05:04 PM
[Error] Kernel Module : No kernel module build environment saman007uk Debian 7 09-09-2006 06:34 PM
Error: Unable to build the NVIDIA kernel module. Dachy Slackware 3 02-17-2006 02:46 AM
Nvidia kernel module build error: 2.6.15.2 Synesthesia Linux - General 1 02-05-2006 06:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 10:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration