make passing env vars work across guest OS suites

lxc
devrandom 11 years ago
parent 6919e04de1
commit 79c1217cb1

@ -84,7 +84,7 @@ def build_one_configuration(suite, arch, build_desc, reference_datetime)
system! "on-target -u root apt-get update > var/install.log 2>&1"
info "Installing additional packages (log in var/install.log)"
system! "on-target -u root DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends -y install #{build_desc["packages"].join(" ")} > var/install.log 2>&1"
system! "on-target -u root -e DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends -y install #{build_desc["packages"].join(" ")} > var/install.log 2>&1"
info "Grabbing package manifest"
system! "on-target -u root bash < target-bin/grab-packages.sh > var/base-#{suitearch}.manifest"

@ -10,7 +10,8 @@ usage() {
echo
cat << EOF
--help display this help and exit
--user <username> run as <username> instead of ubuntu
--user|-u <username> run as <username> instead of ubuntu
--env|-e "NAME=VALUE ..." modify the environment
EOF
}
@ -25,6 +26,10 @@ if [ $# != 0 ] ; then
TUSER="$2"
shift 2
;;
--env|-e)
ENV="$2"
shift 2
;;
--*)
echo "unrecognized option $1"
exit 1
@ -45,9 +50,5 @@ if [ -z "$USE_LXC" ]; then
ssh -oConnectTimeout=30 -oNoHostAuthenticationForLocalhost=yes -i ${GITIAN_BASE:-.}/var/id_dsa -p $VM_SSH_PORT $TUSER@localhost $*
else
config-lxc
if [ $TUSER = "root" ]; then
sudo lxc-start -n gitian -f var/lxc.config -- sh -c "sudo -i -- $*"
else
sudo lxc-start -n gitian -f var/lxc.config -- sh -c "sudo -i -u $TUSER -- $*"
fi
sudo lxc-start -n gitian -f var/lxc.config -- sudo -u $TUSER $ENV -i -- $*
fi

Loading…
Cancel
Save