On Sat, May 21, 2011 at 01:27:13AM -0400, Jon Ringle wrote: > By using lndir, the .ko files are kept separate from the src directory > and building multiple architectures can be supported > > Signed-off-by: Jon Ringle <[email protected]> > --- > rules/templates/template-src-linux-driver-in | 1 + > rules/templates/template-src-linux-driver-make | 39 > ++++++++++++++++-------- > 2 files changed, 27 insertions(+), 13 deletions(-) > > diff --git a/rules/templates/template-src-linux-driver-in > b/rules/templates/template-src-linux-driver-in > index 7cb61c8..6edb6bc 100644 > --- a/rules/templates/template-src-linux-driver-in > +++ b/rules/templates/template-src-linux-driver-in > @@ -3,6 +3,7 @@ > config @PACKAGE@ > tristate > select KERNEL > + select HOST_LNDIR
This is not sufficient. The dependency is created for prepare not extract. I think dgen must generate something like this: ifneq ($(findstring lndir://,$(<PKG>_URL)),) $(STATEDIR)/<pkg>.extract: $(STATEDIR)/<lndir>.install endif and lndir must default to 'y' and lndir.make must have: LAZY_PACKAGES-$(PTXCONF_HOST_LNDIR) += lndir Or something like this. > prompt "@package@" > help > FIXME > diff --git a/rules/templates/template-src-linux-driver-make > b/rules/templates/template-src-linux-driver-make > index 6d6b385..dfe35eb 100644 > --- a/rules/templates/template-src-linux-driver-make > +++ b/rules/templates/template-src-linux-driver-make > @@ -18,7 +18,7 @@ PACKAGES-$(PTXCONF_@PACKAGE@) += @package@ > # > @PACKAGE@_VERSION := @VERSION@ > @PACKAGE@ := @package@-$(@PACKAGE@_VERSION) > -@PACKAGE@_SRCDIR := $(PTXDIST_WORKSPACE)/local_src/$(@PACKAGE@) > +@PACKAGE@_URL := > lndir://$(PTXDIST_WORKSPACE)/local_src/$(@PACKAGE@) > @PACKAGE@_DIR := $(BUILDDIR)/$(@PACKAGE@) > @PACKAGE@_LICENSE := unknown > > @@ -48,14 +48,7 @@ $(STATEDIR)/@[email protected]: > > $(STATEDIR)/@[email protected]: > @$(call targetinfo) > -# # The kernel cannot build an out-of-tree driver out-of-tree :-) > -# # So we make a local copy. > - rm -fr $(@PACKAGE@_DIR) > - cp -a $(@PACKAGE@_SRCDIR) $(@PACKAGE@_DIR) > - $(KERNEL_PATH) $(KERNEL_ENV) $(MAKE) $(KERNEL_MAKEVARS) \ > - -C $(KERNEL_DIR) \ > - M=$(@PACKAGE@_DIR) \ > - modules > + cd $(@PACKAGE@_DIR) && $(KERNEL_PATH) $(KERNEL_ENV) $(MAKE) > $(KERNEL_MAKEVARS) You're changing a lot of unrelated stuff here, why? > @$(call touch) > > # > ---------------------------------------------------------------------------- > @@ -64,6 +57,11 @@ $(STATEDIR)/@[email protected]: > > $(STATEDIR)/@[email protected]: > @$(call targetinfo) > + @$(call clean, $(@PACKAGE@_PKGDIR)) > + cd $(@PACKAGE@_DIR) && $(KERNEL_PATH) $(KERNEL_ENV) $(MAKE) \ > + $(filter-out INSTALL_MOD_PATH=%,$(KERNEL_MAKEVARS)) \ > + INSTALL_MOD_PATH=$(@PACKAGE@_PKGDIR) \ > + modules_install > @$(call touch) > > # > ---------------------------------------------------------------------------- > @@ -72,10 +70,25 @@ $(STATEDIR)/@[email protected]: > > $(STATEDIR)/@[email protected]: > @$(call targetinfo) > - $(KERNEL_PATH) $(KERNEL_ENV) $(MAKE) $(KERNEL_MAKEVARS) \ > - -C $(KERNEL_DIR) \ > - M=$(@PACKAGE@_DIR) \ > - modules_install > + @$(call install_init, @package@) > + @$(call install_fixup, @package@, PACKAGE, @package@) > + @$(call install_fixup, @package@, PRIORITY, optional) > + @$(call install_fixup, @package@, VERSION, $(@PACKAGE@_VERSION)) > + @$(call install_fixup, @package@, SECTION, base) > + @$(call install_fixup, @package@, AUTHOR, "@AUTHOR@") > + @$(call install_fixup, @package@, DEPENDS,) > + @$(call install_fixup, @package@, DESCRIPTION, missing) > + > + @cd $(@PACKAGE@_PKGDIR) && \ > + find lib -type d | while read dir; do \ > + $(call install_copy, @package@, 0, 0, 0755, /$${dir}); \ > + done > + > + @cd $(@PACKAGE@_PKGDIR) && \ > + find lib -name "*.ko" | while read file; do \ > + $(call install_copy, @package@, 0, 0, 0644, -, /$${file}, k); \ > + done This is broken. All external kernel modules are currently installed with the kernel, so we can run depmod before packaging everything. Also: you're missing the install_finish call. Michael > + > @$(call touch) > > # > ---------------------------------------------------------------------------- > -- > 1.7.0.4 > > > -- > ptxdist mailing list > [email protected] > -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- ptxdist mailing list [email protected]
