From 2c1c152508da6d28aa0bce38e71d45bb2180dd1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89lo=C3=AFs?= <elois@ifee.fr> Date: Sun, 2 Sep 2018 20:24:52 +0000 Subject: [PATCH] Revert "add entry.sh" This reverts commit 5e02d2e517a5aa6318c0c5ce045bb79a9d3b67ef --- bootstrap.sh | 31 +++++++++++++++++++++++++++++++ entry.sh | 19 ------------------- 2 files changed, 31 insertions(+), 19 deletions(-) create mode 100644 bootstrap.sh delete mode 100644 entry.sh diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100644 index 0000000..9625508 --- /dev/null +++ b/bootstrap.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# Test environment +if [[ ! -d /builds ]]; then + echo "In order to use this image, you must mount the working directory to /builds" + exit 1 +fi +REFERENCE=$(ls -d /builds/* | head -1) +if [[ -z "${REFERENCE}" ]]; then + echo "Aborting because of empty working directory" + exit 1 +fi + +# Prepare environment +_durs_prepare() { + touch /durs/reference || exit 1 + chown --reference "${REFERENCE}" /durs/reference || exit 1 + chown -R durs:durs /builds/* || exit 1 +} + +# Terminate +_durs_terminate() { + chown -R --reference /durs/reference /builds/* || exit 1 + rm -f /durs/reference + exit ${1} +} + +# Prepare and execute building +_durs_prepare +su - durs +_durs_terminate $? diff --git a/entry.sh b/entry.sh deleted file mode 100644 index 0914919..0000000 --- a/entry.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -set -e - -export HOME=/tmp/home -mkdir -p $HOME - -# Initialize the wine prefix (virtual windows installation) -export WINEPREFIX=/tmp/wine -mkdir -p $WINEPREFIX -# FIXME: Make the wine prefix initialization faster -wineboot &> /dev/null - -# Put libstdc++ and some other mingw dlls in WINEPATH -# This must work for x86_64 and i686 -P1=$(dirname $(find /usr -name libwinpthread-1.dll)) -export WINEPATH="$(ls -d /usr/lib/gcc/*-w64-mingw32/*win32);$P1" - -exec "$@" -- GitLab