From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6470427481174179840 X-Received: by 10.28.228.11 with SMTP id b11mr166134wmh.17.1506515355040; Wed, 27 Sep 2017 05:29:15 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.223.187.204 with SMTP id z12ls396877wrg.10.gmail; Wed, 27 Sep 2017 05:29:14 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAsBMMj1EZt5zgIpDCEujwafb0N4ZHcuDBaHX81BNhsRPGspyPkyQ1t2rOtp0mFgN1RIQZ+ X-Received: by 10.28.221.138 with SMTP id u132mr174141wmg.8.1506515354772; Wed, 27 Sep 2017 05:29:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506515354; cv=none; d=google.com; s=arc-20160816; b=n1RgIvLxztNeXUqTHdt9xDQcr09HbPYaUGv8LrRa1s++3A+6VPDJMrjrvh+u4ykM3C g+M5qmmP36ciOBKG3XeqP3/vt+7658CLW32bj8NSOTSor8MyzvDkCdfD07Zn0UBwaA6r XhIbCpXblWhV5mgVRyUHVKjol0m4iOoaki7vVXeb88ddMcdaujmfrRLq5JqsPl+Ev1uC sitmUVkS31jzOqJFjc4WHUhuraq28Ij1xQw5AlKH1Kyc4/fJnjXUBrpBcTwA5KYc7aEt CtSsOz9UOFSCRSmm34u48WCvcSsW0WQS2axBqfstcTFOZ6hhFkcLZeUjOL3x0aG7ZqDK cF6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:arc-authentication-results; bh=dk1P+pfKSnOu2L2yPUglVqJ1fUNG0QWFBXPvxaMPajk=; b=HUgu2aKvzvSbC5rqtOXfzN8+iEq+grQjmrUpSObw9tyoR3DOs+JUYl+ma0ZjUxj8jF uCYIO1yXn7BfxFqlJU+mKvbwTELE2Sgwh1OmrNN4LfHMHEU2WxXu7/RRF7VrjLPhG19v bkLpLwyF5Qpxv9CunBG46V3G3X+kKRWUDNgM1g42DnnGA6PreI7a05h3DxJCRe4pTL7K DboxSCubDm7gG8xrBBPWR47pmcOxPLpdmWzEblDvkOoHv2TKIndx0qsdZdkJORYqMYgo yshTTalQ+DP9gYrLn6lSElod0jW3lqL+2xqIVToBZCed+LO7pc/yzQ2V0evto0GQBkQ8 mWQg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 192.35.17.14 is neither permitted nor denied by best guess record for domain of henning.schild@siemens.com) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id t65si111344wmg.3.2017.09.27.05.29.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Sep 2017 05:29:14 -0700 (PDT) Received-SPF: neutral (google.com: 192.35.17.14 is neither permitted nor denied by best guess record for domain of henning.schild@siemens.com) client-ip=192.35.17.14; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 192.35.17.14 is neither permitted nor denied by best guess record for domain of henning.schild@siemens.com) smtp.mailfrom=henning.schild@siemens.com Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id v8RCTEtO007058 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 27 Sep 2017 14:29:14 +0200 Received: from md1em3qc ([139.25.68.40]) by mail2.siemens.de (8.15.2/8.15.2) with ESMTP id v8RCTEat021985; Wed, 27 Sep 2017 14:29:14 +0200 Date: Wed, 27 Sep 2017 14:29:13 +0200 From: Henning Schild To: "[ext] Andreas J. Reichel" Cc: , Subject: Re: [PATCH v2 1/1] Add proxy support to isar-image-*.bb and buildchroot.bb Message-ID: <20170927142913.0ceb4c2f@md1em3qc> In-Reply-To: <20170927120234.1541-2-andreas.reichel.ext@siemens.com> References: <20170927120234.1541-1-andreas.reichel.ext@siemens.com> <20170927120234.1541-2-andreas.reichel.ext@siemens.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: lRKLP60r+CPc Am Wed, 27 Sep 2017 14:02:18 +0200 schrieb "[ext] Andreas J. Reichel" : > From: Andreas Reichel > > * BB_ENV_EXTRAWHITE provides a list for variables that are kept in the > environment by bitbake. However, isar init script clears any > additional settings. Thus, add proxy variables to BB_ENV_EXTRAWHITE in > isar-buildenv-internal. > > * Bitbake clears environment variables for each task within a recipe. > However, bb.utils.export_proxies function can be used with an > inline-python call to reexport the proxy settings. > > * Sudo loses environment variables again, thus call multistrap with > sudo with the -E option to preserve (the already cleaned) environment > for the task's multistrap command. > > Note: > Downloads are normally done by the fetcher task, which calls a python > function that in turn uses bb.util.export_proxies. However we have a > non-fetcher task, which needs download capabilities as well. > > Signed-off-by: Andreas Reichel > --- > meta-isar/recipes-core/images/isar-image-base.bb | 5 ++++- > meta/recipes-devtools/buildchroot/buildchroot.bb | 4 +++- > scripts/isar-buildenv-internal | 2 +- > 3 files changed, 8 insertions(+), 3 deletions(-) > > diff --git a/meta-isar/recipes-core/images/isar-image-base.bb > b/meta-isar/recipes-core/images/isar-image-base.bb index > b679d97..96b5510 100644 --- > a/meta-isar/recipes-core/images/isar-image-base.bb +++ > b/meta-isar/recipes-core/images/isar-image-base.bb @@ -24,6 +24,8 @@ > IMAGE_ROOTFS = "${S}" do_rootfs[stamp-extra-info] = > "${MACHINE}-${DISTRO}" > do_rootfs() { > + E="${@ bb.utils.export_proxies(d)}" > + > install -d -m 755 ${WORKDIR}/hooks_multistrap > > # Copy config file > @@ -46,7 +48,8 @@ do_rootfs() { > cd ${TOPDIR} > > # Create root filesystem > - sudo multistrap -a ${DISTRO_ARCH} -d "${S}" -f > "${WORKDIR}/multistrap.conf" || true > + # We must use sudo -E here to preserve the environment because > of proxy settings > + sudo -E multistrap -a ${DISTRO_ARCH} -d "${S}" -f > "${WORKDIR}/multistrap.conf" || true > # Configure root filesystem > sudo chroot ${S} /configscript.sh ${MACHINE_SERIAL} > ${BAUDRATE_TTY} \ diff --git > a/meta/recipes-devtools/buildchroot/buildchroot.bb > b/meta/recipes-devtools/buildchroot/buildchroot.bb index > ccba683..e251a8f 100644 --- > a/meta/recipes-devtools/buildchroot/buildchroot.bb +++ > b/meta/recipes-devtools/buildchroot/buildchroot.bb @@ -26,6 +26,8 @@ > WORKDIR = "${TMPDIR}/work/${PF}/${DISTRO}" do_build[stamp-extra-info] > = "${DISTRO}-${DISTRO_ARCH}" do_build() { > + E="${@ bb.utils.export_proxies(d)}" > + > install -d -m 755 ${WORKDIR}/hooks_multistrap > > # Copy config files > @@ -48,7 +50,7 @@ do_build() { > cd ${TOPDIR} > > # Create root filesystem > - sudo multistrap -a ${DISTRO_ARCH} -d "${BUILDCHROOT_DIR}" -f > "${WORKDIR}/multistrap.conf" || true > + sudo -E multistrap -a ${DISTRO_ARCH} -d "${BUILDCHROOT_DIR}" -f > "${WORKDIR}/multistrap.conf" || true > # Install package builder script > sudo install -m 755 ${THISDIR}/files/build.sh ${BUILDCHROOT_DIR} In the first round i questioned the need for the "-E" in build.sh and configure.sh in buildchroot.bb. But now i think they both need the -E as well. One contains "apt-get install" and the other "apt-get update", one could question the update but the install might fetch and install more packages. I already raised that point for v2 and there was no answer, maybe that is why you patch did not make it to next yet. Henning > diff --git a/scripts/isar-buildenv-internal > b/scripts/isar-buildenv-internal index f14d1ff..94d7eb1 100755 > --- a/scripts/isar-buildenv-internal > +++ b/scripts/isar-buildenv-internal > @@ -66,5 +66,5 @@ export PATH > BBPATH="${BUILDDIR}" > export BBPATH > > -BB_ENV_EXTRAWHITE="BASEDIR BUILDDIR" > +BB_ENV_EXTRAWHITE="BASEDIR BUILDDIR http_proxy https_proxy ftp_proxy > no_proxy" export BB_ENV_EXTRAWHITE