Cross compiling module outside of OpenEmbedded environment

I have set myself a task for over the next week, to write a Loadable Kernel Module for the beaglebone to control the GPIO and SPI bus. However, I am falling at the very first hurdle - compiling. My beaglebone image is build using OpenEmbedded and I want to cross compile my module using the openembedded kernel sources, however I keep getting this error:

Makefile:

    MODULES := spiModule.o

    #guest architecture
    ARCH := arm

    CROSS_COMPILE := arm-poky-linux-gnueabi-
    obj-m := $(MODULES)

    #path of the arm compiled kernel
    ROOTDIR :=
    /home/jack/Projects/poky-denzil.git/r0005-new/tmp/sysroots/beaglebone/lib/modules/3.2.18/kernel

    MAKEARCH := $(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE)

    all: modules

    modules:
         $(MAKEARCH) -C $(ROOTDIR) SUBDIRS=${shell pwd} modules

    clean:
         $(MAKEARCH) -C $(ROOTDIR) SUBDIRS=${shell pwd} clean

The error I am receiving is:

    make ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi- -C
    /home/jack/Projects/poky-denzil.git/r0005-new/tmp/sysroots/beaglebone/lib/modules/3.2.18/kernel
    SUBDIRS=/home/jack/Projects/spiModule modules
    make[1]: Entering directory
    `/home/jack/Projects/poky-denzil.git/r0005-new/tmp/sysroots/beaglebone/lib/modules/3.2.18/kernel'
    make[1]: *** No rule to make target `modules'. Stop.
    make[1]: Leaving directory
    `/home/jack/Projects/poky-denzil.git/r0005-new/tmp/sysroots/beaglebone/lib/modules/3.2.18/kernel'
    make: *** [modules] Error 2

I think I am pointing to the wrong kernel directory. Could anyone enlighten me to where I should be pointing to?

I plan to do a blog post write-up when I am finished so hopefully no help or information will go unheeded!

I don't want to do this through the OpenEmbedded module building system, the reason being I haven't been able to build it for the past few weeks to do package inconsistencies - so please don't just suggest I do that.

Regards,

I have set myself a task for over the next week, to write a Loadable Kernel Module for the beaglebone to control the GPIO and SPI bus. However, I am falling at the very first hurdle - compiling. My beaglebone image is build using OpenEmbedded and I want to cross compile my module using the openembedded kernel sources, however I keep getting this error:

Makefile:

  MODULES := spiModule.o

  #guest architecture
  ARCH := arm

  CROSS_COMPILE := arm-poky-linux-gnueabi-

That's the wrong toolchain for one

  obj-m := $(MODULES)

  #path of the arm compiled kernel
  ROOTDIR :=
  /home/jack/Projects/poky-denzil.git/r0005-new/tmp/sysroots/beaglebone/lib/modules/3.2.18/kernel

And the wrong OE setup, you need to follow http://www.angstrom-distribution.org/building-angstrom

  MAKEARCH := $(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE)

  all: modules

  modules:
       $(MAKEARCH) -C $(ROOTDIR) SUBDIRS=${shell pwd} modules

  clean:
       $(MAKEARCH) -C $(ROOTDIR) SUBDIRS=${shell pwd} clean

The error I am receiving is:

  make ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi- -C
  /home/jack/Projects/poky-denzil.git/r0005-new/tmp/sysroots/beaglebone/lib/modules/3.2.18/kernel
  SUBDIRS=/home/jack/Projects/spiModule modules
  make[1]: Entering directory
  `/home/jack/Projects/poky-denzil.git/r0005-new/tmp/sysroots/beaglebone/lib/modules/3.2.18/kernel'
  make[1]: *** No rule to make target `modules'. Stop.
  make[1]: Leaving directory
  `/home/jack/Projects/poky-denzil.git/r0005-new/tmp/sysroots/beaglebone/lib/modules/3.2.18/kernel'
  make: *** [modules] Error 2

I think I am pointing to the wrong kernel directory. Could anyone enlighten me to where I should be pointing to?

I plan to do a blog post write-up when I am finished so hopefully no help or information will go unheeded!

I don't want to do this through the OpenEmbedded module building system, the reason being I haven't been able to build it for the past few weeks to do package inconsistencies - so please don't just suggest I do that.

You need to write a recipe for it.

I have set myself a task for over the next week, to write a Loadable Kernel Module for the beaglebone to control the GPIO and SPI bus. However, I am falling at the very first hurdle - compiling. My beaglebone image is build using OpenEmbedded and I want to cross compile my module using the openembedded kernel sources, however I keep getting this error:

Makefile:

   MODULES := spiModule.o

   #guest architecture
   ARCH := arm

   CROSS_COMPILE := arm-poky-linux-gnueabi-

That's the wrong toolchain for one

I'm using OpenEmbedded with meta-ti and meta-yocto layers - I've already built my image using this combination so I'm using the matching tool set. I should have mentioned this, sorry.

   obj-m := $(MODULES)

   #path of the arm compiled kernel
   ROOTDIR :=
   /home/jack/Projects/poky-denzil.git/r0005-new/tmp/sysroots/beaglebone/lib/modules/3.2.18/kernel

And the wrong OE setup, you need to follow http://www.angstrom-distribution.org/building-angstrom

   MAKEARCH := $(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE)

   all: modules

   modules:
        $(MAKEARCH) -C $(ROOTDIR) SUBDIRS=${shell pwd} modules

   clean:
        $(MAKEARCH) -C $(ROOTDIR) SUBDIRS=${shell pwd} clean

The error I am receiving is:

   make ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi- -C
   /home/jack/Projects/poky-denzil.git/r0005-new/tmp/sysroots/beaglebone/lib/modules/3.2.18/kernel
   SUBDIRS=/home/jack/Projects/spiModule modules
   make[1]: Entering directory
   `/home/jack/Projects/poky-denzil.git/r0005-new/tmp/sysroots/beaglebone/lib/modules/3.2.18/kernel'
   make[1]: *** No rule to make target `modules'. Stop.
   make[1]: Leaving directory
   `/home/jack/Projects/poky-denzil.git/r0005-new/tmp/sysroots/beaglebone/lib/modules/3.2.18/kernel'
   make: *** [modules] Error 2

I think I am pointing to the wrong kernel directory. Could anyone enlighten me to where I should be pointing to?

I plan to do a blog post write-up when I am finished so hopefully no help or information will go unheeded!

I don't want to do this through the OpenEmbedded module building system, the reason being I haven't been able to build it for the past few weeks to do package inconsistencies - so please don't just suggest I do that.

You need to write a recipe for it.

I plan to compose a recipe for it when the bulk of the development is done and I can get OpenEmbedded building again.

I have fixed my issue by cloning the git sources of the meta-ti kernel branch, compiling it outside of OpenEmbedded using the poky toolchain and building my module against that.

Regards,

http://www.angstrom-distribution.org/building-angstrom builds, works and is using an optimized setup for beagleboard.org boards. But if you want to stick with that x86 poky stuff, fine, but don't ask here for help, ask the poky dudes.

I have set myself a task for over the next week, to write a Loadable Kernel Module for the beaglebone to control the GPIO and SPI bus. However, I am falling at the very first hurdle - compiling. My beaglebone image is build using OpenEmbedded and I want to cross compile my module using the openembedded kernel sources, however I keep getting this error:

Makefile:

   MODULES := spiModule.o

   #guest architecture
   ARCH := arm

   CROSS_COMPILE := arm-poky-linux-gnueabi-

That's the wrong toolchain for one

I'm using OpenEmbedded with meta-ti and meta-yocto layers - I've already built my image using this combination so I'm using the matching tool set. I should have mentioned this, sorry.

   obj-m := $(MODULES)

   #path of the arm compiled kernel
   ROOTDIR :=
   /home/jack/Projects/poky-denzil.git/r0005-new/tmp/sysroots/beaglebone/lib/modules/3.2.18/kernel

And the wrong OE setup, you need to follow http://www.angstrom-distribution.org/building-angstrom

   MAKEARCH := $(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE)

   all: modules

   modules:
        $(MAKEARCH) -C $(ROOTDIR) SUBDIRS=${shell pwd} modules

   clean:
        $(MAKEARCH) -C $(ROOTDIR) SUBDIRS=${shell pwd} clean

The error I am receiving is:

   make ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi- -C
   /home/jack/Projects/poky-denzil.git/r0005-new/tmp/sysroots/beaglebone/lib/modules/3.2.18/kernel
   SUBDIRS=/home/jack/Projects/spiModule modules
   make[1]: Entering directory
   `/home/jack/Projects/poky-denzil.git/r0005-new/tmp/sysroots/beaglebone/lib/modules/3.2.18/kernel'
   make[1]: *** No rule to make target `modules'. Stop.
   make[1]: Leaving directory
   `/home/jack/Projects/poky-denzil.git/r0005-new/tmp/sysroots/beaglebone/lib/modules/3.2.18/kernel'
   make: *** [modules] Error 2

I think I am pointing to the wrong kernel directory. Could anyone enlighten me to where I should be pointing to?

I plan to do a blog post write-up when I am finished so hopefully no help or information will go unheeded!

I don't want to do this through the OpenEmbedded module building system, the reason being I haven't been able to build it for the past few weeks to do package inconsistencies - so please don't just suggest I do that.

You need to write a recipe for it.

I plan to compose a recipe for it when the bulk of the development is done and I can get OpenEmbedded building again.

http://www.angstrom-distribution.org/building-angstrom builds, works

My host has upped to glibc 2.16 which is why my builds are failing - I'm just waiting for oe-core to catch up and get all Khems patches merged, along with the issues that the gets function is no longer available. I don't see why this would be different in Angstrom, it's my host incompatibility that is the issue.

and is using an optimized setup for beagleboard.org boards. But if you want to stick with that x86 poky stuff, fine,

I use the poky stuff because it's more geared to commercial development. It's already hard enough trying to prove my new fangled straight out of University hippy Linux ways are viable and if there are some charts I can wave at people from Intel saying it's good then it helps.

but don't ask here for help, ask the poky dudes.

The reason I post in this group is because it is a more about general embedded development than the Yocto list and there is a higher chance that someone in here will be trying to do what I am doing and might suggest alternatives.

Op 27 jul. 2012, om 12:52 heeft Jack Mitchell <ml@communistcode.co.uk> het
volgende geschreven:

I have set myself a task for over the next week, to write a Loadable
Kernel Module for the beaglebone to control the GPIO and SPI bus. However, I
am falling at the very first hurdle - compiling. My beaglebone image is
build using OpenEmbedded and I want to cross compile my module using the
openembedded kernel sources, however I keep getting this error:

Makefile:

   MODULES := spiModule.o

   #guest architecture
   ARCH := arm

   CROSS_COMPILE := arm-poky-linux-gnueabi-

That's the wrong toolchain for one

I'm using OpenEmbedded with meta-ti and meta-yocto layers - I've already
built my image using this combination so I'm using the matching tool set. I
should have mentioned this, sorry.

   obj-m := $(MODULES)

   #path of the arm compiled kernel
   ROOTDIR :=

/home/jack/Projects/poky-denzil.git/r0005-new/tmp/sysroots/beaglebone/lib/modules/3.2.18/kernel

And the wrong OE setup, you need to follow
http://www.angstrom-distribution.org/building-angstrom

   MAKEARCH := $(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE)

   all: modules

   modules:
        $(MAKEARCH) -C $(ROOTDIR) SUBDIRS=${shell pwd} modules

   clean:
        $(MAKEARCH) -C $(ROOTDIR) SUBDIRS=${shell pwd} clean

The error I am receiving is:

   make ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi- -C

/home/jack/Projects/poky-denzil.git/r0005-new/tmp/sysroots/beaglebone/lib/modules/3.2.18/kernel
   SUBDIRS=/home/jack/Projects/spiModule modules
   make[1]: Entering directory

`/home/jack/Projects/poky-denzil.git/r0005-new/tmp/sysroots/beaglebone/lib/modules/3.2.18/kernel'
   make[1]: *** No rule to make target `modules'. Stop.
   make[1]: Leaving directory

`/home/jack/Projects/poky-denzil.git/r0005-new/tmp/sysroots/beaglebone/lib/modules/3.2.18/kernel'
   make: *** [modules] Error 2

I think I am pointing to the wrong kernel directory. Could anyone
enlighten me to where I should be pointing to?

I plan to do a blog post write-up when I am finished so hopefully no
help or information will go unheeded!

I don't want to do this through the OpenEmbedded module building
system, the reason being I haven't been able to build it for the past few
weeks to do package inconsistencies - so please don't just suggest I do
that.

You need to write a recipe for it.

I plan to compose a recipe for it when the bulk of the development is
done and I can get OpenEmbedded building again.

http://www.angstrom-distribution.org/building-angstrom builds, works

My host has upped to glibc 2.16 which is why my builds are failing - I'm
just waiting for oe-core to catch up and get all Khems patches merged, along
with the issues that the gets function is no longer available. I don't see
why this would be different in Angstrom, it's my host incompatibility that
is the issue.

and is using an optimized setup for beagleboard.org boards. But if you
want to stick with that x86 poky stuff, fine,

I use the poky stuff because it's more geared to commercial development.
It's already hard enough trying to prove my new fangled straight out of
University hippy Linux ways are viable and if there are some charts I can
wave at people from Intel saying it's good then it helps.

but don't ask here for help, ask the poky dudes.

The reason I post in this group is because it is a more about general
embedded development than the Yocto list and there is a higher chance that
someone in here will be trying to do what I am doing and might suggest
alternatives.

Seriously, this question would be better posted on the Yocto list. One
of the hardest tasks we face is educating some of the Yocto Project
people about how real embedded developers work :slight_smile: We need all the help
we can get.

Philip