Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] Cannot build Custom Kernel Module
Date: Wed, 13 Apr 2016 17:37:43 +0200	[thread overview]
Message-ID: <570E67C7.5020209@mind.be> (raw)
In-Reply-To: <CAN34foxCgoP_i21MRzXiF2DWuT+R9XL9LvKR+NpDYjh1Mga7xw@mail.gmail.com>

  Hi Stephen,

  Please don't top-post, but reply in-line like I do below. I realize that gmail 
doesn't make that easy :-)

On 04/13/16 16:38, Stephen Beckwith wrote:
> Arnout,
>     THANK YOU very much!  The problem wasn't so much an issue with the $eval,
> which for the life of me I don't remember where I copied that from but it was
> the "missing from external.mk" that solved it!!  Thanks for
> the pointer! (sometimes we forget these little steps. . .)
> So external.mk now has:
> # Does the Kernel Modules first:
> include $(sort $(wildcard $(BR2_EXTERNAL)/netapp/kmod*/*.mk))
> and the directory is now:  kmod_gpio - along with the associated "ripple effect" -
> The good news is:  Does the Rsync and starts off the build.
> I've reduced the kmod_gpio.mk to:
> KMOD_GPIO_VERSION = 0.1.0
> KMOD_GPIO_LICENSE = Public Domain
> KMOD_GPIO_SITE = $(BR2_EXTERNAL)/netapp/kmod_gpio
> KMOD_GPIO_SITE_METHOD = local

  As you have noticed, BR2_EXTERNAL is not exported so you can't refer to it 
from the package Makefile. The proper way is to add here:

KMOD_GPIO_MODULE_MAKE_OPTS = NETAPP_DIR=$(BR2_EXTERNAL)

>
> $(eval $(kernel-module))
> $(eval $(generic-package))
>
> And I have a Makefile in the directory that is:
>
> #inform the kernel that a module needs to be build
> obj-m :=gpio_module.o
>
> # Global Includes here
> GBL_INCLUDES = $(BR2_EXTERNAL)/netapp/include
> KNL_INCLUDES = $(BR2_EXTERNAL)/netapp/include/kernel

  And here you use GBL_INCLUDES=$(NETAPP_DIR)/include


  Regards,
  Arnout

>
> #Add here the CFLAGS to pass in to get the Defined Symbol
> CFLAGS_gpio_module.o := -DCONFIG_NETAPP_HWDD -I$(GBL_INCLUDES) -I$(KNL_INCLUDES)
>
> {fixed the bad,bad CFLAGS issue :) }
>
> However, I get a failure to build, due to missing headers, which are located in
> the GBL_INCLUDES path.  It seems for kernel modules, the $(BR2_EXTERNAL) is not
> being honored, as shown below.  Does this get passed through?  Is it OK to
> "reach back" to the source directory for the includes?
[snip]

-- 
Arnout Vandecappelle      arnout dot vandecappelle at essensium dot com
Senior Embedded Software Architect . . . . . . +32-478-010353 (mobile)
Essensium, Mind division . . . . . . . . . . . . . . http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium . . . . . BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

  reply	other threads:[~2016-04-13 15:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-12 18:25 [Buildroot] Cannot build Custom Kernel Module Stephen Beckwith
2016-04-12 21:07 ` Arnout Vandecappelle
2016-04-13 14:38   ` Stephen Beckwith
2016-04-13 15:37     ` Arnout Vandecappelle [this message]
2016-04-13 16:00       ` Stephen Beckwith
2016-04-13 16:07         ` Arnout Vandecappelle
2016-04-13 19:03           ` Stephen Beckwith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=570E67C7.5020209@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox