diff options
Diffstat (limited to 'INSTALL')
-rw-r--r-- | INSTALL/common.d/10_base | 14 | ||||
-rwxr-xr-x | INSTALL/setup_image.sh | 11 |
2 files changed, 14 insertions, 11 deletions
diff --git a/INSTALL/common.d/10_base b/INSTALL/common.d/10_base index fa9cb51..825e4fa 100644 --- a/INSTALL/common.d/10_base +++ b/INSTALL/common.d/10_base @@ -26,12 +26,14 @@ apt-get remove -y exim4 exim4-base exim4-config exim4-daemon-light apt-get autoremove -y # remove some useless systemd services -for sysdir in /lib/systemd /etc/systemd; do - for pattern in tty udev; do - find $sysdir -name "*${pattern}*" -exec rm -rf {} \; || : +if [[ "$CONTAINER_TYPE" = "docker" ]]; then + for sysdir in /lib/systemd /etc/systemd; do + for pattern in tty udev; do + find $sysdir -name "*${pattern}*" -exec rm -rf {} \; || : + done done -done -rm -f /lib/systemd/system/sysinit.target.wants/proc-sys-fs-binfmt_misc.automount + rm -f /lib/systemd/system/sysinit.target.wants/proc-sys-fs-binfmt_misc.automount +fi # allow to use systemd as user (systemd --user) apt-get install -y libpam-systemd @@ -84,5 +86,3 @@ cat <<EOF >>/etc/ssh/sshd_config # configuration options added from docker-worker-generator (script $BASH_SOURCE) AddressFamily inet EOF - - 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 -----------------------" - |