aboutsummaryrefslogtreecommitdiffstats
path: root/INSTALL/setup_image.sh
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-12-21 13:36:55 +0100
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-12-21 13:36:55 +0100
commitea4456d177759676dae5f812b0c528263e46e1e3 (patch)
treee6f642ff5ddc1e049f4fe37c69c29a4bf03965ad /INSTALL/setup_image.sh
parentfd662f2115fd91d51c79649bdb5163cb46e6e5d5 (diff)
Set CONTAINER_TYPE to docker when running within docker.eel_5.0.0eel/5.0.05.0.0
Change-Id: Ida9d5a12b12f94bb5439a875696f65ded2dff087 Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'INSTALL/setup_image.sh')
-rwxr-xr-xINSTALL/setup_image.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/INSTALL/setup_image.sh b/INSTALL/setup_image.sh
index 7f2099b..6acef66 100755
--- a/INSTALL/setup_image.sh
+++ b/INSTALL/setup_image.sh
@@ -36,6 +36,10 @@ fi
# source flavour config file (generated by top Makefile)
. $INSTDIR/flavour.conf
+if [[ -z "$CONTAINER_TYPE" ]]; then
+ grep -q docker /proc/self/cgroup && CONTAINER_TYPE="docker"
+fi
+
################################## install docker endpoint #####################
# install the entrypoint script in /usr/bin
@@ -53,7 +57,7 @@ if [[ "$FIRSTRUN" == "yes" ]]; then
cat <<EOF >/etc/systemd/system/multi-user.target.wants/firstrun.service
[Unit]
Description=Firstrun service
-After=network.target
+After=network.target
[Service]
Type=oneshot
@@ -84,7 +88,7 @@ ln -sf ../usr/share/zoneinfo/$TIMEZONE /etc/localtime
################################## run other scripts in turn ##############
function enumerate_tasks() {
- for script in $INSTDIR/common.d/*; do
+ for script in $INSTDIR/common.d/*; do
case $(basename $script) in
[0-9][0-9]_*)
echo $(basename $script):$script
@@ -119,9 +123,8 @@ rm -rf /var/lib/apt/lists/*
rm -rf $INSTDIR # yes, I can auto-terminate myself !
# cleanup /tmp without removing the dir
-for x in $(find /tmp -mindepth 1); do
+for x in $(find /tmp -mindepth 1); do
rm -rf $x || true
done
echo "------------------------ $(basename $0) finished -----------------------"
-