Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 8B8BCE00CF2; Tue, 22 Nov 2016 09:56:20 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no * trust * [74.125.83.46 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Received: from mail-pg0-f46.google.com (mail-pg0-f46.google.com [74.125.83.46]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 2BA03E00CD8 for ; Tue, 22 Nov 2016 09:56:05 -0800 (PST) Received: by mail-pg0-f46.google.com with SMTP id f188so9765433pgc.3 for ; Tue, 22 Nov 2016 09:56:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=P+fRGImy3BPdNyu4uE2+K9mSqWGRbhwClSfFByk1kyw=; b=ssivKUtnKNZD3E4rmwgnJF2Yjskx/Yj2siZPb0Ih/+ufMJi/n+uL6MjvgAPLINWehG i7c/+XIK6QtIaXuJnCE56Q4hlV4mMo4lVAnFiZnPeWdM+PESam90BNficWNygIEyhslM EZ5R1FpSQ1omEioys6i+cL74NvtPYTOMsZdGCzcD7qrVXb3P0NU7NQtPNRptbEXwxoru 4vqGlTxEflRlW6lHfIQchz+Ml9mS2ONcoK9+WJzB37H9mwCB/9bqqL1OD+0fwBCo7B0m pi75T34QKkdWxxyAGQKfJIdcAwo7Q9L7KaGjFLpqf1Cx7G+IvJwcWpRXoI3qmcOitbh5 upDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=P+fRGImy3BPdNyu4uE2+K9mSqWGRbhwClSfFByk1kyw=; b=FSTGfUiOzb/4N0y/bhP1l+JIBZlKdDUKZgzvp2SdLHsBMy90DYbOdDimqaDBxHGja7 xLJD/ohfulI1heS3GCGZ8zq6DjX/u2NvQtZ9wAxHcSJAS5P4tEZ7hS0YhSwRrhbEyjaM QlwK12Jij7eHlNMA6NqVNqFLa2UDfWPr6+f0D+tHtcI0IxC19oxF8ReLXr0/vidufc9k ie+/t3c/qODaAgfkEtWXGPSnUaWfNewM/NpjYrrmeCbfXUadTIqHSpsVxTJgtEaApFez H7ICuHnOAM08x7uWPh4CSQQYnnGLQxNdJX5uofnzu92TgJCzYFn/T7Z21w3AQp1kwQyh Byqg== X-Gm-Message-State: AKaTC03HuDSA41rG0mJYoOolkvLeg139qnrDvB44p8K4NrVXOgoJXUrSwyQIFCbaYBmucCgO X-Received: by 10.98.64.10 with SMTP id n10mr26875384pfa.168.1479837365378; Tue, 22 Nov 2016 09:56:05 -0800 (PST) Received: from orion.ger.corp.intel.com ([192.55.54.42]) by smtp.gmail.com with ESMTPSA id y6sm28758504pge.27.2016.11.22.09.56.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Nov 2016 09:56:04 -0800 (PST) From: Michael Wood To: toaster@yoctoproject.org Date: Tue, 22 Nov 2016 17:55:30 +0000 Message-Id: <1479837338-15969-11-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1479837338-15969-1-git-send-email-michael.g.wood@intel.com> References: <1479837338-15969-1-git-send-email-michael.g.wood@intel.com> Subject: [PATCH 10/18] toaster: localhostbecontroller accept custom init script for build X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2016 17:56:20 -0000 From: Sujith H When passed variable CUSTOM_BUILD_INIT_SCRIPT to toaster setting, it would be nice to use it. Else toaster can use oe-init script. This gives an oppurtunity to use customized build init scritps. Signed-off-by: Sujith H --- bitbake/lib/toaster/bldcontrol/localhostbecontroller.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py index e5f7c98..3896a82 100644 --- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py +++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py @@ -27,7 +27,7 @@ import shutil from django.db import transaction from django.db.models import Q from bldcontrol.models import BuildEnvironment, BRLayer, BRVariable, BRTarget, BRBitbake -from orm.models import CustomImageRecipe, Layer, Layer_Version, ProjectLayer +from orm.models import CustomImageRecipe, Layer, Layer_Version, ProjectLayer, ToasterSetting import subprocess from toastermain import settings @@ -277,7 +277,12 @@ class LocalhostBEController(BuildEnvironmentController): builddir = '%s-toaster-%d' % (self.be.builddir, bitbake.req.project.id) oe_init = os.path.join(self.pokydirname, 'oe-init-build-env') # init build environment - self._shellcmd("bash -c 'source %s %s'" % (oe_init, builddir), + try: + custom_script = ToasterSetting.objects.get(name="CUSTOM_BUILD_INIT_SCRIPT").value + custom_script = custom_script.replace("%BUILDDIR%" ,builddir) + self._shellcmd("bash -c 'source %s'" % (custom_script)) + except ToasterSetting.DoesNotExist: + self._shellcmd("bash -c 'source %s %s'" % (oe_init, builddir), self.be.sourcedir) # update bblayers.conf -- 2.7.4