From 63641aa2ce46ae8d3411d9447d87935fef3ee73f Mon Sep 17 00:00:00 2001 From: Derek Higgins Date: Fri, 16 Oct 2015 17:32:35 +0100 Subject: [PATCH] Preserve env when calling yum with sudo In particular we need [http|https]_proxy to be preserved. Change-Id: I5bcd1b1deac917a1be8d8155f1283e330e3d5862 --- elements/yum-minimal/root.d/08-yum-chroot | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/elements/yum-minimal/root.d/08-yum-chroot b/elements/yum-minimal/root.d/08-yum-chroot index 4a4e1eca..7330c71e 100755 --- a/elements/yum-minimal/root.d/08-yum-chroot +++ b/elements/yum-minimal/root.d/08-yum-chroot @@ -80,7 +80,7 @@ function _install_pkg_manager { sudo sed -i "s,/etc/pki/rpm-gpg,$TARGET_ROOT/etc/pki/rpm-gpg,g" \ $TARGET_ROOT/etc/yum.repos.d/*repo - sudo yum -y \ + sudo -E yum -y \ --setopt=cachedir=$YUM_CACHE/$ARCH/$DIB_RELEASE \ --setopt=reposdir=$TARGET_ROOT/etc/yum.repos.d \ --installroot $TARGET_ROOT \ @@ -121,8 +121,8 @@ else fi # bootstrap the environment within the chroot - sudo chroot $TARGET_ROOT ${YUM} makecache - sudo chroot $TARGET_ROOT ${YUM} -y \ + sudo -E chroot $TARGET_ROOT ${YUM} makecache + sudo -E chroot $TARGET_ROOT ${YUM} -y \ --setopt=cachedir=/tmp/yum/$ARCH/$DIB_RELEASE \ install passwd findutils sudo util-linux-ng