Question

I've successfully used the 'local site' method to include project specific code that is needed to be built for, and deployed to our target platform.

I need to build/maintain a tool that runs on the host whose job it is to package the kernel and filesystem for deployment to the device. I would like to use the local site method to maintain this code, but I'm not having much luck.

In xxxx.mk, I've specified:

XXXX_SITE_METHOD = local

and I'm using:

$(eval $(host-autotools-package))

However attempting to build with:

make host-xxxx

results in buildroot attempting to fetch a non existent tarball (where it would have rsynced the source for a non-host package).

Is this a supported configuration?

The contents of my xxxx.mk file is:

XXXX_VERSION= 1.0
XXXX_SITE = $(TOPDIR)/../apps.git/xxxx
XXXX_SITE_METHOD = local
$(eval $(host-autotools-package))

define XXX_EXTRACT_CMDS
        cp -r package/yyyy/xxxx/src/* $(@D)
endef
Was it helpful?

Solution

Aah, you're right, there is a bug. The below patch fixes it for me. That being said, if you have issues with Buildroot, you should rather report them on the project mailing list, or on the project bug tracker. We do not necessarily look very often at Stack Overflow for bug reports.

From 9cf6971b5e787375d418c4e34c10a89603e3e6e2 Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Date: Sat, 12 Oct 2013 12:10:13 +0200
Subject: [PATCH] package: fix 'local' site method for host packages

Using the 'local' site method works just fine for target
packages. However, for host packages, when HOST_<pkg>_SITE is
automatically defined by the package infrastructure to be equal to
<pkg>_SITE, when defining the <pkg>_OVERRIDE_SRCDIR, the $($(2)_SITE)
is empty, due to a missing additional dollar sign.

This patch ensures that the <pkg>_OVERRIDE_SRCDIR gets the correct
value, regardless of whether the HOST_<pkg>_SITE variable has been
defined by the package itself, or inferred by the package
infrastructure using the <pkg>_SITE value.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reported-by: http://stackoverflow.com/questions/19311747/buildroot-cant-use-local-site-method-for-custom-host-packages
---
 package/pkg-generic.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index a46457c..4bba4b5 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -281,7 +281,7 @@ endif

 ifeq ($$($(2)_SITE_METHOD),local)
 ifeq ($$($(2)_OVERRIDE_SRCDIR),)
-$(2)_OVERRIDE_SRCDIR = $($(2)_SITE)
+$(2)_OVERRIDE_SRCDIR = $$($(2)_SITE)
 endif
 endif

-- 
1.8.1.2
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top