aboutsummaryrefslogtreecommitdiffstats
path: root/docker
diff options
context:
space:
mode:
Diffstat (limited to 'docker')
-rw-r--r--docker/firstrun.sh37
-rw-r--r--docker/image.conf19
-rwxr-xr-xdocker/setup_image.sh104
-rwxr-xr-xdocker/wait_for_net.sh19
4 files changed, 0 insertions, 179 deletions
diff --git a/docker/firstrun.sh b/docker/firstrun.sh
deleted file mode 100644
index 2b70a92..0000000
--- a/docker/firstrun.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/bash -x
-
-# fail at first error !
-set -e
-
-# redirect outputs to log
-LOGFILE=/var/log/firstrun.log
-exec >$LOGFILE 2>&1
-
-echo $(date +"%Y%m%d %H:%M:%S") Starting firstrun script
-
-# source same file with .conf extension
-. ${0%.sh}.conf
-
-# run the scripts found in /root/firstrun.d
-
-for x in /root/firstrun.d/*; do
- case $(basename $x) in
- [0-9][0-9]_*)
- echo "--------------------- start script $x ---------------------"
- . $x
- echo "--------------------- end of script $x ---------------------"
- ;;
- *)
- ;;
- esac
-
-done
-
-######################### cleanup #####################
-
-# remove firstrun
-rm -rf /root/firstrun.*
-rm -rf /etc/systemd/system/multi-user.target.wants/firstrun.*
-systemctl daemon-reload
-
-rm -f $LOGFILE
diff --git a/docker/image.conf b/docker/image.conf
deleted file mode 100644
index 27e173f..0000000
--- a/docker/image.conf
+++ /dev/null
@@ -1,19 +0,0 @@
-FIRSTRUN=no
-
-TIMEZONE=Europe/Paris
-
-XDT_DIR=/xdt
-
-DEVUSER=devel
-DEVUSER_UID=1664
-DEVUSER_PASSWORD=$DEVUSER
-DEVUSER_HOME=/home/$DEVUSER
-
-XDT_META=$XDT_DIR/meta
-XDT_DOWNLOADCACHE=$XDT_DIR/downloads
-XDT_SSTATECACHE=$XDT_DIR/sstate-cache
-XDT_CCACHE=$XDT_DIR/ccache
-XDT_BUILD=$XDT_DIR/build
-XDT_WORKSPACE=$XDT_DIR/workspace
-XDT_SOURCES=$XDT_DIR/sources
-XDT_SDK=$XDT_DIR/sdk
diff --git a/docker/setup_image.sh b/docker/setup_image.sh
deleted file mode 100755
index 56cdc1d..0000000
--- a/docker/setup_image.sh
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/bin/bash -x
-
-### this script is called when building the docker image: it's executing in a temp container
-
-echo "------------------------ Starting $(basename $0) -----------------------"
-
-function debug() {
- set +x
- echo "-------------------------"
- echo "Command failed."
- echo "Running sleep for 1 day. To proceed:"
- echo "* run 'killall sleep' to continue"
- echo "* run 'killall -9 sleep' to abort the build"
- sig=0
- sleep 86400 || sig=$?
- # if killed -9, then abort
- [[ $sig == 137 ]] && exit 1 # abort
- set -x
- return 0 # continue
-}
-trap debug ERR # on error, run a sleep tp debug container
-
-# get the INSTALL dir (the one where we were launched)
-INSTDIR=$(cd $(dirname $0)/.. && pwd -P)
-echo "Detected container install dir = $INSTDIR"
-
-################################## variables #################################
-
-# source variables in conf file
-. $INSTDIR/docker/image.conf
-
-################################## install docker endpoint #####################
-
-# install the entrypoint script in /usr/bin
-install --mode=755 $INSTDIR/docker/wait_for_net.sh /usr/bin/
-
-################################## install first-run service ###################
-# all operations requiring runnning daemons (inc. systemd) must be run at first
-# container instanciation
-
-if [[ "$FIRSTRUN" == "yes" ]]; then
- install --mode=755 $INSTDIR/docker/firstrun.sh /root/firstrun.sh
- install --mode=644 $INSTDIR/docker/image.conf /root/firstrun.conf
- [[ -d $INSTDIR/firstrun.d ]] && cp -a $INSTDIR/firstrun.d /root/
- mkdir -p /etc/systemd/system/multi-user.target.wants/
- cat <<EOF >/etc/systemd/system/multi-user.target.wants/firstrun.service
-[Unit]
-Description=Firstrun service
-After=network.target
-
-[Service]
-Type=oneshot
-ExecStart=-/bin/bash -c /root/firstrun.sh
-TimeoutSec=0
-StandardInput=null
-RemainAfterExit=yes
-
-[Install]
-WantedBy=multi-user.target
-EOF
-fi
-
-# helper func to install a firstrun hook
-function firstrun_add() {
- script=$1
- level=${2:-50}
- name=${3:-$(basename $script)}
-
- mkdir -p /root/firstrun.d
- cp $script /root/firstrun.d/${level}_$name
-}
-
-################################## adjust system timezone ############################
-
-ln -sf ../usr/share/zoneinfo/$TIMEZONE /etc/localtime
-
-################################## run other scripts in turn ##############
-
-for script in $INSTDIR/setup.d/*; do
- case $(basename $script) in
- [0-9][0-9]_*)
- echo "--------------------- start script $script ---------------------"
- . $script
- echo "--------------------- end of script $script ---------------------"
- ;;
- *)
- ;;
- esac
-done
-
-############################### cleanup ###################################
-
-cd /
-apt-get clean # clean apt caches
-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
- rm -rf $x || true
-done
-
-echo "------------------------ $(basename $0) finished -----------------------"
-
diff --git a/docker/wait_for_net.sh b/docker/wait_for_net.sh
deleted file mode 100755
index 354e76a..0000000
--- a/docker/wait_for_net.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/bash
-
-### this script is used as entrypoint of the docker container to wait for network to be up ###
-
-IFACE="veth0 eth0"
-
-function wait_net() {
- for i in $IFACE; do
- [[ "$(cat /sys/class/net/$i/operstate 2>/dev/null)" == "up" ]] && return 1
- done
- return 0
-}
-
-while wait_net; do
- sleep 1
-done
-
-[[ $# > 0 ]] && exec "$@"
-exec /bin/bash -l