From patchwork Thu Sep 26 10:54:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: christian.braunersorensen@prevas.dk X-Patchwork-Id: 278157 X-Patchwork-Delegate: esben@haabendal.dk Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hugin.dotsrc.org (hugin.dotsrc.org [IPv6:2001:878:346::102]) by ozlabs.org (Postfix) with ESMTP id 268802C032F for ; Thu, 26 Sep 2013 20:54:39 +1000 (EST) Received: from hugin.dotsrc.org (localhost [127.0.0.1]) by hugin.dotsrc.org (Postfix) with ESMTP id D69C9447E4 for ; Thu, 26 Sep 2013 12:54:34 +0200 (CEST) X-Original-To: dev@oe-lite.org Delivered-To: dev@oe-lite.org Received: from mail02.prevas.se (mail02.prevas.se [62.95.78.10]) by hugin.dotsrc.org (Postfix) with ESMTPS id A92023FE01 for ; Thu, 26 Sep 2013 12:54:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=prevas.dk; i=@prevas.dk; l=1672; q=dns/txt; s=ironport2; t=1380192872; x=1411728872; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Q30BensVCNt4IQfLsTCjeTy6IqLBPc7EvfJkeDmafyI=; b=p6/xAyQI5l7+iurQzwLQjBRrhu1rTog4U/D8ktaFqgr5nRcojHfm5B4D rBTQO4if7cHZ3dVwyLG/OvzskRcyP44aa4SxpAN7FJG8YgYq1icNVEirj 0PA1Z/KCHZ9i6Lkn6reVHlgGutv761VsUKfEvgcSQmrOc/c7qrwInYpgA s=; X-IronPort-AV: E=Sophos;i="4.90,984,1371074400"; d="scan'208";a="3661796" Received: from vmprevas3.prevas.se (HELO smtp.prevas.se) ([172.16.8.103]) by ironport2.prevas.se with ESMTP/TLS/AES128-SHA; 26 Sep 2013 12:54:32 +0200 Received: from localhost (172.16.10.102) by smtp.prevas.se (172.16.8.105) with Microsoft SMTP Server id 14.2.347.0; Thu, 26 Sep 2013 12:54:32 +0200 Received: by localhost (Postfix, from userid 30007) id 5CD8D682C0C; Thu, 26 Sep 2013 10:54:32 +0000 (UTC) From: To: Subject: [PATCH 2/2] class/barebox: Add option of custom environment for barebox Date: Thu, 26 Sep 2013 10:54:31 +0000 Message-ID: X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: dev@oe-lite.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: OE-lite development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dev-bounces@oe-lite.org Errors-To: dev-bounces@oe-lite.org From: Christian Sørensen Added use flag barebox_custom_env, which may be set to a provider of a tarball containing the custom environment. The tarball must be named: barebox-env.tar. Furthermore, besides setting the barebox_custom_env use flag, one may place two files in SRCDIR (config / init) using file input to use that those as environment. Signed-off-by: Christian Sørensen --- classes/barebox.oeclass | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/classes/barebox.oeclass b/classes/barebox.oeclass index cb8a7f1..9d1d3d0 100644 --- a/classes/barebox.oeclass +++ b/classes/barebox.oeclass @@ -50,6 +50,28 @@ do_configure() { else die "No default configuration available" fi + +} + +BAREBOX_CUSTOM_ENV_TAR_FILE = "barebox-env.tar" +CLASS_FLAGS += "barebox_custom_env" +CLASS_DEPENDS:>USE_barebox_custom_env = "${USE_barebox_custom_env}" + +do_configure[postfuncs] += "do_configure_custom_env" +do_configure_custom_env () { + if [ -f ${HOST_SYSROOT}/${BAREBOX_CUSTOM_ENV_TAR_FILE} ]; then + mkdir -p ${S}/customenv + tar -xf ${HOST_SYSROOT}/${BAREBOX_CUSTOM_ENV_TAR_FILE} \ + -C ${S}/customenv/ --strip-components=1 + sed -i -e 's/\(CONFIG_DEFAULT_ENVIRONMENT_PATH=\).*/\1"customenv"/' \ + .config + elif [ -f ${SRCDIR}/init ] && [ -f ${SRCDIR}/config ]; then + mkdir -p ${S}/customenv/bin + cp ${SRCDIR}/init ${S}/customenv/bin/ + cp ${SRCDIR}/config ${S}/customenv/ + sed -i -e 's/\(CONFIG_DEFAULT_ENVIRONMENT_PATH=\).*/\1"customenv"/' \ + .config + fi } do_compile () {