From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6600683098303627264 X-Received: by 2002:a1c:5d4c:: with SMTP id r73-v6mr701323wmb.26.1536844166238; Thu, 13 Sep 2018 06:09:26 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:9a57:: with SMTP id z81-v6ls1785062wrb.11.gmail; Thu, 13 Sep 2018 06:09:25 -0700 (PDT) X-Google-Smtp-Source: ANB0VdayM1dVkZQdqJGYAvdGS/aZgCpEKDikjUJUa2Hzl/TiN9SjIIRq9SvVVBn9WMrqzfFzji9y X-Received: by 2002:adf:d08b:: with SMTP id y11-v6mr663397wrh.7.1536844165699; Thu, 13 Sep 2018 06:09:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536844165; cv=none; d=google.com; s=arc-20160816; b=Ck3GxciLniPJX0fFIoipxcpVqQ4ljxqO/0C4c96yUkCg0mmBeocafgNM/SsVrcHMK7 VJId6IGs39kxPqF211G95Felhd085YaD0koKIGLAC7frWR+R8wgxPsjT1nVgkXkAKyvm MjNdfmN2gQ8dFsrSYPi+HUmyAHwZzdIUzznFvOSUPxecVMtgNnvdkql9ecWX/Tg4BPAf 09XfXvl0A8ha4RGk0HpKDJOKlc4UmJUsoEJ2OXohLT5dr8Cv6/nhQ+7qmLWaCZKQvotV VUw/avYPmwAI4505uFyRzZsI4tkokj4QKYFAaVYpF2JsjkmYzSgi4IOOZX8S+R+KRT5g KLeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject; bh=l1mK1PKTHDBm9aviPjxEiQ+plEy+58zqFztTCKNrr1g=; b=kSBRX2aJDZ1dDFb0H+zgB8B7r1LyUqI9vxZYEgMsoI/USdxkdTRzD2O1gK1V8VXcBO aVlc5rkqKju84R/T5SQsO//TlgMhL5GR7aFn2eCqMt4ivWbRI+/nqihbThlo6+7W0i+d Cg3w7waehGQ0G3wwzGVz1UTGG/Moc0o6GuUbUyjZ43ggy9SzAdFl0MwHaNO4g39vJcuu NtLWZlGyROnvkl+WAVWGYnl+jy883x/PnUV9oC95VIEn7kE9Pq2+VetNV4hUAqdLqh4j QqeaLDthO1Ro0EGb2gnyog16JXoIqpXrtef+VZWo/bAvJoIz+rqqtsEwm9lRwNTatMGv rXXg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Return-Path: Received: from lizzard.sbs.de (lizzard.sbs.de. [194.138.37.39]) by gmr-mx.google.com with ESMTPS id y139-v6si77668wmc.3.2018.09.13.06.09.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Sep 2018 06:09:25 -0700 (PDT) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.39 as permitted sender) client-ip=194.138.37.39; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by lizzard.sbs.de (8.15.2/8.15.2) with ESMTPS id w8DD9Phl007050 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Sep 2018 15:09:25 +0200 Received: from [139.22.36.75] ([139.22.36.75]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id w8DD9Om8015325; Thu, 13 Sep 2018 15:09:24 +0200 Subject: Re: [PATCH v2] isar-bootstrap: preserve environment in sudo'ed debootstrap call To: Cedric Hombourger , isar-users@googlegroups.com References: <1536842780-221-1-git-send-email-Cedric_Hombourger@mentor.com> From: Jan Kiszka Message-ID: <838acea7-e98d-6f48-8497-d3c13871a8c8@siemens.com> Date: Thu, 13 Sep 2018 15:09:23 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: <1536842780-221-1-git-send-email-Cedric_Hombourger@mentor.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: pZ+TzW9Abufc Hi Cedric, On 13.09.18 14:46, Cedric Hombourger wrote: > Make bitbake add proxy environment variables and preserve them when > calling debootstrap under sudo. This is required to get user-defined > proxies used while bootstraping Isar. Can you specify the error scenario a bit more precisely? We are building with user-defined proxies frequently, and we do not need that change. While I have no problem with saving one line of code, I would be good to understand the setup, specifically as I requested to set up a proxies test scenario in the upstream Q&A to avoid relying on the Siemens-internal Q&A here. Thanks, Jan > > Signed-off-by: Cedric Hombourger > --- > meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc > index 4010307..cfad136 100644 > --- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc > +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc > @@ -171,7 +171,8 @@ isar_bootstrap() { > esac > shift > done > - sudo flock "${ISAR_BOOTSTRAP_LOCK}" -c "\ > + E="${@bb.utils.export_proxies(d)}" > + sudo -E flock "${ISAR_BOOTSTRAP_LOCK}" -c "\ > set -e > if [ ! -e "${DEPLOY_ISAR_BOOTSTRAP}" ]; then > if [ -e "${ROOTFSDIR}" ]; then > @@ -179,7 +180,6 @@ isar_bootstrap() { > umount -l "${ROOTFSDIR}/proc" || true > rm -rf "${ROOTFSDIR}" > fi > - E="${@bb.utils.export_proxies(d)}" > if [ ${IS_HOST} ]; then > ${DEBOOTSTRAP} --verbose \ > --variant=minbase \ > @@ -233,7 +233,6 @@ isar_bootstrap() { > mount -t devtmpfs -o mode=0755,nosuid devtmpfs ${ROOTFSDIR}/dev > mount -t proc none ${ROOTFSDIR}/proc > > - E="${@bb.utils.export_proxies(d)}" > export DEBIAN_FRONTEND=noninteractive > chroot "${ROOTFSDIR}" /usr/bin/apt-get update -y > chroot "${ROOTFSDIR}" /usr/bin/apt-get dist-upgrade -y \ > -- Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux