From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6600683098303627264 X-Received: by 2002:a50:89ca:: with SMTP id h10-v6mr2033080edh.11.1536841294561; Thu, 13 Sep 2018 05:21:34 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a50:f5e3:: with SMTP id x32-v6ls3513944edm.0.gmail; Thu, 13 Sep 2018 05:21:34 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZI4aiwwOMIZHGowy9nISI5C0gfT6UB7HmZ8mRKLseeHItGLtBqyxrug4yoroPFGZKc3tRq X-Received: by 2002:aa7:d5ca:: with SMTP id d10-v6mr2105089eds.2.1536841294193; Thu, 13 Sep 2018 05:21:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536841294; cv=none; d=google.com; s=arc-20160816; b=uljM3u0dePtqFbdreN+OfMem4FeXXaw5G/17vkUNlxWamBSDR+bE7VTia0OnpYekUJ m9uNRuBdT0uDjNbzsNeBRnJ0mgyBb5+44kp8XKhGjy6Juwqf+Y3F7wG5XTzQp/1rEuXp NIDQH1hn6VjAMbzUOru6NY+4WOxdW0dLfEivLI91LdhLuCPP/2jY/seTET5eb38ioCJK Easi+N2BVP/kd1rpbt8jmPiPU5RJD3DYr/OOIVf/AqZE+cxX7g5ym3toO/KY5pxtQ+HL cPWSEbxw8Fxxq4K0AbdPDqOBmLb6S6cDOTGgZgOiE93YtKH+tz3sAUVjmvFlDL8bBB9Z /TJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:message-id:date:subject:cc:to:from; bh=CD0oSZExg2pzTGfjxDTmEXXN1c4SRLfom85vgrr+kHo=; b=SAIN/k/FSgnFrklCWGWqqwTEJxQK3jZyqKrCOPyavVsuNKD5US5W/r7GcbuklPihj4 kOwP1T2CA6eR4gxvnx2DTBzVooJqlqetAzkz4liJIn1KubdGeWha6LX9E3MBnH08KYrz 3DfEpK0F5bRUoX8PuWob7K78MOYzDht1O95gr8iyzrrE7wAD8zFzOluedWBziKKAiBDF 64Uyr3YJ5sLwkA+zOTopxolzKJ1jjf0YSxWELNdff+AMh84XSmRHdRjSElxC8U/y+Ves fJ2hI5b5wxTKO2Lm72JoSkivKBpJHENoFOW0wk+QejBEbWUwvHZb8mObB2W6Ddp1oAY9 /h3A== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of cedric_hombourger@mentor.com designates 192.94.38.131 as permitted sender) smtp.mailfrom=Cedric_Hombourger@mentor.com Return-Path: Received: from relay1.mentorg.com (relay1.mentorg.com. [192.94.38.131]) by gmr-mx.google.com with ESMTPS id l37-v6si170147edb.5.2018.09.13.05.21.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Sep 2018 05:21:34 -0700 (PDT) Received-SPF: pass (google.com: domain of cedric_hombourger@mentor.com designates 192.94.38.131 as permitted sender) client-ip=192.94.38.131; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of cedric_hombourger@mentor.com designates 192.94.38.131 as permitted sender) smtp.mailfrom=Cedric_Hombourger@mentor.com Received: from nat-ies.mentorg.com ([192.94.31.2] helo=svr-ies-mbx-02.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1g0Qcl-0002GS-WE from Cedric_Hombourger@mentor.com for isar-users@googlegroups.com; Thu, 13 Sep 2018 05:21:32 -0700 Received: from FRG-W10-HOMBOUR.world.mentorg.com (137.202.0.90) by svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Thu, 13 Sep 2018 13:21:22 +0100 From: Cedric Hombourger To: CC: Cedric Hombourger Subject: [PATCH] isar-bootstrap: preserve environment in sudo'ed debootstrap call Date: Thu, 13 Sep 2018 14:20:58 +0200 Message-ID: <1536841258-161-1-git-send-email-Cedric_Hombourger@mentor.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) To svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) X-TUID: DFbwaLWtSgtq 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. Signed-off-by: Cedric Hombourger --- meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc index 4010307..a936e7f 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 \ -- 2.11.0