if you do have a Yocto build system set up already you could do the following:
run "bitbake -c devshell linux-yocto"
This would open a new root shell which
- has all relevant binutils environment variables set accordingly, e.g.
# echo $CXX
i586-poky-linux-g++ -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -mstackrealign -fno-omit-frame-pointer --sysroot=<Yocto path>/build/tmp/sysroots/edison
- sets paths for binutils ...
# echo $PATH
<Yocto path>/poky/scripts:<Yocto path>/build/tmp/sysroots/x86_64-linux/usr/bin/core2-32-poky-linux:<Yocto path>/build/tmp/sysroots/edison/usr/bin/crossscripts:<Yocto path>/build/tmp/sysroots/x86_64-linux/usr/sbin:<Yocto path>/build/tmp/sysroots/x86_64-linux/usr/bin:<Yocto path>/build/tmp/sysroots/x86_64-linux/sbin:<Yocto path>/build/tmp/sysroots/x86_64-linux/bin:<Yocto path>/poky/scripts:/Android/edison-src/poky/bitbake/bin:<default $PATH>
- is already in the linux directory of your Yocto Linux environment
here you could try to put your sources and compile there - note however, that this folder might easily be overwritten at some later stage. So your modifications are not permanent
Thank you for your reply.
The build system from that driver was probably why the driver was rejected from the Linux kernel. It is broken. It does not use the standard environment variables and has hardcoded paths in its makefile. Cross compiling is not an option IMHO. This is why I wanted to build it on the device.
I tried to build a kernel module on the Edison. The output was as follows:
make: Warning: File '/home/root/mt7601/src/os/linux/config.mk' has modification time 630897 s in the future
make -C tools
make: Entering directory '/home/root/mt7601/src/tools'
make: Warning: File 'Makefile' has modification time 608670 s in the future
gcc -g bin2h.c -o bin2h
make: warning: Clock skew detected. Your build may be incomplete.
make: Leaving directory '/home/root/mt7601/src/tools'
cp -f os/linux/Makefile.6 /home/root/mt7601/src/os/linux/Makefile
make -C /lib/modules/3.10.17-yocto-standard/build SUBDIRS=/home/root/mt7601/src/os/linux modules
make: *** /lib/modules/3.10.17-yocto-standard/build: No such file or directory. Stop.
Makefile:394: recipe for target 'LINUX' failed
make: *** [LINUX] Error 2
The source is this git: porjo/mt7601 · GitHub
The quality of this driver and build system makes it hard (for me at least) to build it using a recipe as part of building a Yocto distribution. Building works on my Ubuntu box and this is why I thought that I could build it directly on the Edison.
What do I need to enable to get "/lib/modules/3.10.17-yocto-standard/build" directory on the Edison? Why is this directory not a part of the default install?
Well, if you look at the /lib/modules/(kernelversion)/ directory on Ubuntu, you'll see that it is a symlink to the kernel headers.
It doesn't look like there's a good way to get the kernel headers installed on the Edison (at least the current version), so your best bet is probably going to be writing a recipe. See here: Yocto Project Linux Kernel Development Manual.