* [Buildroot] [PATCH 01/11 v2] package-infra: add helper to build kernel modules
2015-06-10 19:22 [Buildroot] [PATCH 0/11 v2] pkg-kernel-module: new infra to ease building kernel modules (branch yem/kernel-modules) Yann E. MORIN
@ 2015-06-10 19:22 ` Yann E. MORIN
2015-06-10 21:08 ` rdkehn at yahoo.com
2015-06-11 22:44 ` Arnout Vandecappelle
2015-06-10 19:22 ` [Buildroot] [PATCH 02/11 v2] docs/manual: add kernel-module Yann E. MORIN
` (10 subsequent siblings)
11 siblings, 2 replies; 33+ messages in thread
From: Yann E. MORIN @ 2015-06-10 19:22 UTC (permalink / raw)
To: buildroot
The Linux kernel offers a nice and easy-to-use infra to build
out-of-tree kernel modules.
Currently, we have quite a few packages that build kernel modules, and
most duplicate (or rewrite) the same code over-and-over again.
Introduce a new infrastructure that provides helpers to build kernel
modules, so packages do not have to duplicate/rewrite that.
The infrastructure, unlike any other package infra, is not standalone.
It needs another package infra to be used. This is so that packages that
provide both userland and kernel modules can be built easily. So, this
infra only defines post-build and post-install hooks, that will build
the kernel modules after the rest of the package.
Also, no host version is provided, since it does not make sense to build
kernel modules for the host.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Baruch Siach <baruch@tkos.co.il>
Cc: Arnout Vandecappelle <arnout@mind.be>
---
Changes v1 -> v2:
- drop third and fourth args to inner macro: we're never going to
build kernel modules for the host (Baruch, Arnout)
- add missing LINUX_MAKE_ENV (Arnout)
- use $$(@D), not $$($(2)_DIR) (Arnout)
- print a single MESSAGE (Arnout, Thomas)
- typoes (Arnout)
---
package/Makefile.in | 1 +
package/pkg-kernel-module.mk | 89 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 90 insertions(+)
create mode 100644 package/pkg-kernel-module.mk
diff --git a/package/Makefile.in b/package/Makefile.in
index c02d31f..180fd46 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -398,3 +398,4 @@ include package/pkg-virtual.mk
include package/pkg-generic.mk
include package/pkg-kconfig.mk
include package/pkg-rebar.mk
+include package/pkg-kernel-module.mk
diff --git a/package/pkg-kernel-module.mk b/package/pkg-kernel-module.mk
new file mode 100644
index 0000000..608c9e6
--- /dev/null
+++ b/package/pkg-kernel-module.mk
@@ -0,0 +1,89 @@
+################################################################################
+# kernel module infrastructure for building Linux kernel modules
+#
+# This file implements an infrastructure that eases development of package
+# .mk files for out-of-tree Linux kernel modules. It should be used for all
+# packages that build a Linux kernel module using the kernel's out-of-tree
+# buildsystem, unless they use a complex custom build-system.
+#
+# In terms of implementation, this infrastructure relies on another package
+# infrastructure, and only defines post-build and post-install hooks, so that
+# packages can both build user-space (with any of the other *-package infra)
+# and/or build kernel modules.
+#
+# As such, it is to be used in conjunction with another *-package infra,
+# like so:
+#
+# $(eval $(kernel-module))
+# $(eval $(generic-package))
+#
+# Note: if the caller needs access to the kernel modules (either after they
+# are built or after they are installed), it will have to define its own
+# post-build/install hooks after calling kernel-module, but before calling
+# the other *-package infra, like so:
+#
+# $(eval $(kernel-module))
+# define FOO_MOD_TWEAK
+# # do something
+# endef
+# FOO_POST_BUILD_HOOKS += FOO_MOD_TWEAK
+# $(eval $(generic-package))
+#
+# Note: this infra does not check that the kernel is enabled; it is expected
+# to be enforced at the Kconfig level with proper 'depends on'.
+################################################################################
+
+################################################################################
+# inner-kernel-module -- generates the make targets needed to support building
+# a kernel module
+#
+# argument 1 is the lowercase package name
+# argument 2 is the uppercase package name
+################################################################################
+
+define inner-kernel-module
+
+# The kernel must be built first.
+$(2)_DEPENDENCIES += linux
+
+# This is only defined in some infrastructures (e.g. autotools, cmake), but
+# not in others (generic). So define it if not already defined.
+$(2)_MAKE ?= $$(MAKE)
+
+# If not specified, consider the source of the kernel module to be at
+# the root of the package.
+$(2)_MODULE_SUBDIRS ?= .
+
+# Build the kernel module(s)
+define $(2)_KERNEL_MODULES_BUILD
+ @$$(call MESSAGE,"Building kernel module(s)")
+ $$(foreach d,$$($(2)_MODULE_SUBDIRS), \
+ $$(LINUX_MAKE_ENV) $$($$(PKG)_MAKE) \
+ -C $$(LINUX_DIR) \
+ $$(LINUX_MAKE_FLAGS) \
+ $$($(2)_MODULE_MAKE_OPTS) \
+ M=$$(@D)/$$(d) \
+ modules$$(sep))
+endef
+$(2)_POST_BUILD_HOOKS += $(2)_KERNEL_MODULES_BUILD
+
+# Install the kernel module(s)
+define $(2)_KERNEL_MODULES_INSTALL
+ @$$(call MESSAGE,"Installing kernel module(s)")
+ $$(foreach d,$$($(2)_MODULE_SUBDIRS), \
+ $$(LINUX_MAKE_ENV) $$($$(PKG)_MAKE) \
+ -C $$(LINUX_DIR) \
+ $$(LINUX_MAKE_FLAGS) \
+ $$($(2)_MODULE_MAKE_OPTS) \
+ M=$$(@D)/$$(d) \
+ modules_install$$(sep))
+endef
+$(2)_POST_INSTALL_TARGET_HOOKS += $(2)_KERNEL_MODULES_INSTALL
+
+endef
+
+################################################################################
+# kernel-module -- the target generator macro for kernel module packages
+################################################################################
+
+kernel-module = $(call inner-kernel-module,$(pkgname),$(call UPPERCASE,$(pkgname)))
--
1.9.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [Buildroot] [PATCH 01/11 v2] package-infra: add helper to build kernel modules
2015-06-10 19:22 ` [Buildroot] [PATCH 01/11 v2] package-infra: add helper to build kernel modules Yann E. MORIN
@ 2015-06-10 21:08 ` rdkehn at yahoo.com
2015-06-11 18:05 ` Yann E. MORIN
2015-06-11 22:44 ` Arnout Vandecappelle
1 sibling, 1 reply; 33+ messages in thread
From: rdkehn at yahoo.com @ 2015-06-10 21:08 UTC (permalink / raw)
To: buildroot
On Wed, Jun 10, 2015 at 09:22:05PM +0200, Yann E. MORIN wrote:
> The Linux kernel offers a nice and easy-to-use infra to build
> out-of-tree kernel modules.
>
> Currently, we have quite a few packages that build kernel modules, and
> most duplicate (or rewrite) the same code over-and-over again.
>
> Introduce a new infrastructure that provides helpers to build kernel
> modules, so packages do not have to duplicate/rewrite that.
>
> The infrastructure, unlike any other package infra, is not standalone.
> It needs another package infra to be used. This is so that packages that
> provide both userland and kernel modules can be built easily. So, this
> infra only defines post-build and post-install hooks, that will build
> the kernel modules after the rest of the package.
>
> Also, no host version is provided, since it does not make sense to build
> kernel modules for the host.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: Baruch Siach <baruch@tkos.co.il>
> Cc: Arnout Vandecappelle <arnout@mind.be>
Tested-by: Doug Kehn <rdkehn@yahoo.com>
>
> ---
> Changes v1 -> v2:
> - drop third and fourth args to inner macro: we're never going to
> build kernel modules for the host (Baruch, Arnout)
> - add missing LINUX_MAKE_ENV (Arnout)
> - use $$(@D), not $$($(2)_DIR) (Arnout)
> - print a single MESSAGE (Arnout, Thomas)
> - typoes (Arnout)
> ---
> package/Makefile.in | 1 +
> package/pkg-kernel-module.mk | 89 ++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 90 insertions(+)
> create mode 100644 package/pkg-kernel-module.mk
>
> diff --git a/package/Makefile.in b/package/Makefile.in
> index c02d31f..180fd46 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -398,3 +398,4 @@ include package/pkg-virtual.mk
> include package/pkg-generic.mk
> include package/pkg-kconfig.mk
> include package/pkg-rebar.mk
> +include package/pkg-kernel-module.mk
> diff --git a/package/pkg-kernel-module.mk b/package/pkg-kernel-module.mk
> new file mode 100644
> index 0000000..608c9e6
> --- /dev/null
> +++ b/package/pkg-kernel-module.mk
> @@ -0,0 +1,89 @@
> +################################################################################
> +# kernel module infrastructure for building Linux kernel modules
> +#
> +# This file implements an infrastructure that eases development of package
> +# .mk files for out-of-tree Linux kernel modules. It should be used for all
> +# packages that build a Linux kernel module using the kernel's out-of-tree
> +# buildsystem, unless they use a complex custom build-system.
> +#
> +# In terms of implementation, this infrastructure relies on another package
> +# infrastructure, and only defines post-build and post-install hooks, so that
> +# packages can both build user-space (with any of the other *-package infra)
> +# and/or build kernel modules.
> +#
> +# As such, it is to be used in conjunction with another *-package infra,
> +# like so:
> +#
> +# $(eval $(kernel-module))
> +# $(eval $(generic-package))
> +#
> +# Note: if the caller needs access to the kernel modules (either after they
> +# are built or after they are installed), it will have to define its own
> +# post-build/install hooks after calling kernel-module, but before calling
> +# the other *-package infra, like so:
> +#
> +# $(eval $(kernel-module))
> +# define FOO_MOD_TWEAK
> +# # do something
> +# endef
> +# FOO_POST_BUILD_HOOKS += FOO_MOD_TWEAK
> +# $(eval $(generic-package))
> +#
> +# Note: this infra does not check that the kernel is enabled; it is expected
> +# to be enforced at the Kconfig level with proper 'depends on'.
> +################################################################################
> +
> +################################################################################
> +# inner-kernel-module -- generates the make targets needed to support building
> +# a kernel module
> +#
> +# argument 1 is the lowercase package name
> +# argument 2 is the uppercase package name
> +################################################################################
> +
> +define inner-kernel-module
> +
> +# The kernel must be built first.
> +$(2)_DEPENDENCIES += linux
> +
> +# This is only defined in some infrastructures (e.g. autotools, cmake), but
> +# not in others (generic). So define it if not already defined.
> +$(2)_MAKE ?= $$(MAKE)
> +
> +# If not specified, consider the source of the kernel module to be at
> +# the root of the package.
> +$(2)_MODULE_SUBDIRS ?= .
> +
> +# Build the kernel module(s)
> +define $(2)_KERNEL_MODULES_BUILD
> + @$$(call MESSAGE,"Building kernel module(s)")
> + $$(foreach d,$$($(2)_MODULE_SUBDIRS), \
> + $$(LINUX_MAKE_ENV) $$($$(PKG)_MAKE) \
> + -C $$(LINUX_DIR) \
> + $$(LINUX_MAKE_FLAGS) \
> + $$($(2)_MODULE_MAKE_OPTS) \
> + M=$$(@D)/$$(d) \
> + modules$$(sep))
> +endef
> +$(2)_POST_BUILD_HOOKS += $(2)_KERNEL_MODULES_BUILD
> +
> +# Install the kernel module(s)
> +define $(2)_KERNEL_MODULES_INSTALL
> + @$$(call MESSAGE,"Installing kernel module(s)")
> + $$(foreach d,$$($(2)_MODULE_SUBDIRS), \
> + $$(LINUX_MAKE_ENV) $$($$(PKG)_MAKE) \
> + -C $$(LINUX_DIR) \
> + $$(LINUX_MAKE_FLAGS) \
> + $$($(2)_MODULE_MAKE_OPTS) \
> + M=$$(@D)/$$(d) \
> + modules_install$$(sep))
> +endef
> +$(2)_POST_INSTALL_TARGET_HOOKS += $(2)_KERNEL_MODULES_INSTALL
> +
> +endef
> +
> +################################################################################
> +# kernel-module -- the target generator macro for kernel module packages
> +################################################################################
> +
> +kernel-module = $(call inner-kernel-module,$(pkgname),$(call UPPERCASE,$(pkgname)))
> --
> 1.9.1
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 33+ messages in thread
* [Buildroot] [PATCH 01/11 v2] package-infra: add helper to build kernel modules
2015-06-10 21:08 ` rdkehn at yahoo.com
@ 2015-06-11 18:05 ` Yann E. MORIN
0 siblings, 0 replies; 33+ messages in thread
From: Yann E. MORIN @ 2015-06-11 18:05 UTC (permalink / raw)
To: buildroot
Doug, All,
On 2015-06-10 16:08 -0500, rdkehn at yahoo.com spake thusly:
> On Wed, Jun 10, 2015 at 09:22:05PM +0200, Yann E. MORIN wrote:
> > The Linux kernel offers a nice and easy-to-use infra to build
> > out-of-tree kernel modules.
> >
> > Currently, we have quite a few packages that build kernel modules, and
> > most duplicate (or rewrite) the same code over-and-over again.
> >
> > Introduce a new infrastructure that provides helpers to build kernel
> > modules, so packages do not have to duplicate/rewrite that.
> >
> > The infrastructure, unlike any other package infra, is not standalone.
> > It needs another package infra to be used. This is so that packages that
> > provide both userland and kernel modules can be built easily. So, this
> > infra only defines post-build and post-install hooks, that will build
> > the kernel modules after the rest of the package.
> >
> > Also, no host version is provided, since it does not make sense to build
> > kernel modules for the host.
> >
> > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> > Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> > Cc: Baruch Siach <baruch@tkos.co.il>
> > Cc: Arnout Vandecappelle <arnout@mind.be>
> Tested-by: Doug Kehn <rdkehn@yahoo.com>
Sorry, I forgot to propagate your Tested-by tag from the previous
iteration. I'll do for the next one.
Thanks! :-)
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] 33+ messages in thread
* [Buildroot] [PATCH 01/11 v2] package-infra: add helper to build kernel modules
2015-06-10 19:22 ` [Buildroot] [PATCH 01/11 v2] package-infra: add helper to build kernel modules Yann E. MORIN
2015-06-10 21:08 ` rdkehn at yahoo.com
@ 2015-06-11 22:44 ` Arnout Vandecappelle
2015-06-12 17:46 ` Yann E. MORIN
1 sibling, 1 reply; 33+ messages in thread
From: Arnout Vandecappelle @ 2015-06-11 22:44 UTC (permalink / raw)
To: buildroot
On 06/10/15 21:22, Yann E. MORIN wrote:
> The Linux kernel offers a nice and easy-to-use infra to build
> out-of-tree kernel modules.
>
> Currently, we have quite a few packages that build kernel modules, and
> most duplicate (or rewrite) the same code over-and-over again.
>
> Introduce a new infrastructure that provides helpers to build kernel
> modules, so packages do not have to duplicate/rewrite that.
>
> The infrastructure, unlike any other package infra, is not standalone.
> It needs another package infra to be used. This is so that packages that
> provide both userland and kernel modules can be built easily. So, this
> infra only defines post-build and post-install hooks, that will build
> the kernel modules after the rest of the package.
>
> Also, no host version is provided, since it does not make sense to build
> kernel modules for the host.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: Baruch Siach <baruch@tkos.co.il>
> Cc: Arnout Vandecappelle <arnout@mind.be>
Just some comments about the comments, and an optional remark, so after fixing
those you can add my
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
[snip]
> diff --git a/package/pkg-kernel-module.mk b/package/pkg-kernel-module.mk
> new file mode 100644
> index 0000000..608c9e6
> --- /dev/null
> +++ b/package/pkg-kernel-module.mk
> @@ -0,0 +1,89 @@
> +################################################################################
> +# kernel module infrastructure for building Linux kernel modules
> +#
> +# This file implements an infrastructure that eases development of package
> +# .mk files for out-of-tree Linux kernel modules. It should be used for all
> +# packages that build a Linux kernel module using the kernel's out-of-tree
> +# buildsystem, unless they use a complex custom build-system.
buildsystem, build-system. What about consistently choosing "build system"? :-)
> +#
> +# In terms of implementation, this infrastructure relies on another package
> +# infrastructure, and only defines post-build and post-install hooks, so that
> +# packages can both build user-space (with any of the other *-package infra)
> +# and/or build kernel modules.
# The kernel-module infrastructure requires the packages that use it to also
# include another package infrastructure. kernel-module only defines post-build
# and post-install hooks. This allows the package to build both kernel modules
# and/or user-space components (with any of the other *-package infra).
> +#
> +# As such, it is to be used in conjunction with another *-package infra,
> +# like so:
> +#
> +# $(eval $(kernel-module))
> +# $(eval $(generic-package))
> +#
> +# Note: if the caller needs access to the kernel modules (either after they
> +# are built or after they are installed), it will have to define its own
> +# post-build/install hooks after calling kernel-module, but before calling
after -> *after*
> +# the other *-package infra, like so:
> +#
> +# $(eval $(kernel-module))
> +# define FOO_MOD_TWEAK
> +# # do something
> +# endef
> +# FOO_POST_BUILD_HOOKS += FOO_MOD_TWEAK
> +# $(eval $(generic-package))
> +#
> +# Note: this infra does not check that the kernel is enabled; it is expected
> +# to be enforced at the Kconfig level with proper 'depends on'.
> +################################################################################
> +
> +################################################################################
> +# inner-kernel-module -- generates the make targets needed to support building
> +# a kernel module
> +#
> +# argument 1 is the lowercase package name
Is there any reason to keep this, since it's not used?
> +# argument 2 is the uppercase package name
> +################################################################################
> +
> +define inner-kernel-module
> +
> +# The kernel must be built first.
> +$(2)_DEPENDENCIES += linux
> +
> +# This is only defined in some infrastructures (e.g. autotools, cmake), but
> +# not in others (generic). So define it if not already defined.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
So define it here as well.
Regards,
Arnout
> +$(2)_MAKE ?= $$(MAKE)
> +
> +# If not specified, consider the source of the kernel module to be at
> +# the root of the package.
> +$(2)_MODULE_SUBDIRS ?= .
> +
> +# Build the kernel module(s)
> +define $(2)_KERNEL_MODULES_BUILD
> + @$$(call MESSAGE,"Building kernel module(s)")
> + $$(foreach d,$$($(2)_MODULE_SUBDIRS), \
> + $$(LINUX_MAKE_ENV) $$($$(PKG)_MAKE) \
> + -C $$(LINUX_DIR) \
> + $$(LINUX_MAKE_FLAGS) \
> + $$($(2)_MODULE_MAKE_OPTS) \
> + M=$$(@D)/$$(d) \
> + modules$$(sep))
> +endef
> +$(2)_POST_BUILD_HOOKS += $(2)_KERNEL_MODULES_BUILD
> +
> +# Install the kernel module(s)
> +define $(2)_KERNEL_MODULES_INSTALL
> + @$$(call MESSAGE,"Installing kernel module(s)")
> + $$(foreach d,$$($(2)_MODULE_SUBDIRS), \
> + $$(LINUX_MAKE_ENV) $$($$(PKG)_MAKE) \
> + -C $$(LINUX_DIR) \
> + $$(LINUX_MAKE_FLAGS) \
> + $$($(2)_MODULE_MAKE_OPTS) \
> + M=$$(@D)/$$(d) \
> + modules_install$$(sep))
> +endef
> +$(2)_POST_INSTALL_TARGET_HOOKS += $(2)_KERNEL_MODULES_INSTALL
> +
> +endef
> +
> +################################################################################
> +# kernel-module -- the target generator macro for kernel module packages
> +################################################################################
> +
> +kernel-module = $(call inner-kernel-module,$(pkgname),$(call UPPERCASE,$(pkgname)))
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind 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: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 33+ messages in thread
* [Buildroot] [PATCH 01/11 v2] package-infra: add helper to build kernel modules
2015-06-11 22:44 ` Arnout Vandecappelle
@ 2015-06-12 17:46 ` Yann E. MORIN
2015-06-12 22:52 ` Arnout Vandecappelle
0 siblings, 1 reply; 33+ messages in thread
From: Yann E. MORIN @ 2015-06-12 17:46 UTC (permalink / raw)
To: buildroot
Arnout, All,
On 2015-06-12 00:44 +0200, Arnout Vandecappelle spake thusly:
> On 06/10/15 21:22, Yann E. MORIN wrote:
> > The Linux kernel offers a nice and easy-to-use infra to build
> > out-of-tree kernel modules.
[--SNIP--]
> > diff --git a/package/pkg-kernel-module.mk b/package/pkg-kernel-module.mk
> > new file mode 100644
> > index 0000000..608c9e6
> > --- /dev/null
> > +++ b/package/pkg-kernel-module.mk
> > @@ -0,0 +1,89 @@
> > +################################################################################
> > +# kernel module infrastructure for building Linux kernel modules
> > +#
> > +# This file implements an infrastructure that eases development of package
> > +# .mk files for out-of-tree Linux kernel modules. It should be used for all
> > +# packages that build a Linux kernel module using the kernel's out-of-tree
> > +# buildsystem, unless they use a complex custom build-system.
>
> buildsystem, build-system. What about consistently choosing "build system"? :-)
I think we've settled for "buildsystem" in other places, so I'll stick
to that (and fix here).
> > +# In terms of implementation, this infrastructure relies on another package
> > +# infrastructure, and only defines post-build and post-install hooks, so that
> > +# packages can both build user-space (with any of the other *-package infra)
> > +# and/or build kernel modules.
>
> # The kernel-module infrastructure requires the packages that use it to also
> # include another package infrastructure. kernel-module only defines post-build
s/include/use/ because we're not 'including' pkg infras, we're not even
calling them, we're evaluating them. So I'd still word that as 'use' if
you don't mind. ;-)
> # and post-install hooks. This allows the package to build both kernel modules
> # and/or user-space components (with any of the other *-package infra).
Otherwise, OK, it's simpler and more explixit thn what I wrote.
> > +#
> > +# As such, it is to be used in conjunction with another *-package infra,
> > +# like so:
> > +#
> > +# $(eval $(kernel-module))
> > +# $(eval $(generic-package))
> > +#
> > +# Note: if the caller needs access to the kernel modules (either after they
> > +# are built or after they are installed), it will have to define its own
> > +# post-build/install hooks after calling kernel-module, but before calling
>
> after -> *after*
OK. I guess ditto for: before -> *before* , no?
> > +# the other *-package infra, like so:
> > +#
> > +# $(eval $(kernel-module))
> > +# define FOO_MOD_TWEAK
> > +# # do something
> > +# endef
> > +# FOO_POST_BUILD_HOOKS += FOO_MOD_TWEAK
> > +# $(eval $(generic-package))
> > +#
> > +# Note: this infra does not check that the kernel is enabled; it is expected
> > +# to be enforced at the Kconfig level with proper 'depends on'.
> > +################################################################################
> > +
> > +################################################################################
> > +# inner-kernel-module -- generates the make targets needed to support building
> > +# a kernel module
> > +#
> > +# argument 1 is the lowercase package name
>
> Is there any reason to keep this, since it's not used?
Well, I wanted to keep it as much aligned to existing infras as
possible, even though we're not using it.
> > +# argument 2 is the uppercase package name
> > +################################################################################
> > +
> > +define inner-kernel-module
> > +
> > +# The kernel must be built first.
> > +$(2)_DEPENDENCIES += linux
> > +
> > +# This is only defined in some infrastructures (e.g. autotools, cmake), but
> > +# not in others (generic). So define it if not already defined.
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> So define it here as well.
OK.
Thanks! :-)
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] 33+ messages in thread
* [Buildroot] [PATCH 01/11 v2] package-infra: add helper to build kernel modules
2015-06-12 17:46 ` Yann E. MORIN
@ 2015-06-12 22:52 ` Arnout Vandecappelle
0 siblings, 0 replies; 33+ messages in thread
From: Arnout Vandecappelle @ 2015-06-12 22:52 UTC (permalink / raw)
To: buildroot
On 06/12/15 19:46, Yann E. MORIN wrote:
> Arnout, All,
>
> On 2015-06-12 00:44 +0200, Arnout Vandecappelle spake thusly:
>> On 06/10/15 21:22, Yann E. MORIN wrote:
>>> The Linux kernel offers a nice and easy-to-use infra to build
>>> out-of-tree kernel modules.
> [--SNIP--]
>>> diff --git a/package/pkg-kernel-module.mk b/package/pkg-kernel-module.mk
>>> new file mode 100644
>>> index 0000000..608c9e6
>>> --- /dev/null
>>> +++ b/package/pkg-kernel-module.mk
>>> @@ -0,0 +1,89 @@
>>> +################################################################################
>>> +# kernel module infrastructure for building Linux kernel modules
>>> +#
>>> +# This file implements an infrastructure that eases development of package
>>> +# .mk files for out-of-tree Linux kernel modules. It should be used for all
>>> +# packages that build a Linux kernel module using the kernel's out-of-tree
>>> +# buildsystem, unless they use a complex custom build-system.
>>
>> buildsystem, build-system. What about consistently choosing "build system"? :-)
>
> I think we've settled for "buildsystem" in other places, so I'll stick
> to that (and fix here).
OK. I was joking about the "build system".
>
>>> +# In terms of implementation, this infrastructure relies on another package
>>> +# infrastructure, and only defines post-build and post-install hooks, so that
>>> +# packages can both build user-space (with any of the other *-package infra)
>>> +# and/or build kernel modules.
>>
>> # The kernel-module infrastructure requires the packages that use it to also
>> # include another package infrastructure. kernel-module only defines post-build
>
> s/include/use/ because we're not 'including' pkg infras, we're not even
> calling them, we're evaluating them. So I'd still word that as 'use' if
> you don't mind. ;-)
Yep that's better.
>
>> # and post-install hooks. This allows the package to build both kernel modules
>> # and/or user-space components (with any of the other *-package infra).
>
> Otherwise, OK, it's simpler and more explixit thn what I wrote.
>
>>> +#
>>> +# As such, it is to be used in conjunction with another *-package infra,
>>> +# like so:
>>> +#
>>> +# $(eval $(kernel-module))
>>> +# $(eval $(generic-package))
>>> +#
>>> +# Note: if the caller needs access to the kernel modules (either after they
>>> +# are built or after they are installed), it will have to define its own
>>> +# post-build/install hooks after calling kernel-module, but before calling
>>
>> after -> *after*
>
> OK. I guess ditto for: before -> *before* , no?
Yeah you're right.
>
>>> +# the other *-package infra, like so:
>>> +#
>>> +# $(eval $(kernel-module))
>>> +# define FOO_MOD_TWEAK
>>> +# # do something
>>> +# endef
>>> +# FOO_POST_BUILD_HOOKS += FOO_MOD_TWEAK
>>> +# $(eval $(generic-package))
>>> +#
>>> +# Note: this infra does not check that the kernel is enabled; it is expected
>>> +# to be enforced at the Kconfig level with proper 'depends on'.
>>> +################################################################################
>>> +
>>> +################################################################################
>>> +# inner-kernel-module -- generates the make targets needed to support building
>>> +# a kernel module
>>> +#
>>> +# argument 1 is the lowercase package name
>>
>> Is there any reason to keep this, since it's not used?
>
> Well, I wanted to keep it as much aligned to existing infras as
> possible, even though we're not using it.
Yeah, but you did remove the rest of the usual arguments... Anyway, I'm OK with
keeping the first argument if you want.
Regards,
Arnout
>
>>> +# argument 2 is the uppercase package name
>>> +################################################################################
>>> +
>>> +define inner-kernel-module
>>> +
>>> +# The kernel must be built first.
>>> +$(2)_DEPENDENCIES += linux
>>> +
>>> +# This is only defined in some infrastructures (e.g. autotools, cmake), but
>>> +# not in others (generic). So define it if not already defined.
>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> So define it here as well.
>
> OK.
>
> Thanks! :-)
>
> Regards,
> Yann E. MORIN.
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind 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: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 33+ messages in thread
* [Buildroot] [PATCH 02/11 v2] docs/manual: add kernel-module
2015-06-10 19:22 [Buildroot] [PATCH 0/11 v2] pkg-kernel-module: new infra to ease building kernel modules (branch yem/kernel-modules) Yann E. MORIN
2015-06-10 19:22 ` [Buildroot] [PATCH 01/11 v2] package-infra: add helper to build kernel modules Yann E. MORIN
@ 2015-06-10 19:22 ` Yann E. MORIN
2015-06-11 7:32 ` Jeremy Rosen
2015-06-10 19:22 ` [Buildroot] [PATCH 03/11 v2] package/lttng-modules: use kernel-module helper Yann E. MORIN
` (9 subsequent siblings)
11 siblings, 1 reply; 33+ messages in thread
From: Yann E. MORIN @ 2015-06-10 19:22 UTC (permalink / raw)
To: buildroot
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Samuel Martin <s.martin49@gmail.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
---
Changes v1 -> v2:
- some rephrasing and refactoring (Arnout)
---
docs/manual/adding-packages-kernel-module.txt | 129 ++++++++++++++++++++++++++
docs/manual/adding-packages.txt | 2 +
2 files changed, 131 insertions(+)
create mode 100644 docs/manual/adding-packages-kernel-module.txt
diff --git a/docs/manual/adding-packages-kernel-module.txt b/docs/manual/adding-packages-kernel-module.txt
new file mode 100644
index 0000000..39927b2
--- /dev/null
+++ b/docs/manual/adding-packages-kernel-module.txt
@@ -0,0 +1,129 @@
+// -*- mode:doc; -*-
+// vim: set syntax=asciidoc:
+
+=== Infrastructure for packages building kernel modules
+
+Buildroot offers a helper infrastructure to make it easy to write packages that
+build and install Linux kernel modules. Some packages only contain a kernel
+module, other packages contain programs and libraries in addition to kernel
+modules. Buildroot's helper infrastructure supports either case.
+
+[[kernel-module-tutorial]]
+==== +kernel-module+ tutorial
+
+Let's start with an example on how to prepare a simple package that only
+builds a kernel module, and no other component:
+
+----
+01: ################################################################################
+02: #
+03: # foo
+04: #
+05: ################################################################################
+06:
+07: FOO_VERSION = 1.2.3
+08: FOO_SOURCE = foo-$(FOO_VERSION).tar.xz
+09: FOO_SITE = http://www.foosoftware.org/download
+10: FOO_LICENSE = GPLv2
+11: FOO_LICENSE_FILES = COPYING
+12:
+13: $(eval $(kernel-module))
+14: $(eval $(generic-package))
+----
+
+Lines 7-11 define the usual meta-data to specify the version, archive name,
+remote URI where to find the package source, licensing information.
+
+On line 13, we invoke the +kernel-module+ helper infrastructure, that
+generates all the appropriate Makefile rules and variables to build
+that kernel module.
+
+Finally, on line 14, we invoke the
+xref:generic-package-tutorial[+generic-package+ infrastructure].
+
+The dependency on +linux+ is automatically added, so it is not needed to
+specify it in +FOO_DEPENDENCIES+.
+
+What you may have noticed is that, unlike other package infrastructures,
+we explicitly invoke a second infrastructure. This allows a package to
+build a kernel module, but also, if needed, use any one of other package
+infrastructures to build normal userland components (libraries,
+executables...). Using the +kernel-module+ infrastructure on its own is
+not sufficient; another package infrastructure *must* be used.
+
+Let's look at a more complex example:
+
+----
+01: ################################################################################
+02: #
+03: # foo
+04: #
+05: ################################################################################
+06:
+07: FOO_VERSION = 1.2.3
+08: FOO_SOURCE = foo-$(FOO_VERSION).tar.xz
+09: FOO_SITE = http://www.foosoftware.org/download
+10: FOO_LICENSE = GPLv2
+11: FOO_LICENSE_FILES = COPYING
+12:
+13: FOO_MODULE_SUBDIRS = driver/base
+14: FOO_MODULE_MAKE_OPTS = KVERSION=$(LINUX_VERSION_PROBED)
+15:
+16: ifeq ($(BR2_PACKAGE_LIBBAR),y)
+17: FOO_DEPENDENCIES = libbar
+18: FOO_CONF_OPTS = --enable-bar
+19: FOO_MODULE_SUBDIRS += driver/bar
+20: else
+21: FOO_CONF_OPTS = --disable-bar
+22: endif
+23:
+24: $(eval $(kernel-module))
+26: $(eval $(autotools-package))
+----
+
+Here, we see that we have an autotools-based package, that also builds
+the kernel module located in sub-directory +driver/base+ and, if libbar
+is enabled, the kernel module located in sub-directory +driver/bar+, and
+defines the variable +KVERSION+ to be passed to the Linux buildsystem
+when building the module(s).
+
+
+[[kernel-module-reference]]
+==== +kernel-module+ reference
+
+The main macro for the kernel module infrastructure is +kernel-module+.
+Unlike other package infrastructures, it is not stand-alone, and requires
+any of the other +*-package+ macros be called after it.
+
+The +kernel-module+ macro defines post-build and post-target-install
+hooks to build the kernel modules. If the package's +.mk+ needs access
+to the built kernel modules, it should do so in a post-build hook,
+registered after the call to +kernel-module+. Similarly, if the package's
++.mk+ needs access to the kernel module after it has been installed, it
+should do so in a post-install hook, registered after the call to
++kernel-module+. Here's an example:
+
+----
+$(eval $(kernel-module))
+
+define FOO_DO_STUFF_WITH_KERNEL_MODULE
+ # Do something with it...
+endef
+FOO_POST_BUILD_HOOKS += FOO_DO_STUFF_WITH_KERNEL_MODULE
+
+$(eval $(generic-package))
+----
+
+Finally, unlike the other package infrastructures, there is no
++host-kernel-module+ variant to build a host kernel module.
+
+The following additional variables can optionally be defined to further
+configure the build of the kernel module:
+
+* +FOO_MODULE_SUBDIRS+ may be set to one or more sub-directories (relative
+ to the package source top-directory) where the kernel module sources are.
+ If empty or not set, the sources for the kernel module(s) are considered
+ to be located at the top of the package source tree.
+
+* +FOO_MODULE_MAKE_OPTS+ may be set to contain extra variable definitions
+ to pass to the Linux buildsystem.
diff --git a/docs/manual/adding-packages.txt b/docs/manual/adding-packages.txt
index b8674f8..721fe39 100644
--- a/docs/manual/adding-packages.txt
+++ b/docs/manual/adding-packages.txt
@@ -29,6 +29,8 @@ include::adding-packages-kconfig.txt[]
include::adding-packages-rebar.txt[]
+include::adding-packages-kernel-module.txt[]
+
include::adding-packages-asciidoc.txt[]
include::adding-packages-hooks.txt[]
--
1.9.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [Buildroot] [PATCH 02/11 v2] docs/manual: add kernel-module
2015-06-10 19:22 ` [Buildroot] [PATCH 02/11 v2] docs/manual: add kernel-module Yann E. MORIN
@ 2015-06-11 7:32 ` Jeremy Rosen
2015-06-11 18:06 ` Yann E. MORIN
0 siblings, 1 reply; 33+ messages in thread
From: Jeremy Rosen @ 2015-06-11 7:32 UTC (permalink / raw)
To: buildroot
Hey, thx interesting work, a slight comment below....
> +
> +Let's look at a more complex example:
> +
> +----
> +01:
> ################################################################################
> +02: #
> +03: # foo
> +04: #
> +05:
> ################################################################################
> +06:
> +07: FOO_VERSION = 1.2.3
> +08: FOO_SOURCE = foo-$(FOO_VERSION).tar.xz
> +09: FOO_SITE = http://www.foosoftware.org/download
> +10: FOO_LICENSE = GPLv2
> +11: FOO_LICENSE_FILES = COPYING
> +12:
> +13: FOO_MODULE_SUBDIRS = driver/base
> +14: FOO_MODULE_MAKE_OPTS = KVERSION=$(LINUX_VERSION_PROBED)
> +15:
^ This variable is not documented anywhere, you might want to do that...
Regards
Jeremy
^ permalink raw reply [flat|nested] 33+ messages in thread
* [Buildroot] [PATCH 02/11 v2] docs/manual: add kernel-module
2015-06-11 7:32 ` Jeremy Rosen
@ 2015-06-11 18:06 ` Yann E. MORIN
2015-06-12 6:54 ` Jeremy Rosen
0 siblings, 1 reply; 33+ messages in thread
From: Yann E. MORIN @ 2015-06-11 18:06 UTC (permalink / raw)
To: buildroot
Jeremy, All,
On 2015-06-11 09:32 +0200, Jeremy Rosen spake thusly:
> > +Let's look at a more complex example:
> > +
> > +----
> > +01:
> > ################################################################################
> > +02: #
> > +03: # foo
> > +04: #
> > +05:
> > ################################################################################
> > +06:
> > +07: FOO_VERSION = 1.2.3
> > +08: FOO_SOURCE = foo-$(FOO_VERSION).tar.xz
> > +09: FOO_SITE = http://www.foosoftware.org/download
> > +10: FOO_LICENSE = GPLv2
> > +11: FOO_LICENSE_FILES = COPYING
> > +12:
> > +13: FOO_MODULE_SUBDIRS = driver/base
> > +14: FOO_MODULE_MAKE_OPTS = KVERSION=$(LINUX_VERSION_PROBED)
>
> ^ This variable is not documented anywhere, you might want to do that...
Yup, thanks.
What about:
http://git.buildroot.org/~ymorin/git/buildroot/commit/?h=yem/kernel-modules&id=663ab1ec1c3e5b80eae0bdb355bc0e2e0d58497c
(toward the end).
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] 33+ messages in thread
* [Buildroot] [PATCH 03/11 v2] package/lttng-modules: use kernel-module helper
2015-06-10 19:22 [Buildroot] [PATCH 0/11 v2] pkg-kernel-module: new infra to ease building kernel modules (branch yem/kernel-modules) Yann E. MORIN
2015-06-10 19:22 ` [Buildroot] [PATCH 01/11 v2] package-infra: add helper to build kernel modules Yann E. MORIN
2015-06-10 19:22 ` [Buildroot] [PATCH 02/11 v2] docs/manual: add kernel-module Yann E. MORIN
@ 2015-06-10 19:22 ` Yann E. MORIN
2015-06-11 22:44 ` Arnout Vandecappelle
2015-06-10 19:22 ` [Buildroot] [PATCH 04/11 v2] package/igh-ethercat: " Yann E. MORIN
` (8 subsequent siblings)
11 siblings, 1 reply; 33+ messages in thread
From: Yann E. MORIN @ 2015-06-10 19:22 UTC (permalink / raw)
To: buildroot
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
package/lttng-modules/lttng-modules.mk | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/package/lttng-modules/lttng-modules.mk b/package/lttng-modules/lttng-modules.mk
index 6833ad2..30c581e 100644
--- a/package/lttng-modules/lttng-modules.mk
+++ b/package/lttng-modules/lttng-modules.mk
@@ -10,14 +10,5 @@ LTTNG_MODULES_SOURCE = lttng-modules-$(LTTNG_MODULES_VERSION).tar.bz2
LTTNG_MODULES_LICENSE = LGPLv2.1/GPLv2 for kernel modules; MIT for lib/bitfield.h and lib/prio_heap/*
LTTNG_MODULES_LICENSE_FILES = lgpl-2.1.txt gpl-2.0.txt mit-license.txt LICENSE
-LTTNG_MODULES_DEPENDENCIES = linux
-
-define LTTNG_MODULES_BUILD_CMDS
- $(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KERNELDIR=$(LINUX_DIR)
-endef
-
-define LTTNG_MODULES_INSTALL_TARGET_CMDS
- $(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KERNELDIR=$(LINUX_DIR) modules_install
-endef
-
+$(eval $(kernel-module))
$(eval $(generic-package))
--
1.9.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [Buildroot] [PATCH 03/11 v2] package/lttng-modules: use kernel-module helper
2015-06-10 19:22 ` [Buildroot] [PATCH 03/11 v2] package/lttng-modules: use kernel-module helper Yann E. MORIN
@ 2015-06-11 22:44 ` Arnout Vandecappelle
0 siblings, 0 replies; 33+ messages in thread
From: Arnout Vandecappelle @ 2015-06-11 22:44 UTC (permalink / raw)
To: buildroot
On 06/10/15 21:22, Yann E. MORIN wrote:
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Regards,
Arnout
> ---
> package/lttng-modules/lttng-modules.mk | 11 +----------
> 1 file changed, 1 insertion(+), 10 deletions(-)
>
> diff --git a/package/lttng-modules/lttng-modules.mk b/package/lttng-modules/lttng-modules.mk
> index 6833ad2..30c581e 100644
> --- a/package/lttng-modules/lttng-modules.mk
> +++ b/package/lttng-modules/lttng-modules.mk
> @@ -10,14 +10,5 @@ LTTNG_MODULES_SOURCE = lttng-modules-$(LTTNG_MODULES_VERSION).tar.bz2
> LTTNG_MODULES_LICENSE = LGPLv2.1/GPLv2 for kernel modules; MIT for lib/bitfield.h and lib/prio_heap/*
> LTTNG_MODULES_LICENSE_FILES = lgpl-2.1.txt gpl-2.0.txt mit-license.txt LICENSE
>
> -LTTNG_MODULES_DEPENDENCIES = linux
> -
> -define LTTNG_MODULES_BUILD_CMDS
> - $(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KERNELDIR=$(LINUX_DIR)
> -endef
> -
> -define LTTNG_MODULES_INSTALL_TARGET_CMDS
> - $(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KERNELDIR=$(LINUX_DIR) modules_install
> -endef
> -
> +$(eval $(kernel-module))
> $(eval $(generic-package))
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind 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: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 33+ messages in thread
* [Buildroot] [PATCH 04/11 v2] package/igh-ethercat: use kernel-module helper
2015-06-10 19:22 [Buildroot] [PATCH 0/11 v2] pkg-kernel-module: new infra to ease building kernel modules (branch yem/kernel-modules) Yann E. MORIN
` (2 preceding siblings ...)
2015-06-10 19:22 ` [Buildroot] [PATCH 03/11 v2] package/lttng-modules: use kernel-module helper Yann E. MORIN
@ 2015-06-10 19:22 ` Yann E. MORIN
2015-06-11 22:51 ` Arnout Vandecappelle
2015-06-10 19:22 ` [Buildroot] [PATCH 05/11 v2] package/ktap: " Yann E. MORIN
` (7 subsequent siblings)
11 siblings, 1 reply; 33+ messages in thread
From: Yann E. MORIN @ 2015-06-10 19:22 UTC (permalink / raw)
To: buildroot
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
package/igh-ethercat/igh-ethercat.mk | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/package/igh-ethercat/igh-ethercat.mk b/package/igh-ethercat/igh-ethercat.mk
index b5221f8..32c49a3 100644
--- a/package/igh-ethercat/igh-ethercat.mk
+++ b/package/igh-ethercat/igh-ethercat.mk
@@ -10,7 +10,6 @@ IGH_ETHERCAT_SOURCE = ethercat-$(IGH_ETHERCAT_VERSION).tar.bz2
IGH_ETHERCAT_LICENSE = GPLv2 (IgH EtherCAT master), LGPLv2.1 (libraries)
IGH_ETHERCAT_LICENSE_FILES = COPYING COPYING.LESSER
-IGH_ETHERCAT_DEPENDENCIES = linux
IGH_ETHERCAT_INSTALL_STAGING = YES
IGH_ETHERCAT_CONF_OPTS = \
@@ -22,16 +21,5 @@ IGH_ETHERCAT_CONF_OPTS += $(if $(BR2_PACKAGE_IGH_ETHERCAT_E1000),--enable-e1000,
IGH_ETHERCAT_CONF_OPTS += $(if $(BR2_PACKAGE_IGH_ETHERCAT_E1000E),--enable-e1000e,--disable-e1000e)
IGH_ETHERCAT_CONF_OPTS += $(if $(BR2_PACKAGE_IGH_ETHERCAT_R8169),--enable-r8169,--disable-r8169)
-define IGH_ETHERCAT_BUILD_MODULES
- $(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) modules
-endef
-
-IGH_ETHERCAT_POST_BUILD_HOOKS += IGH_ETHERCAT_BUILD_MODULES
-
-define IGH_ETHERCAT_INSTALL_MODULES
- $(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) modules_install
-endef
-
-IGH_ETHERCAT_POST_INSTALL_TARGET_HOOKS += IGH_ETHERCAT_INSTALL_MODULES
-
+$(eval $(kernel-module))
$(eval $(autotools-package))
--
1.9.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [Buildroot] [PATCH 04/11 v2] package/igh-ethercat: use kernel-module helper
2015-06-10 19:22 ` [Buildroot] [PATCH 04/11 v2] package/igh-ethercat: " Yann E. MORIN
@ 2015-06-11 22:51 ` Arnout Vandecappelle
0 siblings, 0 replies; 33+ messages in thread
From: Arnout Vandecappelle @ 2015-06-11 22:51 UTC (permalink / raw)
To: buildroot
On 06/10/15 21:22, Yann E. MORIN wrote:
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Perhaps it would be better for changes like this to mention in the commit
message what the Makefile does. If there is a commit message like this, I trust
the patch a whole lot more:
igh-ethercat's Makefile has these rules, so our kernel-module helper does
exactly the same:
modules:
$(MAKE) -C "$(LINUX_SOURCE_DIR)" M="$(@D)" modules
modules_install:
$(MAKE) -C "$(LINUX_SOURCE_DIR)" M="$(@D)" \
INSTALL_MOD_DIR="$(INSTALL_MOD_DIR)" modules_install
(for convenience I replaced the full path with $(@D)).
Regards,
Arnout
> ---
> package/igh-ethercat/igh-ethercat.mk | 14 +-------------
> 1 file changed, 1 insertion(+), 13 deletions(-)
>
> diff --git a/package/igh-ethercat/igh-ethercat.mk b/package/igh-ethercat/igh-ethercat.mk
> index b5221f8..32c49a3 100644
> --- a/package/igh-ethercat/igh-ethercat.mk
> +++ b/package/igh-ethercat/igh-ethercat.mk
> @@ -10,7 +10,6 @@ IGH_ETHERCAT_SOURCE = ethercat-$(IGH_ETHERCAT_VERSION).tar.bz2
> IGH_ETHERCAT_LICENSE = GPLv2 (IgH EtherCAT master), LGPLv2.1 (libraries)
> IGH_ETHERCAT_LICENSE_FILES = COPYING COPYING.LESSER
>
> -IGH_ETHERCAT_DEPENDENCIES = linux
> IGH_ETHERCAT_INSTALL_STAGING = YES
>
> IGH_ETHERCAT_CONF_OPTS = \
> @@ -22,16 +21,5 @@ IGH_ETHERCAT_CONF_OPTS += $(if $(BR2_PACKAGE_IGH_ETHERCAT_E1000),--enable-e1000,
> IGH_ETHERCAT_CONF_OPTS += $(if $(BR2_PACKAGE_IGH_ETHERCAT_E1000E),--enable-e1000e,--disable-e1000e)
> IGH_ETHERCAT_CONF_OPTS += $(if $(BR2_PACKAGE_IGH_ETHERCAT_R8169),--enable-r8169,--disable-r8169)
>
> -define IGH_ETHERCAT_BUILD_MODULES
> - $(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) modules
> -endef
> -
> -IGH_ETHERCAT_POST_BUILD_HOOKS += IGH_ETHERCAT_BUILD_MODULES
> -
> -define IGH_ETHERCAT_INSTALL_MODULES
> - $(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) modules_install
> -endef
> -
> -IGH_ETHERCAT_POST_INSTALL_TARGET_HOOKS += IGH_ETHERCAT_INSTALL_MODULES
> -
> +$(eval $(kernel-module))
> $(eval $(autotools-package))
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind 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: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 33+ messages in thread
* [Buildroot] [PATCH 05/11 v2] package/ktap: use kernel-module helper
2015-06-10 19:22 [Buildroot] [PATCH 0/11 v2] pkg-kernel-module: new infra to ease building kernel modules (branch yem/kernel-modules) Yann E. MORIN
` (3 preceding siblings ...)
2015-06-10 19:22 ` [Buildroot] [PATCH 04/11 v2] package/igh-ethercat: " Yann E. MORIN
@ 2015-06-10 19:22 ` Yann E. MORIN
2015-06-11 22:53 ` Arnout Vandecappelle
2015-06-10 19:22 ` [Buildroot] [PATCH 06/11 v2] package/cryptodev-linux: use the " Yann E. MORIN
` (6 subsequent siblings)
11 siblings, 1 reply; 33+ messages in thread
From: Yann E. MORIN @ 2015-06-10 19:22 UTC (permalink / raw)
To: buildroot
Passing the KERNEL_SRC variable is no longer needed, since it was only
used to run commands like:
$(MAKE) -C $(KERNEL_SRC) M=$(PWD) modules
which is basically what the new kernel-module infra is now doing.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
Changes v1 -> v2;
- explain why we get rid of a variable (Thomas)
---
package/ktap/ktap.mk | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/package/ktap/ktap.mk b/package/ktap/ktap.mk
index 4a0e51c..966b51c 100644
--- a/package/ktap/ktap.mk
+++ b/package/ktap/ktap.mk
@@ -9,8 +9,6 @@ KTAP_SITE = $(call github,ktap,ktap,$(KTAP_VERSION))
KTAP_LICENSE = GPLv2
KTAP_LICENSE_FILES = LICENSE-GPL
-KTAP_DEPENDENCIES = linux
-
ifeq ($(BR2_PACKAGE_ELFUTILS),y)
KTAP_DEPENDENCIES += elfutils
else
@@ -19,12 +17,13 @@ endif
define KTAP_BUILD_CMDS
$(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) $(KTAP_FLAGS) ktap
- $(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KERNEL_SRC=$(LINUX_DIR) KVERSION=$(LINUX_VERSION_PROBED) mod
endef
define KTAP_INSTALL_TARGET_CMDS
$(INSTALL) -D -m755 $(@D)/ktap $(TARGET_DIR)/usr/bin/ktap
- $(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KERNEL_SRC=$(LINUX_DIR) KVERSION=$(LINUX_VERSION_PROBED) modules_install
endef
+KTAP_MODULE_MAKE_OPTS = KVERSION=$(LINUX_VERSION_PROBED)
+
+$(eval $(kernel-module))
$(eval $(generic-package))
--
1.9.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [Buildroot] [PATCH 05/11 v2] package/ktap: use kernel-module helper
2015-06-10 19:22 ` [Buildroot] [PATCH 05/11 v2] package/ktap: " Yann E. MORIN
@ 2015-06-11 22:53 ` Arnout Vandecappelle
0 siblings, 0 replies; 33+ messages in thread
From: Arnout Vandecappelle @ 2015-06-11 22:53 UTC (permalink / raw)
To: buildroot
On 06/10/15 21:22, Yann E. MORIN wrote:
> Passing the KERNEL_SRC variable is no longer needed, since it was only
> used to run commands like:
> $(MAKE) -C $(KERNEL_SRC) M=$(PWD) modules
>
> which is basically what the new kernel-module infra is now doing.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Regards,
Arnout
>
> ---
> Changes v1 -> v2;
> - explain why we get rid of a variable (Thomas)
> ---
> package/ktap/ktap.mk | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/package/ktap/ktap.mk b/package/ktap/ktap.mk
> index 4a0e51c..966b51c 100644
> --- a/package/ktap/ktap.mk
> +++ b/package/ktap/ktap.mk
> @@ -9,8 +9,6 @@ KTAP_SITE = $(call github,ktap,ktap,$(KTAP_VERSION))
> KTAP_LICENSE = GPLv2
> KTAP_LICENSE_FILES = LICENSE-GPL
>
> -KTAP_DEPENDENCIES = linux
> -
> ifeq ($(BR2_PACKAGE_ELFUTILS),y)
> KTAP_DEPENDENCIES += elfutils
> else
> @@ -19,12 +17,13 @@ endif
>
> define KTAP_BUILD_CMDS
> $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) $(KTAP_FLAGS) ktap
> - $(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KERNEL_SRC=$(LINUX_DIR) KVERSION=$(LINUX_VERSION_PROBED) mod
> endef
>
> define KTAP_INSTALL_TARGET_CMDS
> $(INSTALL) -D -m755 $(@D)/ktap $(TARGET_DIR)/usr/bin/ktap
> - $(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KERNEL_SRC=$(LINUX_DIR) KVERSION=$(LINUX_VERSION_PROBED) modules_install
> endef
>
> +KTAP_MODULE_MAKE_OPTS = KVERSION=$(LINUX_VERSION_PROBED)
> +
> +$(eval $(kernel-module))
> $(eval $(generic-package))
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind 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: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 33+ messages in thread
* [Buildroot] [PATCH 06/11 v2] package/cryptodev-linux: use the kernel-module helper
2015-06-10 19:22 [Buildroot] [PATCH 0/11 v2] pkg-kernel-module: new infra to ease building kernel modules (branch yem/kernel-modules) Yann E. MORIN
` (4 preceding siblings ...)
2015-06-10 19:22 ` [Buildroot] [PATCH 05/11 v2] package/ktap: " Yann E. MORIN
@ 2015-06-10 19:22 ` Yann E. MORIN
2015-06-11 23:02 ` Arnout Vandecappelle
2015-06-10 19:22 ` [Buildroot] [PATCH 07/11 v2] package/ocf-linux: use " Yann E. MORIN
` (5 subsequent siblings)
11 siblings, 1 reply; 33+ messages in thread
From: Yann E. MORIN @ 2015-06-10 19:22 UTC (permalink / raw)
To: buildroot
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
[Doug: add pre-build hook to build version.h]
Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
---
Cyhanges v1 -> v2:
- fix missing version.h (Doug)
---
package/cryptodev-linux/cryptodev-linux.mk | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/package/cryptodev-linux/cryptodev-linux.mk b/package/cryptodev-linux/cryptodev-linux.mk
index 6f41930..6eec602 100644
--- a/package/cryptodev-linux/cryptodev-linux.mk
+++ b/package/cryptodev-linux/cryptodev-linux.mk
@@ -6,23 +6,23 @@
CRYPTODEV_LINUX_VERSION = 1.7
CRYPTODEV_LINUX_SITE = http://download.gna.org/cryptodev-linux
-CRYPTODEV_LINUX_DEPENDENCIES = linux
CRYPTODEV_LINUX_INSTALL_STAGING = YES
CRYPTODEV_LINUX_LICENSE = GPLv2+
CRYPTODEV_LINUX_LICENSE_FILES = COPYING
-define CRYPTODEV_LINUX_BUILD_CMDS
- $(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KERNEL_DIR=$(LINUX_DIR)
+define CRYPTODEV_LINUX_VERSION_H
+ $(MAKE) -C $(@D) version.h
endef
+CRYPTODEV_LINUX_PRE_BUILD_HOOKS += CRYPTODEV_LINUX_VERSION_H
-define CRYPTODEV_LINUX_INSTALL_TARGET_CMDS
- $(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KERNEL_DIR=$(LINUX_DIR) \
- PREFIX=$(TARGET_DIR) modules_install
-endef
+CRYPTODEV_LINUX_MODULE_MAKE_OPTS = \
+ KERNEL_DIR=$(LINUX_DIR) \
+ PREFIX=$(TARGET_DIR)
define CRYPTODEV_LINUX_INSTALL_STAGING_CMDS
$(INSTALL) -D -m 644 $(@D)/crypto/cryptodev.h \
$(STAGING_DIR)/usr/include/crypto/cryptodev.h
endef
+$(eval $(kernel-module))
$(eval $(generic-package))
--
1.9.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [Buildroot] [PATCH 06/11 v2] package/cryptodev-linux: use the kernel-module helper
2015-06-10 19:22 ` [Buildroot] [PATCH 06/11 v2] package/cryptodev-linux: use the " Yann E. MORIN
@ 2015-06-11 23:02 ` Arnout Vandecappelle
2015-06-12 20:48 ` Yann E. MORIN
0 siblings, 1 reply; 33+ messages in thread
From: Arnout Vandecappelle @ 2015-06-11 23:02 UTC (permalink / raw)
To: buildroot
On 06/10/15 21:22, Yann E. MORIN wrote:
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> [Doug: add pre-build hook to build version.h]
The version.h thing deserves a slightly more explicit commit message, like:
The cryptodev-linux Makefile defines the following:
build: version.h
make ${KERNEL_MAKE_OPTS} modules
modules_install:
make -C $(KERNEL_DIR) SUBDIRS=`pwd` modules_install
@echo "Installing cryptodev.h in $(PREFIX)/usr/include/crypto ..."
@install -D crypto/cryptodev.h $(PREFIX)/usr/include/crypto/cryptodev.h
So when we use the kernel-module infrastructure, we have to explicitly handle
version.h and cryptodev.h. cryptodev.h was already handled specifically because
it goes to STAGING_DIR. For version.h, we add a pre-build hook.
That said, SUBDIRS= does not behave exactly the same as M=, but I don't know
what the difference is. So that part should probably be mentioned explicitly in
the commit message as well.
> Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
[snip]
> -define CRYPTODEV_LINUX_INSTALL_TARGET_CMDS
> - $(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KERNEL_DIR=$(LINUX_DIR) \
> - PREFIX=$(TARGET_DIR) modules_install
> -endef
> +CRYPTODEV_LINUX_MODULE_MAKE_OPTS = \
> + KERNEL_DIR=$(LINUX_DIR) \
> + PREFIX=$(TARGET_DIR)
PREFIX is only used for installing cryptodev.h, which is now no longer done. So
we don't need to define it, right? Same for KERNEL_DIR, it's only used by the
rules we no longer use.
If you remove these, it should of course also be mentioned explicitly in the
commit message.
Regards,
Arnout
>
> define CRYPTODEV_LINUX_INSTALL_STAGING_CMDS
> $(INSTALL) -D -m 644 $(@D)/crypto/cryptodev.h \
> $(STAGING_DIR)/usr/include/crypto/cryptodev.h
> endef
>
> +$(eval $(kernel-module))
> $(eval $(generic-package))
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind 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: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 33+ messages in thread
* [Buildroot] [PATCH 06/11 v2] package/cryptodev-linux: use the kernel-module helper
2015-06-11 23:02 ` Arnout Vandecappelle
@ 2015-06-12 20:48 ` Yann E. MORIN
0 siblings, 0 replies; 33+ messages in thread
From: Yann E. MORIN @ 2015-06-12 20:48 UTC (permalink / raw)
To: buildroot
Arnout, All,
On 2015-06-12 01:02 +0200, Arnout Vandecappelle spake thusly:
> On 06/10/15 21:22, Yann E. MORIN wrote:
> > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> > [Doug: add pre-build hook to build version.h]
>
> The version.h thing deserves a slightly more explicit commit message, like:
>
> The cryptodev-linux Makefile defines the following:
>
> build: version.h
> make ${KERNEL_MAKE_OPTS} modules
>
> modules_install:
> make -C $(KERNEL_DIR) SUBDIRS=`pwd` modules_install
> @echo "Installing cryptodev.h in $(PREFIX)/usr/include/crypto ..."
> @install -D crypto/cryptodev.h $(PREFIX)/usr/include/crypto/cryptodev.h
I'm not too fond of quoting that much, so I trimmed it down to what I
believe is the strict minimum for udnerstanding the change, no more.
If you still think that is not enough, you'll have the opportunity to
say so when I respin. OK? ;-)
> So when we use the kernel-module infrastructure, we have to explicitly handle
> version.h and cryptodev.h. cryptodev.h was already handled specifically because
> it goes to STAGING_DIR. For version.h, we add a pre-build hook.
>
>
> That said, SUBDIRS= does not behave exactly the same as M=, but I don't know
> what the difference is. So that part should probably be mentioned explicitly in
> the commit message as well.
From my understanding, the end result is the same, but using SUBDIRS
makes the Linux buildsystem it is building in in-tree module, while M
tells it it is building an out-of-tree module.
> > Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
>
> [snip]
> > -define CRYPTODEV_LINUX_INSTALL_TARGET_CMDS
> > - $(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KERNEL_DIR=$(LINUX_DIR) \
> > - PREFIX=$(TARGET_DIR) modules_install
> > -endef
> > +CRYPTODEV_LINUX_MODULE_MAKE_OPTS = \
> > + KERNEL_DIR=$(LINUX_DIR) \
> > + PREFIX=$(TARGET_DIR)
>
> PREFIX is only used for installing cryptodev.h, which is now no longer done. So
> we don't need to define it, right? Same for KERNEL_DIR, it's only used by the
> rules we no longer use.
>
> If you remove these, it should of course also be mentioned explicitly in the
> commit message.
Right, I've dropped both and explained in the commit log.
Thanks! :-)
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] 33+ messages in thread
* [Buildroot] [PATCH 07/11 v2] package/ocf-linux: use kernel-module helper
2015-06-10 19:22 [Buildroot] [PATCH 0/11 v2] pkg-kernel-module: new infra to ease building kernel modules (branch yem/kernel-modules) Yann E. MORIN
` (5 preceding siblings ...)
2015-06-10 19:22 ` [Buildroot] [PATCH 06/11 v2] package/cryptodev-linux: use the " Yann E. MORIN
@ 2015-06-10 19:22 ` Yann E. MORIN
2015-06-10 19:22 ` [Buildroot] [PATCH 08/11 v2] package/on2-8170-modules: " Yann E. MORIN
` (4 subsequent siblings)
11 siblings, 0 replies; 33+ messages in thread
From: Yann E. MORIN @ 2015-06-10 19:22 UTC (permalink / raw)
To: buildroot
Remove our patch since it is no longer needed.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
Changs v1 -> v2:
- fix spelling of the SUBDIRS variable
---
package/ocf-linux/0001-modules-cross.patch | 42 ------------------------------
package/ocf-linux/ocf-linux.mk | 17 +++++-------
2 files changed, 7 insertions(+), 52 deletions(-)
delete mode 100644 package/ocf-linux/0001-modules-cross.patch
diff --git a/package/ocf-linux/0001-modules-cross.patch b/package/ocf-linux/0001-modules-cross.patch
deleted file mode 100644
index f80ef06..0000000
--- a/package/ocf-linux/0001-modules-cross.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-Remove the OCF linux kernel extension instead opting to build ocf-linux
-modules out of tree.
-This is easier for users since no kernel config tweaking is required.
-On the downside the OCF drivers can't be used, but then all of the
-kernel crypto drivers are available to users via cryptosoft which is
-preferred.
-
-Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
-
-diff -Nura ocf-linux-20120127.orig/ocf/Makefile ocf-linux-20120127/ocf/Makefile
---- ocf-linux-20120127.orig/ocf/Makefile 2013-04-27 09:27:04.413911866 -0300
-+++ ocf-linux-20120127/ocf/Makefile 2013-04-27 09:27:31.131775576 -0300
-@@ -2,6 +2,7 @@
- -include $(ROOTDIR)/modules/.config
-
- OCF_OBJS = crypto.o criov.o
-+KDIR ?= /lib/modules/$(shell uname -r)/build
-
- ifdef CONFIG_OCF_RANDOMHARVEST
- OCF_OBJS += random.o
-@@ -78,20 +79,13 @@
- #
-
- ocf_make:
-- make -C /lib/modules/$(shell uname -r)/build M=`pwd` $(OCF_TARGET) CONFIG_OCF_OCF=m
-- make -C /lib/modules/$(shell uname -r)/build M=`pwd` $(OCF_TARGET) CONFIG_OCF_OCF=m CONFIG_OCF_CRYPTOSOFT=m
-- -make -C /lib/modules/$(shell uname -r)/build M=`pwd` $(OCF_TARGET) CONFIG_OCF_OCF=m CONFIG_OCF_BENCH=m
-- -make -C /lib/modules/$(shell uname -r)/build M=`pwd` $(OCF_TARGET) CONFIG_OCF_OCF=m CONFIG_OCF_OCFNULL=m
-- -make -C /lib/modules/$(shell uname -r)/build M=`pwd` $(OCF_TARGET) CONFIG_OCF_OCF=m CONFIG_OCF_HIFN=m
-+ make -C $(KDIR) M=`pwd` $(OCF_TARGET) CONFIG_OCF_OCF=m CONFIG_OCF_CRYPTOSOFT=m CONFIG_OCF_BENCH=m CONFIG_OCF_OCFNULL=m
-
- ocf_modules:
- $(MAKE) ocf_make OCF_TARGET=modules
-
- ocf_install:
- $(MAKE) ocf_make OCF_TARGET="modules modules_install"
-- depmod
-- mkdir -p /usr/include/crypto
-- cp cryptodev.h /usr/include/crypto/.
-
- #
- # generate full kernel patches for 2.4 and 2.6 kernels to make patching
diff --git a/package/ocf-linux/ocf-linux.mk b/package/ocf-linux/ocf-linux.mk
index 8ca5578..35968d5 100644
--- a/package/ocf-linux/ocf-linux.mk
+++ b/package/ocf-linux/ocf-linux.mk
@@ -6,22 +6,19 @@
OCF_LINUX_VERSION = 20120127
OCF_LINUX_SITE = http://downloads.sourceforge.net/project/ocf-linux/ocf-linux/$(OCF_LINUX_VERSION)
-OCF_LINUX_DEPENDENCIES = linux
OCF_LINUX_INSTALL_STAGING = YES
-define OCF_LINUX_BUILD_CMDS
- $(MAKE) -C $(@D)/ocf $(LINUX_MAKE_FLAGS) KDIR=$(LINUX_DIR) \
- ocf_modules
-endef
-
-define OCF_LINUX_INSTALL_TARGET_CMDS
- $(MAKE) -C $(@D)/ocf $(LINUX_MAKE_FLAGS) KDIR=$(LINUX_DIR) \
- ocf_install
-endef
+OCF_LINUX_MODULE_SUBDIRS = ocf
+OCF_LINUX_MODULE_MAKE_OPTS = \
+ CONFIG_OCF_OCF=m \
+ CONFIG_OCF_CRYPTOSOFT=m \
+ CONFIG_OCF_BENCH=m \
+ CONFIG_OCF_OCFNULL=m
define OCF_LINUX_INSTALL_STAGING_CMDS
$(INSTALL) -D -m 644 $(@D)/ocf/cryptodev.h \
$(STAGING_DIR)/usr/include/crypto/cryptodev.h
endef
+$(eval $(kernel-module))
$(eval $(generic-package))
--
1.9.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [Buildroot] [PATCH 08/11 v2] package/on2-8170-modules: use kernel-module helper
2015-06-10 19:22 [Buildroot] [PATCH 0/11 v2] pkg-kernel-module: new infra to ease building kernel modules (branch yem/kernel-modules) Yann E. MORIN
` (6 preceding siblings ...)
2015-06-10 19:22 ` [Buildroot] [PATCH 07/11 v2] package/ocf-linux: use " Yann E. MORIN
@ 2015-06-10 19:22 ` Yann E. MORIN
2015-06-11 23:04 ` Arnout Vandecappelle
2015-06-10 19:22 ` [Buildroot] [PATCH 09/11 v2] package/owl-linux: " Yann E. MORIN
` (3 subsequent siblings)
11 siblings, 1 reply; 33+ messages in thread
From: Yann E. MORIN @ 2015-06-10 19:22 UTC (permalink / raw)
To: buildroot
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
package/on2-8170-modules/on2-8170-modules.mk | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/package/on2-8170-modules/on2-8170-modules.mk b/package/on2-8170-modules/on2-8170-modules.mk
index 209bcb5..b40ed86 100644
--- a/package/on2-8170-modules/on2-8170-modules.mk
+++ b/package/on2-8170-modules/on2-8170-modules.mk
@@ -7,17 +7,8 @@
ON2_8170_MODULES_VERSION = 73b08061d30789178e692bc332b73d1d9922bf39
ON2_8170_MODULES_SITE = $(call github,alexandrebelloni,on2-8170-modules,$(ON2_8170_MODULES_VERSION))
-ON2_8170_MODULES_DEPENDENCIES = linux
-
ON2_8170_MODULES_LICENSE = GPLv2+
#There is no license file
-define ON2_8170_MODULES_BUILD_CMDS
- $(MAKE) -C $(LINUX_DIR) $(LINUX_MAKE_FLAGS) M=$(@D)
-endef
-
-define ON2_8170_MODULES_INSTALL_TARGET_CMDS
- $(MAKE) -C $(LINUX_DIR) $(LINUX_MAKE_FLAGS) M=$(@D) modules_install
-endef
-
+$(eval $(kernel-module))
$(eval $(generic-package))
--
1.9.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [Buildroot] [PATCH 08/11 v2] package/on2-8170-modules: use kernel-module helper
2015-06-10 19:22 ` [Buildroot] [PATCH 08/11 v2] package/on2-8170-modules: " Yann E. MORIN
@ 2015-06-11 23:04 ` Arnout Vandecappelle
0 siblings, 0 replies; 33+ messages in thread
From: Arnout Vandecappelle @ 2015-06-11 23:04 UTC (permalink / raw)
To: buildroot
On 06/10/15 21:22, Yann E. MORIN wrote:
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Regards,
Arnout
> ---
> package/on2-8170-modules/on2-8170-modules.mk | 11 +----------
> 1 file changed, 1 insertion(+), 10 deletions(-)
>
> diff --git a/package/on2-8170-modules/on2-8170-modules.mk b/package/on2-8170-modules/on2-8170-modules.mk
> index 209bcb5..b40ed86 100644
> --- a/package/on2-8170-modules/on2-8170-modules.mk
> +++ b/package/on2-8170-modules/on2-8170-modules.mk
> @@ -7,17 +7,8 @@
> ON2_8170_MODULES_VERSION = 73b08061d30789178e692bc332b73d1d9922bf39
> ON2_8170_MODULES_SITE = $(call github,alexandrebelloni,on2-8170-modules,$(ON2_8170_MODULES_VERSION))
>
> -ON2_8170_MODULES_DEPENDENCIES = linux
> -
> ON2_8170_MODULES_LICENSE = GPLv2+
> #There is no license file
>
> -define ON2_8170_MODULES_BUILD_CMDS
> - $(MAKE) -C $(LINUX_DIR) $(LINUX_MAKE_FLAGS) M=$(@D)
> -endef
> -
> -define ON2_8170_MODULES_INSTALL_TARGET_CMDS
> - $(MAKE) -C $(LINUX_DIR) $(LINUX_MAKE_FLAGS) M=$(@D) modules_install
> -endef
> -
> +$(eval $(kernel-module))
> $(eval $(generic-package))
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind 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: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 33+ messages in thread
* [Buildroot] [PATCH 09/11 v2] package/owl-linux: use kernel-module helper
2015-06-10 19:22 [Buildroot] [PATCH 0/11 v2] pkg-kernel-module: new infra to ease building kernel modules (branch yem/kernel-modules) Yann E. MORIN
` (7 preceding siblings ...)
2015-06-10 19:22 ` [Buildroot] [PATCH 08/11 v2] package/on2-8170-modules: " Yann E. MORIN
@ 2015-06-10 19:22 ` Yann E. MORIN
2015-06-11 23:13 ` Arnout Vandecappelle
2015-06-10 19:22 ` [Buildroot] [PATCH 10/11 v2] package/simicsfs: " Yann E. MORIN
` (2 subsequent siblings)
11 siblings, 1 reply; 33+ messages in thread
From: Yann E. MORIN @ 2015-06-10 19:22 UTC (permalink / raw)
To: buildroot
Git rid of first patch, no longer needed; rename remaining patch.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
Changes v1 -> v2:
- override $(PWD)
---
.../0001-fix-CROSS_COMPILE-usage-in-Makefile.patch | 16 ----------------
...-linux-3.3.x.patch => 0001-fix-for-linux-3.3.x.patch} | 0
package/owl-linux/owl-linux.mk | 15 ++++++---------
3 files changed, 6 insertions(+), 25 deletions(-)
delete mode 100644 package/owl-linux/0001-fix-CROSS_COMPILE-usage-in-Makefile.patch
rename package/owl-linux/{0002-fix-for-linux-3.3.x.patch => 0001-fix-for-linux-3.3.x.patch} (100%)
diff --git a/package/owl-linux/0001-fix-CROSS_COMPILE-usage-in-Makefile.patch b/package/owl-linux/0001-fix-CROSS_COMPILE-usage-in-Makefile.patch
deleted file mode 100644
index 14b4631..0000000
--- a/package/owl-linux/0001-fix-CROSS_COMPILE-usage-in-Makefile.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-Fix the owl-linux Makefile so that it protects spaces in the CROSS_COMPILE
-variable. For example, this variable will contain spaces if ccache is used.
-
-Signed-off-by: Simon Dawson <spdawson@gmail.com>
-diff -Nurp a/Makefile b/Makefile
---- a/Makefile 2012-06-14 10:51:45.000000000 +0100
-+++ b/Makefile 2012-07-20 10:46:41.636752148 +0100
-@@ -35,7 +35,7 @@ else
- PWD := $(shell pwd)
-
- default:
-- $(MAKE) -C $(KERNELDIR) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) M=$(PWD) MODE=$(MODE) modules
-+ $(MAKE) -C $(KERNELDIR) ARCH=$(ARCH) CROSS_COMPILE="$(CROSS_COMPILE)" M=$(PWD) MODE=$(MODE) modules
-
- clean:
- -rm -f *.o *.mod.c *.ko modules.order Module.symvers
diff --git a/package/owl-linux/0002-fix-for-linux-3.3.x.patch b/package/owl-linux/0001-fix-for-linux-3.3.x.patch
similarity index 100%
rename from package/owl-linux/0002-fix-for-linux-3.3.x.patch
rename to package/owl-linux/0001-fix-for-linux-3.3.x.patch
diff --git a/package/owl-linux/owl-linux.mk b/package/owl-linux/owl-linux.mk
index 371cc02..844b11e 100644
--- a/package/owl-linux/owl-linux.mk
+++ b/package/owl-linux/owl-linux.mk
@@ -10,14 +10,11 @@ OWL_LINUX_LICENSE = PROPRIETARY
OWL_LINUX_LICENSE_FILES = LICENSE
OWL_LINUX_REDISTRIBUTE = NO
-OWL_LINUX_DEPENDENCIES = linux
-
-define OWL_LINUX_BUILD_CMDS
- $(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KERNELDIR=$(LINUX_DIR)
-endef
-
-define OWL_LINUX_INSTALL_TARGET_CMDS
- $(MAKE) -C $(LINUX_DIR) $(LINUX_MAKE_FLAGS) M="$(@D)" modules_install
-endef
+# owl-linux wants to use $(PWD) to find its includes, however $(PWD) is not
+# the top of the package's source tree, but the top of Buildroot source tree
+# $(TOPDIR) (i.e. the place where make is run from).
+# So, override PWD to the proper value.
+OWL_LINUX_MODULE_MAKE_OPTS = PWD=$(@D)
+$(eval $(kernel-module))
$(eval $(generic-package))
--
1.9.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [Buildroot] [PATCH 09/11 v2] package/owl-linux: use kernel-module helper
2015-06-10 19:22 ` [Buildroot] [PATCH 09/11 v2] package/owl-linux: " Yann E. MORIN
@ 2015-06-11 23:13 ` Arnout Vandecappelle
2015-06-12 17:55 ` Yann E. MORIN
0 siblings, 1 reply; 33+ messages in thread
From: Arnout Vandecappelle @ 2015-06-11 23:13 UTC (permalink / raw)
To: buildroot
On 06/10/15 21:22, Yann E. MORIN wrote:
> Git rid of first patch, no longer needed; rename remaining patch.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
>
[snip]
> diff --git a/package/owl-linux/owl-linux.mk b/package/owl-linux/owl-linux.mk
> index 371cc02..844b11e 100644
> --- a/package/owl-linux/owl-linux.mk
> +++ b/package/owl-linux/owl-linux.mk
> @@ -10,14 +10,11 @@ OWL_LINUX_LICENSE = PROPRIETARY
> OWL_LINUX_LICENSE_FILES = LICENSE
> OWL_LINUX_REDISTRIBUTE = NO
>
> -OWL_LINUX_DEPENDENCIES = linux
> -
> -define OWL_LINUX_BUILD_CMDS
> - $(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KERNELDIR=$(LINUX_DIR)
> -endef
> -
> -define OWL_LINUX_INSTALL_TARGET_CMDS
> - $(MAKE) -C $(LINUX_DIR) $(LINUX_MAKE_FLAGS) M="$(@D)" modules_install
> -endef
> +# owl-linux wants to use $(PWD) to find its includes, however $(PWD) is not
> +# the top of the package's source tree, but the top of Buildroot source tree
Unless I'm very much mistaken, PWD will be $(LINUX_DIR) when the Makefile is
included.
With that small thing fixed:
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Regards,
Arnout
> +# $(TOPDIR) (i.e. the place where make is run from).
> +# So, override PWD to the proper value.
> +OWL_LINUX_MODULE_MAKE_OPTS = PWD=$(@D)
>
> +$(eval $(kernel-module))
> $(eval $(generic-package))
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind 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: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 33+ messages in thread
* [Buildroot] [PATCH 09/11 v2] package/owl-linux: use kernel-module helper
2015-06-11 23:13 ` Arnout Vandecappelle
@ 2015-06-12 17:55 ` Yann E. MORIN
2015-06-12 23:19 ` Arnout Vandecappelle
0 siblings, 1 reply; 33+ messages in thread
From: Yann E. MORIN @ 2015-06-12 17:55 UTC (permalink / raw)
To: buildroot
Arnout, All,
On 2015-06-12 01:13 +0200, Arnout Vandecappelle spake thusly:
> On 06/10/15 21:22, Yann E. MORIN wrote:
> > Git rid of first patch, no longer needed; rename remaining patch.
s/Git/Get/ Damn... :-]
> > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> >
> [snip]
> > diff --git a/package/owl-linux/owl-linux.mk b/package/owl-linux/owl-linux.mk
> > index 371cc02..844b11e 100644
> > --- a/package/owl-linux/owl-linux.mk
> > +++ b/package/owl-linux/owl-linux.mk
> > @@ -10,14 +10,11 @@ OWL_LINUX_LICENSE = PROPRIETARY
> > OWL_LINUX_LICENSE_FILES = LICENSE
> > OWL_LINUX_REDISTRIBUTE = NO
> >
> > -OWL_LINUX_DEPENDENCIES = linux
> > -
> > -define OWL_LINUX_BUILD_CMDS
> > - $(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KERNELDIR=$(LINUX_DIR)
> > -endef
> > -
> > -define OWL_LINUX_INSTALL_TARGET_CMDS
> > - $(MAKE) -C $(LINUX_DIR) $(LINUX_MAKE_FLAGS) M="$(@D)" modules_install
> > -endef
> > +# owl-linux wants to use $(PWD) to find its includes, however $(PWD) is not
> > +# the top of the package's source tree, but the top of Buildroot source tree
>
> Unless I'm very much mistaken, PWD will be $(LINUX_DIR) when the Makefile is
> included.
I think you are very much mistaken, indeed! ;-)
What happens is that all commands we run are run from Buildroot's
$(TOPDIR). So $(PWD) is set to that location.
So, this command, which we run from our Makefile:
make -C $(LINUX_DIR) M=$(@D) foo-bar
would get its $(PWD) make-variable set from whatever value it had in the
shell that called make, which happens to itself be called by Buildroot's
Makefile, which runs from $(TOPDIR), always (even for out-of-tree builds).
Then, the Linux buildsystem does *not* chdir() when it builds modules,
it just includes $(M)/Kbuild (or if it does not exist, $(M)/Makefile ),
so $(PWD) as used in those will still be Buildroot's $(TOPDIR).
> With that small thing fixed:
>
> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Still valid with that small thing *not* fixed? ;-)
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] 33+ messages in thread
* [Buildroot] [PATCH 09/11 v2] package/owl-linux: use kernel-module helper
2015-06-12 17:55 ` Yann E. MORIN
@ 2015-06-12 23:19 ` Arnout Vandecappelle
0 siblings, 0 replies; 33+ messages in thread
From: Arnout Vandecappelle @ 2015-06-12 23:19 UTC (permalink / raw)
To: buildroot
On 06/12/15 19:55, Yann E. MORIN wrote:
> Arnout, All,
>
> On 2015-06-12 01:13 +0200, Arnout Vandecappelle spake thusly:
>> On 06/10/15 21:22, Yann E. MORIN wrote:
>>> Git rid of first patch, no longer needed; rename remaining patch.
>
> s/Git/Get/ Damn... :-]
>
>>> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
>>>
>> [snip]
>>> diff --git a/package/owl-linux/owl-linux.mk b/package/owl-linux/owl-linux.mk
>>> index 371cc02..844b11e 100644
>>> --- a/package/owl-linux/owl-linux.mk
>>> +++ b/package/owl-linux/owl-linux.mk
>>> @@ -10,14 +10,11 @@ OWL_LINUX_LICENSE = PROPRIETARY
>>> OWL_LINUX_LICENSE_FILES = LICENSE
>>> OWL_LINUX_REDISTRIBUTE = NO
>>>
>>> -OWL_LINUX_DEPENDENCIES = linux
>>> -
>>> -define OWL_LINUX_BUILD_CMDS
>>> - $(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KERNELDIR=$(LINUX_DIR)
>>> -endef
>>> -
>>> -define OWL_LINUX_INSTALL_TARGET_CMDS
>>> - $(MAKE) -C $(LINUX_DIR) $(LINUX_MAKE_FLAGS) M="$(@D)" modules_install
>>> -endef
>>> +# owl-linux wants to use $(PWD) to find its includes, however $(PWD) is not
>>> +# the top of the package's source tree, but the top of Buildroot source tree
>>
>> Unless I'm very much mistaken, PWD will be $(LINUX_DIR) when the Makefile is
>> included.
>
> I think you are very much mistaken, indeed! ;-)
>
> What happens is that all commands we run are run from Buildroot's
> $(TOPDIR). So $(PWD) is set to that location.
>
> So, this command, which we run from our Makefile:
>
> make -C $(LINUX_DIR) M=$(@D) foo-bar
>
> would get its $(PWD) make-variable set from whatever value it had in the
> shell that called make, which happens to itself be called by Buildroot's
> Makefile, which runs from $(TOPDIR), always (even for out-of-tree builds).
Oh yes indeed, I missed the fact that the PWD := $(shell pwd) is only included
when it's *not* the kbuild call...
Crazy Makefile...
>
> Then, the Linux buildsystem does *not* chdir() when it builds modules,
> it just includes $(M)/Kbuild (or if it does not exist, $(M)/Makefile ),
> so $(PWD) as used in those will still be Buildroot's $(TOPDIR).
>
>> With that small thing fixed:
>>
>> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
>
> Still valid with that small thing *not* fixed? ;-)
Yep!
Regards,
Arnout
>
> Regards,
> Yann E. MORIN.
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind 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: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 33+ messages in thread
* [Buildroot] [PATCH 10/11 v2] package/simicsfs: use kernel-module helper
2015-06-10 19:22 [Buildroot] [PATCH 0/11 v2] pkg-kernel-module: new infra to ease building kernel modules (branch yem/kernel-modules) Yann E. MORIN
` (8 preceding siblings ...)
2015-06-10 19:22 ` [Buildroot] [PATCH 09/11 v2] package/owl-linux: " Yann E. MORIN
@ 2015-06-10 19:22 ` Yann E. MORIN
2015-06-11 23:13 ` Arnout Vandecappelle
2015-06-10 19:22 ` [Buildroot] [PATCH 11/11 v2] package/sysdig: " Yann E. MORIN
2015-06-11 18:03 ` [Buildroot] [PATCH 0/11 v2] pkg-kernel-module: new infra to ease building kernel modules (branch yem/kernel-modules) Yann E. MORIN
11 siblings, 1 reply; 33+ messages in thread
From: Yann E. MORIN @ 2015-06-10 19:22 UTC (permalink / raw)
To: buildroot
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
package/simicsfs/simicsfs.mk | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/package/simicsfs/simicsfs.mk b/package/simicsfs/simicsfs.mk
index 51987c5..91ed413 100644
--- a/package/simicsfs/simicsfs.mk
+++ b/package/simicsfs/simicsfs.mk
@@ -8,14 +8,6 @@ SIMICSFS_VERSION = 1.18
SIMICSFS_SITE = http://download.simics.net/pub
SIMICSFS_LICENSE = GPLv2+
SIMICSFS_LICENSE_FILES = hostfs.h
-SIMICSFS_DEPENDENCIES = linux
-
-define SIMICSFS_BUILD_CMDS
- $(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) M=$(@D) modules
-endef
-
-define SIMICSFS_INSTALL_TARGET_CMDS
- $(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) M=$(@D) INSTALL_MOD_PATH=$(TARGET_DIR) modules_install
-endef
+$(eval $(kernel-module))
$(eval $(generic-package))
--
1.9.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [Buildroot] [PATCH 10/11 v2] package/simicsfs: use kernel-module helper
2015-06-10 19:22 ` [Buildroot] [PATCH 10/11 v2] package/simicsfs: " Yann E. MORIN
@ 2015-06-11 23:13 ` Arnout Vandecappelle
0 siblings, 0 replies; 33+ messages in thread
From: Arnout Vandecappelle @ 2015-06-11 23:13 UTC (permalink / raw)
To: buildroot
On 06/10/15 21:22, Yann E. MORIN wrote:
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Regards,
Arnout
> ---
> package/simicsfs/simicsfs.mk | 10 +---------
> 1 file changed, 1 insertion(+), 9 deletions(-)
>
> diff --git a/package/simicsfs/simicsfs.mk b/package/simicsfs/simicsfs.mk
> index 51987c5..91ed413 100644
> --- a/package/simicsfs/simicsfs.mk
> +++ b/package/simicsfs/simicsfs.mk
> @@ -8,14 +8,6 @@ SIMICSFS_VERSION = 1.18
> SIMICSFS_SITE = http://download.simics.net/pub
> SIMICSFS_LICENSE = GPLv2+
> SIMICSFS_LICENSE_FILES = hostfs.h
> -SIMICSFS_DEPENDENCIES = linux
> -
> -define SIMICSFS_BUILD_CMDS
> - $(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) M=$(@D) modules
> -endef
> -
> -define SIMICSFS_INSTALL_TARGET_CMDS
> - $(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) M=$(@D) INSTALL_MOD_PATH=$(TARGET_DIR) modules_install
> -endef
>
> +$(eval $(kernel-module))
> $(eval $(generic-package))
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind 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: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 33+ messages in thread
* [Buildroot] [PATCH 11/11 v2] package/sysdig: use kernel-module helper
2015-06-10 19:22 [Buildroot] [PATCH 0/11 v2] pkg-kernel-module: new infra to ease building kernel modules (branch yem/kernel-modules) Yann E. MORIN
` (9 preceding siblings ...)
2015-06-10 19:22 ` [Buildroot] [PATCH 10/11 v2] package/simicsfs: " Yann E. MORIN
@ 2015-06-10 19:22 ` Yann E. MORIN
2015-06-11 18:03 ` [Buildroot] [PATCH 0/11 v2] pkg-kernel-module: new infra to ease building kernel modules (branch yem/kernel-modules) Yann E. MORIN
11 siblings, 0 replies; 33+ messages in thread
From: Yann E. MORIN @ 2015-06-10 19:22 UTC (permalink / raw)
To: buildroot
This has the benefit of making sysdig actually buildable, otherwise it
fails because it tries to use the kernel headers from the host:
make: *** /lib/modules/3.13.0-53-generic/build: No such file or directory. Stop.
make[5]: *** [all] Error 2
make[4]: *** [driver/CMakeFiles/driver] Error 2
make[3]: *** [driver/CMakeFiles/driver.dir/all] Error 2
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
package/sysdig/sysdig.mk | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/package/sysdig/sysdig.mk b/package/sysdig/sysdig.mk
index fb348ff..fde1810 100644
--- a/package/sysdig/sysdig.mk
+++ b/package/sysdig/sysdig.mk
@@ -10,13 +10,27 @@ SYSDIG_LICENSE = GPLv2
SYSDIG_LICENSE_FILES = COPYING
SYSDIG_CONF_OPTS = -DUSE_BUNDLED_LUAJIT=OFF -DUSE_BUNDLED_ZLIB=OFF \
-DUSE_BUNDLED_JSONCPP=OFF
-SYSDIG_DEPENDENCIES = zlib luajit jsoncpp linux
+SYSDIG_DEPENDENCIES = zlib luajit jsoncpp
SYSDIG_SUPPORTS_IN_SOURCE_BUILD = NO
-define SYSDIG_INSTALL_DRIVER
- $(MAKE) -C $(SYSDIG_BUILDDIR) $(LINUX_MAKE_FLAGS) KERNELDIR="$(LINUX_DIR)" install_driver
+# sysdig creates the module Makefile from a template, which contains a
+# single place-holder, KBUILD_FLAGS, wich is only replaced with two
+# things:
+# - debug flags, which we don't care about here,
+# - 'sysdig-feature' flags, which are never set, so always empty
+# So, just replace the place-holder with the only meaningful value: nothing.
+define SYSDIG_KERNEL_MAKEFILE
+ $(INSTALL) -m 0644 $(@D)/driver/Makefile.in $(@D)/driver/Makefile
+ $(SED) 's/@KBUILD_FLAGS@//;' $(@D)/driver/Makefile
endef
+SYSDIG_POST_PATCH_HOOKS += SYSDIG_KERNEL_MAKEFILE
-SYSDIG_POST_INSTALL_TARGET_HOOKS += SYSDIG_INSTALL_DRIVER
+# Don't build the driver as part of the 'standard' procedure, we'll
+# build it on our own with the kernel-module infra.
+SYSDIG_CONF_OPTS += -DBUILD_DRIVER=OFF
+SYSDIG_MODULE_SUBDIRS = driver
+SYSDIG_MODULE_MAKE_OPTS = KERNELDIR=$(LINUX_DIR)
+
+$(eval $(kernel-module))
$(eval $(cmake-package))
--
1.9.1
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [Buildroot] [PATCH 0/11 v2] pkg-kernel-module: new infra to ease building kernel modules (branch yem/kernel-modules)
2015-06-10 19:22 [Buildroot] [PATCH 0/11 v2] pkg-kernel-module: new infra to ease building kernel modules (branch yem/kernel-modules) Yann E. MORIN
` (10 preceding siblings ...)
2015-06-10 19:22 ` [Buildroot] [PATCH 11/11 v2] package/sysdig: " Yann E. MORIN
@ 2015-06-11 18:03 ` Yann E. MORIN
2015-06-11 23:18 ` Arnout Vandecappelle
11 siblings, 1 reply; 33+ messages in thread
From: Yann E. MORIN @ 2015-06-11 18:03 UTC (permalink / raw)
To: buildroot
Hello All,
On 2015-06-10 21:22 +0200, Yann E. MORIN spake thusly:
> This series introduces a new infrastructure to help writing packages
> that build kernel modules.
I'll mark this series as "Changes Requested" in patchwork, because I took
Jeremy's comment into account, and because I was able to improve it yet a
bit more and convert one more kernel-module-providing package (namely,
nvidia-driver; who would have thought it would be possible? ;-) ).
So, I'll respin later, but I'm still interested in reviews on this
iteration.
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] 33+ messages in thread
* [Buildroot] [PATCH 0/11 v2] pkg-kernel-module: new infra to ease building kernel modules (branch yem/kernel-modules)
2015-06-11 18:03 ` [Buildroot] [PATCH 0/11 v2] pkg-kernel-module: new infra to ease building kernel modules (branch yem/kernel-modules) Yann E. MORIN
@ 2015-06-11 23:18 ` Arnout Vandecappelle
2015-06-12 17:47 ` Yann E. MORIN
0 siblings, 1 reply; 33+ messages in thread
From: Arnout Vandecappelle @ 2015-06-11 23:18 UTC (permalink / raw)
To: buildroot
On 06/11/15 20:03, Yann E. MORIN wrote:
> Hello All,
>
> On 2015-06-10 21:22 +0200, Yann E. MORIN spake thusly:
>> This series introduces a new infrastructure to help writing packages
>> that build kernel modules.
>
> I'll mark this series as "Changes Requested" in patchwork, because I took
> Jeremy's comment into account, and because I was able to improve it yet a
> bit more and convert one more kernel-module-providing package (namely,
> nvidia-driver; who would have thought it would be possible? ;-) ).
Early feedback on that one:
NVIDIA_DRIVER_HEADERS_H -> NVIDIA_DRIVER_MODULE_BUILD_HEADERS
Commit message should explain why the custom install isn't needed anymore either.
Regards,
Arnout
>
> So, I'll respin later, but I'm still interested in reviews on this
> iteration.
>
> Regards,
> Yann E. MORIN.
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind 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: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 33+ messages in thread
* [Buildroot] [PATCH 0/11 v2] pkg-kernel-module: new infra to ease building kernel modules (branch yem/kernel-modules)
2015-06-11 23:18 ` Arnout Vandecappelle
@ 2015-06-12 17:47 ` Yann E. MORIN
0 siblings, 0 replies; 33+ messages in thread
From: Yann E. MORIN @ 2015-06-12 17:47 UTC (permalink / raw)
To: buildroot
Arnout, All,
On 2015-06-12 01:18 +0200, Arnout Vandecappelle spake thusly:
> On 06/11/15 20:03, Yann E. MORIN wrote:
> > Hello All,
> >
> > On 2015-06-10 21:22 +0200, Yann E. MORIN spake thusly:
> >> This series introduces a new infrastructure to help writing packages
> >> that build kernel modules.
> >
> > I'll mark this series as "Changes Requested" in patchwork, because I took
> > Jeremy's comment into account, and because I was able to improve it yet a
> > bit more and convert one more kernel-module-providing package (namely,
> > nvidia-driver; who would have thought it would be possible? ;-) ).
>
> Early feedback on that one:
>
> NVIDIA_DRIVER_HEADERS_H -> NVIDIA_DRIVER_MODULE_BUILD_HEADERS
OK.
> Commit message should explain why the custom install isn't needed anymore either.
OK.
Thanks! :-)
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] 33+ messages in thread