From 38d236e09bfe99525eb0bb5f2fc031b353a963b1 Mon Sep 17 00:00:00 2001 From: William Petit Date: Wed, 25 Jan 2017 14:49:30 +0100 Subject: [PATCH] Build de l'image de base + execution build.py dans le conteneur --- .../debian/install-build-essential | 29 +++++++++++++++++-- hooks/containerbuild/debian/install-git | 13 +++++++-- lib/build.py | 3 ++ lib/rkt.py | 2 +- lib/tamarin.py | 4 +++ package | 10 ++++--- 6 files changed, 52 insertions(+), 9 deletions(-) create mode 100644 lib/build.py diff --git a/hooks/containerbuild/debian/install-build-essential b/hooks/containerbuild/debian/install-build-essential index 766557a..0ac1731 100755 --- a/hooks/containerbuild/debian/install-build-essential +++ b/hooks/containerbuild/debian/install-build-essential @@ -1,6 +1,31 @@ #!/usr/bin/env bash +HAS_SYSTEMD=$(which systemctl) +ENGINE=chroot +if [ ! -z "${HAS_SYSTEMD}" ]; then + ENGINE=systemd-nspawn +fi + ${TAMARIN_ACBUILD} environment add DEBIAN_FRONTEND noninteractive -sudo -E ${TAMARIN_ACBUILD} run -- apt-get update -sudo -E ${TAMARIN_ACBUILD} run -- apt-get install --yes --no-install-recommends build-essential devscripts equivs + +if [ "${ENGINE}" == 'chroot' ]; then + # Ugly fix for Python installation in chrooted environment (require /dev/urandom) + head -c 65536 /dev/urandom > ./urandom + ${TAMARIN_ACBUILD} copy ./urandom /dev/urandom +fi + +sudo -E /usr/bin/env bash - <