4
votes

I am trying to backport Linux wifi drivers from 3.11 to linux-omap-l1(2.6.39). I set up the cross compiler on my Ubuntu 11.4 (kernel is 2.6.38-11-generic) and verified that the cross-compiled kernel can run on an ARM processor as expected. I also was able to backport the wifi drivers to this Ubuntu by following the "Usage Guide" section. However, I have problem to cross compile the wifi backports. Here are two attempts I did:

Attempt#1

Following the "Cross compiling" section from the same link above, I set ARCH(=arm), CROSS_COMPILER, KLIB_BUILD(=linux-omap-l1 directory) and KLIB(=linux-omap-l1 directory), ran make defconfig-wifi, then ran make -j4. It finished without any error. However when I check the generated ko files, they are apparently not cross compiled because they look like "rt2x00usb.ko: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped"

Attempt#2

Then I cleaned the old make result and passed the above four macros directly to make as arguments and ran it again. This time it reported many errors complaining of missing printk.h, atomic.h and average.h

Please help with either of the cases above.

3
It would be useful to see your ported Makefile.Peter L.
Copy defconfig-wifi to .config and then use make ARCH=arm menuconfig. The defconfig-wifi may over-ride your ARM kernel config. Is defconfig-wifi for an x86? Probably better to take a working .config and set the needed Wifi options. Share your different config files somehow. You can build without any wifi backports?artless noise
Thanks the hints. Now I managed to generate the correct .config file (which contains all the same config items specific to my embedded kernel with the new backported items). However the following error occurred when I repeated attemp#2 from the backports source. ERROR: Kernel configuration is invalid. include/generated/autoconf.h or include/config/auto.conf are missing. Run 'make oldconfig && make prepare' on kernel src to fix it.sunrise
In your original Attempt#1 approach, can you try to run make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- -j4. Remember to add the cross-compiler to the shell $PATH and pass the proper cross-compiler using the CROSS_COMPILE parameter.TheCodeArtist

3 Answers

4
votes

Well, I here post the rt2800usb wifi solution for other's reference. The following steps cross-compiled successfully:

  1. Menuconfig linux-omap-l1(2.6.39) kernel to disable Networking Support -> Wireless, build it and boot it to the embedded unit to ensure the readiness
  2. Run “make mrproper” from the backports directory on the build pc (Ubuntu 11.4)
  3. Run the following sript from the build pc. Ensure the KLIB pointed directory pre-exists, otherwise create it

    set -a
    CROSS_COMPILE="/opt/arm-2009q1/bin/arm-none-linux-gnueabi-"
    ARCH=arm
    KLIB_BUILD="/home/xxx/linux-omap-l1"
    KLIB="/home/xxx/linux-omap-l1/updates"
    set +a
    
    make defconfig-wifi
    make oldconfig  # menuconfig worked here too
    make
    make install
    
  4. Copy the compiled binaries and modules into the unit(10.11.2.3)

    scp -r  /home/xxx/linux-omap-l1/updates/lib/modules/2.6.39.4-00537-g6c21e4a  [email protected]:/lib/modules/2.6.39.4/.
    
  5. Log into the embedded unit and run “modprobe -v -f rt2800usb”

  6. Download and install rt2800usb firmware to the /lib/firmware if necessary
  7. lsmod to verify the driver can be loaded
  8. insert the usb dongle (the udev rules may need to be created or modified)
  9. use iw to further examine its properties
1
votes

backports is unable to pickup my kernel config.....mac80211 is set to module in my kernel config, when I search for mac80211 in backport's menu config, it shows disabled. Tried the above....

set -a
CROSS_COMPILE="/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-"
ARCH=arm
KLIB_BUILD="/home/xxx/rpm/BUILD/linux"
KLIB="/home/xxx/rootfs/lib/modules/2.6.35.3-998-ga1cd8a7/updates"
set +a

make defconfig-wifi
make menuconfig
0
votes

I found this to be sucessfull...

make defconfig-wifi CROSS_COMPILE=/home/xxx/Downloads/gcc-linaro-arm-linux-gnueabi-2012.04-20120426_linux/bin/arm-linux-gnueabi- ARCH=arm KLIB_BUILD=/home/xxx/Downloads/linux-3.10/ KLIB=/home/xxx/Downloads/rootfs/

make menuconfig CROSS_COMPILE=/home/xxx/Downloads/gcc-linaro-arm-linux-gnueabi-2012.04-20120426_linux/bin/arm-linux-gnueabi- ARCH=arm KLIB_BUILD=/home/xxx/Downloads/linux-3.10/ KLIB=/home/xxx/Downloads/rootfs/

make CROSS_COMPILE=/home/xxx/Downloads/gcc-linaro-arm-linux-gnueabi-2012.04-20120426_linux/bin/arm-linux-gnueabi- ARCH=arm KLIB_BUILD=/home/xxx/Downloads/linux-3.10/ KLIB=/home/xxx/Downloads/rootfs/