POC fonctionnel

This commit is contained in:
2017-02-09 21:53:24 +01:00
parent 38d236e09b
commit 2375dd6571
25 changed files with 279 additions and 470 deletions

View File

@ -1,14 +1,8 @@
#!/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
if [ "${ENGINE}" == 'chroot' ]; then
if [ "${TAMARIN_ACBUILD_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
@ -16,15 +10,15 @@ fi
sudo -E /usr/bin/env bash - <<EOF
export PATH=${PATH}
${TAMARIN_ACBUILD} run --engine "${ENGINE}" -- apt-get update
${TAMARIN_ACBUILD} run --engine "${ENGINE}" -- apt-get install --yes --no-install-recommends build-essential devscripts equivs
${TAMARIN_ACBUILD} run --engine "${TAMARIN_ACBUILD_ENGINE}" -- apt-get update
${TAMARIN_ACBUILD} run --engine "${TAMARIN_ACBUILD_ENGINE}" -- apt-get install --yes --no-install-recommends build-essential devscripts equivs python3
EOF
if [ "${ENGINE}" == 'chroot' ]; then
if [ "${TAMARIN_ACBUILD_ENGINE}" == 'chroot' ]; then
# Clean up Python fix (see above)
sudo -E /usr/bin/env bash - <<EOF
export PATH=${PATH}
${TAMARIN_ACBUILD} run --engine "${ENGINE}" -- rm -f /dev/urandom
${TAMARIN_ACBUILD} run --engine "${TAMARIN_ACBUILD_ENGINE}" -- rm -f /dev/urandom
EOF
fi