aboutsummaryrefslogtreecommitdiffstats
path: root/INSTALL
diff options
context:
space:
mode:
Diffstat (limited to 'INSTALL')
-rw-r--r--INSTALL/common.d/10_base22
-rw-r--r--INSTALL/common.d/20_worker_base19
-rwxr-xr-xINSTALL/setup_image.sh25
-rw-r--r--INSTALL/tasks.d/30_yocto2
-rw-r--r--INSTALL/tasks.d/50_sdk2
-rw-r--r--INSTALL/tasks.d/70_doc2
-rw-r--r--INSTALL/tasks.d/80_xds2
-rw-r--r--INSTALL/tools/scripts_sdk/install_sdk3
8 files changed, 49 insertions, 28 deletions
diff --git a/INSTALL/common.d/10_base b/INSTALL/common.d/10_base
index 9574f79..fbc2bfe 100644
--- a/INSTALL/common.d/10_base
+++ b/INSTALL/common.d/10_base
@@ -21,20 +21,22 @@ echo "Acquire::Retries 5;" >/etc/apt/apt.conf.d/99NetRetries
apt-get update -y
apt-get dist-upgrade -y
-apt-get install -y passwd sudo openssh-server openssh-client vim systemd logrotate ifupdown locales
-apt-get remove -y exim4 exim4-base exim4-config exim4-daemon-light
-apt-get autoremove -y
-
# gpg no longer installed and is requested by apt-key command (Debian Bug report logs - #830696)
apt-get install gpg -y
+apt-get install -y passwd sudo openssh-server openssh-client vim systemd logrotate ifupdown locales apt-utils
+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
@@ -87,5 +89,3 @@ cat <<EOF >>/etc/ssh/sshd_config
# configuration options added from docker-worker-generator (script $BASH_SOURCE)
AddressFamily inet
EOF
-
-
diff --git a/INSTALL/common.d/20_worker_base b/INSTALL/common.d/20_worker_base
index b262afb..5059ef7 100644
--- a/INSTALL/common.d/20_worker_base
+++ b/INSTALL/common.d/20_worker_base
@@ -1,16 +1,25 @@
#!/bin/bash
# add some cool base tools
-apt-get install -y man tree curl screen
+apt-get install -y man tree curl screen
# add the build user
-useradd -c "Builder" -d $DEVUSER_HOME -G sudo -m -U -s /bin/bash -u $DEVUSER_UID $DEVUSER
-echo $DEVUSER:$DEVUSER_PASSWORD | chpasswd
+useradd -c "Builder" -d $DEVUSER_HOME -G sudo,systemd-journal -m -U -s /bin/bash -u $DEVUSER_UID $DEVUSER
+echo $DEVUSER:$DEVUSER_PASSWORD | chpasswd
# generate an extra environment file sourced by bashrc
-for k in DEVUSER DEVUSER_UID DEVUSER_HOME \
+for k in DEVUSER \
+ DEVUSER_UID \
+ DEVUSER_HOME \
XDT_DIR \
- XDT_META XDT_DOWNLOADCACHE XDT_SSTATECACHE XDT_CCACHE XDT_BUILD XDT_WORKSPACE XDT_SOURCES XDT_SDK \
+ XDT_META \
+ XDT_DOWNLOADCACHE \
+ XDT_SSTATECACHE \
+ XDT_CCACHE \
+ XDT_BUILD \
+ XDT_WORKSPACE \
+ XDT_SOURCES \
+ XDT_SDK \
; do
v=${!k} # get value
[[ "${v:0:1}" == "/" ]] && mkdir -p $v # create dir only if value starts with "/"
diff --git a/INSTALL/setup_image.sh b/INSTALL/setup_image.sh
index 7f2099b..ad79e10 100755
--- a/INSTALL/setup_image.sh
+++ b/INSTALL/setup_image.sh
@@ -18,13 +18,25 @@ function debug() {
set -x
return 0 # continue
}
+
+function crash() {
+ set +x
+ echo " -------------------------"
+ echo "| CRASH HANDLER TRIGGERED |"
+ echo " -------------------------"
+ exit 1
+}
+
# get the INSTALL dir (the one where we were launched)
INSTDIR=$(cd $(dirname $0) && pwd -P)
echo "Detected container install dir = $INSTDIR"
if [[ -f $INSTDIR/DEBUG ]]; then
- echo "#### DEBUG MODE IS ACTIVE ####"
+ echo "#### INTERACTIVE DEBUG MODE IS ACTIVE ####"
trap debug ERR # on error, run a sleep tp debug container
+else
+ echo "#### JENKINS MODE MODE IS ACTIVE ####"
+ trap crash ERR # on error, simply crash
fi
@@ -36,6 +48,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 +69,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 +100,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 +135,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 -----------------------"
-
diff --git a/INSTALL/tasks.d/30_yocto b/INSTALL/tasks.d/30_yocto
index 0edb311..60bb428 100644
--- a/INSTALL/tasks.d/30_yocto
+++ b/INSTALL/tasks.d/30_yocto
@@ -4,7 +4,7 @@ set -e
# install prereqs for bitbake (Yocto mega-manual)
# http://www.yoctoproject.org/docs/2.2/mega-manual/mega-manual.html#detailed-supported-distros
-apt-get install -y gawk diffstat texinfo gcc-multilib \
+apt-get install -y gawk diffstat texinfo gcc-multilib g++-multilib\
build-essential chrpath socat
# some packages are not mentioned or not pulled...
diff --git a/INSTALL/tasks.d/50_sdk b/INSTALL/tasks.d/50_sdk
index 1f60edd..1985b14 100644
--- a/INSTALL/tasks.d/50_sdk
+++ b/INSTALL/tasks.d/50_sdk
@@ -9,7 +9,7 @@ done
# install node.js and tools (npm, gulp, bower) if needed
if [[ -z $(which node) ]]; then
curl -sL https://deb.nodesource.com/setup_6.x | bash -
- apt-get install nodejs
+ apt-get install -y nodejs
# issue SPEC-979
# this install fails with timeout for unknown reason - let's comment it
#npm install --global gulp bower
diff --git a/INSTALL/tasks.d/70_doc b/INSTALL/tasks.d/70_doc
index 882e7d6..2d38490 100644
--- a/INSTALL/tasks.d/70_doc
+++ b/INSTALL/tasks.d/70_doc
@@ -11,6 +11,6 @@ if [[ -z $(which node) ]]; then
fi
# tools used to generate developer website (https://github.com/automotive-grade-linux/docs-agl)
-gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 \
+curl -sSL https://rvm.io/mpapis.asc | gpg --import - \
&& curl -sSL https://get.rvm.io | bash -s stable --ruby --gems=jekyll
diff --git a/INSTALL/tasks.d/80_xds b/INSTALL/tasks.d/80_xds
index b3a709d..b5c4372 100644
--- a/INSTALL/tasks.d/80_xds
+++ b/INSTALL/tasks.d/80_xds
@@ -1,6 +1,6 @@
#!/bin/bash
-export DISTRO="Debian_8.0"
+export DISTRO="Debian_9.0"
wget -t 3 -T 60 -O - http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/app-Development/${DISTRO}/Release.key | apt-key add -
diff --git a/INSTALL/tools/scripts_sdk/install_sdk b/INSTALL/tools/scripts_sdk/install_sdk
index 27035c8..a267234 100644
--- a/INSTALL/tools/scripts_sdk/install_sdk
+++ b/INSTALL/tools/scripts_sdk/install_sdk
@@ -32,9 +32,6 @@ pushd $XDT_SDK/sysroots/*-agl-*
rm -rf $dir
done
- echo "Removing sources in /usr/src"
- rm -rf usr/src
-
for dir in bin sbin usr/bin usr/local/bin usr/sbin; do
echo "Removing binaries in $dir"
find $dir -type f -exec file -i '{}' \; | grep 'x-executable;' | grep 'charset=binary' | cut -f1 -d':' | while read file; do