LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 11-25-2015, 03:29 PM   #1
anglsix
LQ Newbie
 
Registered: Nov 2015
Posts: 7

Rep: Reputation: Disabled
Kernel sources for ARM


I've built the kernel 4.3 from source on an x86 Ubuntu machine using the arm-linux-gnueabi cross compile tools.

I've installed the modules, headers, and copied the kernel source folder (the one used to make these files) to the targets /usr/src folder, and the /lib/modules/4.3.0/build and source links point to /usr/src/linux4.3 folder.

I need to build a wifi driver for the ARM target board, so I am building it on that board.

When I run the make command on the target board, I just get:

arch/armv7l/Makefile: No such file or directory

Thats because there isn't one. The Arch should be just arm not armv7l. So if I do:

make ARCH=arm I then get:

scripts/basic/fixdep: 1: scripts/basic/fixdep: Syntax error: end of file unexpected (expecting ")")


How do I get a usable kernel headers + source on the ARM target board so I can build kernel module drivers?
 
Old 11-25-2015, 03:38 PM   #2
anglsix
LQ Newbie
 
Registered: Nov 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
I also found a post that states I need to:

cd /usr/src/4.3.0
make modules_prepare

However that gives:

fatal error: sys/types.h: No such file or directory.

The compilation of the headers on the x86 machine with:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- headers_install INSTALL_HDR_PATH=../output

Doesn't generate any sys folder in the include folder, so not sure what to do for that.


UPDATE
Ok so I've installed build-essentials and bc then run modules_prepare which then succeeded.

After that I could compile. So I think thats all I was missing. I found it very difficult to find any information about copying kernel sources to /usr/src and running modules_prepare etc...

Last edited by anglsix; 11-25-2015 at 03:54 PM.
 
Old 11-25-2015, 03:57 PM   #3
blue_z
Member
 
Registered: Jul 2015
Location: USA
Distribution: Ubuntu, Lubuntu, Mint, custom embedded
Posts: 104

Rep: Reputation: Disabled
If you really want to, you can natively compile on your target board or cross-compile the kernel on a host.
A long time ago I was cross-compiling the kernel and building the rootfs with scripts.
But nowadays I make my life simple by using Buildroot to build a toolchain, the Linux kernel, Busybox and other applications and wrapped up into a rootfs, and boot programs.
Buildroot does add another layer of makefiles, so it can get a little confusing, but it can eliminate a lot of little problems like what you're encountering.
There are other build tools (such as Yocto), but they typically require more effort to use.

E.G. See this for building Kodi on a Wandboard i.MX6Q using Buildroot


Regards

Last edited by blue_z; 11-25-2015 at 04:01 PM.
 
Old 11-25-2015, 04:03 PM   #4
anglsix
LQ Newbie
 
Registered: Nov 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
Thanks. Yes my first plan was to use buildroot, however this is a dual-purpose. It's a huge learning curve and education for me so I wanted to build everything from ground up to learn these things.

Looks like I've fixed that issue now however I think I need another kernel recompile as I now get an error of Unknown symbol wireless_send_event, which I think just needs CONFIG_WIRELESS_EXT enabled in the kernel so I'll move onto that next.
 
Old 11-25-2015, 08:56 PM   #5
blue_z
Member
 
Registered: Jul 2015
Location: USA
Distribution: Ubuntu, Lubuntu, Mint, custom embedded
Posts: 104

Rep: Reputation: Disabled
Quote:
Originally Posted by anglsix View Post
It's a huge learning curve and education for me so I wanted to build everything from ground up to learn these things.
Then you've skipped a step/lesson. You haven't built the toolchain (e.g. gcc, binutils. uClibc) from source.
I've done it, but now use crosstool-NG.

Regarsd
 
  


Reply



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
LXer: Alien’s ARM sources and git LXer Syndicated Linux News 0 04-07-2013 02:10 AM
Cross-compiling Alsa sources on x86 for ARM langerak Linux - Kernel 6 08-14-2011 09:18 AM
Module compilation needs kernel header files or kernel sources? baxzius Linux - Newbie 2 08-04-2011 04:12 PM
Crosscompiling C sources for an OS-less ARM microcontroller - is it possible? winterhunter Programming 2 03-26-2007 11:30 AM
CAVEAT: /boot/kernel.h & how not to clobber your kernel sources (Conectiva, Red Hat) JCCyC LinuxQuestions.org Member Success Stories 0 08-07-2003 07:49 AM

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

All times are GMT -5. The time now is 10:44 PM.

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
Open Source Consulting | Domain Registration