This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

OPKG install kernel header Not working.

I have an Beagle bone A3 board.

Can anybody help me with ..

1. where should i run this command OPKG ?? Host or target ?

http://e2e.ti.com/support/arm/sitara_arm/f/791/p/265796/929500.aspx#929500

I have posted my host configuration and trials to compile the kernel module.

if any one can suggest me links to download the new kernel source code and kernel header patch link. so that i can try with the new source.

Hrishikesh !!!

  • Hi Hrishikesh,

    As far as I understand, you are trying to compile your module natively on the BeagleBone. This is a bad idea as the compilation will take a lot more time than if you cross compile it on your host machine.

    The latest Arago AM335x SDK can be downloaded from here. The cross compilation toolchain can be found inside <sdk_folder>/linux-devkit/bin/.

    This is basically what you need to do:

    1) Compile the kernel, following the instructions here: http://processors.wiki.ti.com/index.php/AMSDK_Linux_User%27s_Guide
    2) Go to the folder, containing your module and create a simple Makefile containing this:

    obj-m += your_module_name.o

    3) Export the following variables in your environment if not already:

    export CROSS_COMPILE=arm-arago-linux-gnueabi-
    export ARCH=arm
    export PATH=$PATH:$HOME/ti-sdk-am335x-evm-05.07.00.00/linux-devkit/bin (edit this accordingly)

    4) Execute the following command to make the kernel module:

    make -C ~/ti-sdk-am335x-evm-05.07.00.00/board-support/linux-3.2.0-psp04.06.00.10/ M=`pwd` modules (modify the path to the kernel sources if you need to)

    Best regards,
    Miroslav

    linux-devkit/bin

  • HI ! Miroslav !!

    Thanks for your interest & reply !!!

    I have downloaded the required SDK from Website.

    Can you please give me an example of makefile. i am confused because according to me i have to give path in the makefile..which has to be KERNEDIR = /lib/modules/3.10.0-rc1-armv7-d1/build    ..something like this. but this path will be there..only if a patch the kernel with kernel headers.           

    "Don't u think i need the kernel header patch for cross compilation on Host machine. As i need to compile the driver for ARM architecture."

    Beacause as..suggested by.... you...

    if i write some simple make file..consider as below

    # If KERNELRELEASE is defined, we've been invoked from the
    # kernel build system and can use its language.
    ifneq ($(KERNELRELEASE),)
        obj-m += hello.o

    # Otherwise we were called directly from the command
    # line; invoke the kernel build system.
    else
    KERNEDIR = /lib/modules/3.10.0-rc1-armv7-d1/build               

    {which path i shoud write here...i got this folders after patching one of the kernel header..but the patch was not done successfully}..Please suggest a patch or link to download the patch....

    PWD := $(shell pwd)
    default:
        $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
    endif

    i have found one link to download kernel headers :

    http://rcn-ee.net/deb/oneiric-armel/

    but i dont know which patch will work for linux-3.2.0-psp04.06.00.10..... please suggest...how i should manage the Makefile.

    Thanks,

  • Hi,

    I didn't understand what patches you have applied, but I doubt they were necessary. I really hope you didn't mess up your kernel sources tree. Please start fresh and read this document from the kernel documentation: https://www.kernel.org/doc/Documentation/kbuild/modules.txt

    I already showed you the most basic content of a Makefile, but since you want to learn more about the kernel build system, the best way to do it is by reading the kernel documentation. More about the kernel build system and Makefiles can be found here: https://www.kernel.org/doc/Documentation/kbuild/ Please read it thoroughly - it is a great learning place.

    Best regards,
    Miroslav