Просмотр исходного кода

make passing env vars work across guest OS suites

tags/0.1
devrandom 7 лет назад
Родитель
Сommit
79c1217cb1
2 измененных файлов: 8 добавлений и 7 удалений
  1. 1
    1
      bin/gbuild
  2. 7
    6
      libexec/on-target

+ 1
- 1
bin/gbuild Просмотреть файл

@@ -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"

+ 7
- 6
libexec/on-target Просмотреть файл

@@ -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

Загрузка…
Отмена
Сохранить