All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] problem with building kernel modules.
@ 2013-11-15 20:24 Sagaert Johan
  2013-11-15 20:56 ` Yann E. MORIN
  0 siblings, 1 reply; 3+ messages in thread
From: Sagaert Johan @ 2013-11-15 20:24 UTC (permalink / raw)
  To: buildroot

 
Hi 

I have a kernel module that I build and install trough the build system.
This works fine, the module gets build, installed and depmod is run for it.

The problem occurs if I change the kernel config, the kernel build system
removes all target/lib/modules/2.6.36.../kernel/* files , including my built modules.

As a result, my modules are missing.

How can this be solved ? 



########################################################################
#
# fm25clxx
#
########################################################################

FM25CLXX_VERSION = 1.0.1
FM25CLXX_SITE = /root/workspace2/FM25FRAMDriver-$(FM25CLXX_VERSION)
FM25CLXX_SITE_METHOD = local
FM25CLXX_DEPENDENCIES = linux

FM25CLXX_MOD_INSTALL_DIR=mydrivers

FM25CLXX_MAKE_OPTS += ARCH=$(KERNEL_ARCH)
FM25CLXX_MAKE_OPTS += CROSS_COMPILE=$(TARGET_CROSS)

FM25CLXX_INSTALL_OPTS += -C $(LINUX_DIR)
FM25CLXX_INSTALL_OPTS += M=$(@D)
FM25CLXX_INSTALL_OPTS += INSTALL_MOD_PATH=$(TARGET_DIR)
FM25CLXX_INSTALL_OPTS += INSTALL_MOD_STRIP=1
FM25CLXX_INSTALL_OPTS += INSTALL_MOD_DIR=kernel/$(FM25CLXX_MOD_INSTALL_DIR)

# see https://www.kernel.org/doc/Documentation/kbuild/modules.txt

define FM25CLXX_CONFIGURE_CMDS
	$(MAKE) KERNELDIR=$(LINUX_DIR) $(DIGITAL_IO_MAKE_OPTS) PWD=$(@D) -C $(@D)  clean
endef

define FM25CLXX_BUILD_CMDS
	$(MAKE) KERNELDIR=$(LINUX_DIR) $(FM25CLXX_MAKE_OPTS) PWD=$(@D) -C $(@D)  all
endef

define FM25CLXX_INSTALL_TARGET_CMDS
	$(MAKE) $(FM25CLXX_MAKE_OPTS) $(FM25CLXX_INSTALL_OPTS) modules_install
endef

define FM25CLXX_UNINSTALL_TARGET_CMDS
	rm -rf $(TARGET_DIR)/lib/modules/$(LINUX_VERSION_PROBED)/$(FM25CLXX_MOD_INSTALL_DIR)
endef

$(eval $(generic-package))

 

Regards
Sagaert Johan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] problem with building kernel modules.
  2013-11-15 20:24 [Buildroot] problem with building kernel modules Sagaert Johan
@ 2013-11-15 20:56 ` Yann E. MORIN
  2013-11-15 23:08   ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Yann E. MORIN @ 2013-11-15 20:56 UTC (permalink / raw)
  To: buildroot

Sagaert, All,

On 2013-11-15 21:24 +0100, Sagaert Johan spake thusly:
> I have a kernel module that I build and install trough the build system.
> This works fine, the module gets build, installed and depmod is run for it.
> 
> The problem occurs if I change the kernel config, the kernel build system
> removes all target/lib/modules/2.6.36.../kernel/* files , including my built modules.
> 
> As a result, my modules are missing.
> 
> How can this be solved ? 

There's no guarantee built into Buildroot that rebuilding a package will
rebuild other packages that depend on it.

The only option for you is to explicitly tell Buildroot to rebuild your
module:
    make fm25clxx-clean-for-reconfigure fm25clxx all

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] problem with building kernel modules.
  2013-11-15 20:56 ` Yann E. MORIN
@ 2013-11-15 23:08   ` Thomas Petazzoni
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2013-11-15 23:08 UTC (permalink / raw)
  To: buildroot

Dear Yann E. MORIN,

On Fri, 15 Nov 2013 21:56:54 +0100, Yann E. MORIN wrote:

> The only option for you is to explicitly tell Buildroot to rebuild
> your module:
>     make fm25clxx-clean-for-reconfigure fm25clxx all

Or, more simply:

	make fm25clxx-reconfigure all

The "-clean-for-reconfigure" and "-clean-for-rebuild" are meant to be
internal targets. The ones that should be used are "-reconfigure" and
"-rebuild".

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-11-15 23:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-15 20:24 [Buildroot] problem with building kernel modules Sagaert Johan
2013-11-15 20:56 ` Yann E. MORIN
2013-11-15 23:08   ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.