diff options
author | 2017-05-11 01:06:09 +0200 | |
---|---|---|
committer | 2017-05-11 01:06:09 +0200 | |
commit | a7bf03217af780f4245af555efdbfdc7ca9e2935 (patch) | |
tree | 66698dc80d43d3ff023560bc483acf66a964212d /INSTALL/setup.d | |
parent | f32036a025d8ae7e6ef02aca8b080e5bca60fc11 (diff) |
Introduce flavours for containers
Multiple variations over a common base must be supported when creating AGL containers.
This commit introduces 'flavours' to achive this goal (see README.md for details).
Current supported flavours:
* generic : same image as before
* xds : new image dedicated to AGL DevKit
Change-Id: I0aa65a1d9e83a2d7aed43e0b135dc43c5537bc53
Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
Diffstat (limited to 'INSTALL/setup.d')
-rw-r--r-- | INSTALL/setup.d/10_base | 67 | ||||
-rw-r--r-- | INSTALL/setup.d/20_worker_base | 31 | ||||
-rw-r--r-- | INSTALL/setup.d/30_yocto | 44 | ||||
-rw-r--r-- | INSTALL/setup.d/31_yocto_toaster | 7 | ||||
-rw-r--r-- | INSTALL/setup.d/40_netboot | 15 | ||||
-rw-r--r-- | INSTALL/setup.d/50_sdk | 15 | ||||
-rw-r--r-- | INSTALL/setup.d/60_x11_tools | 13 | ||||
-rw-r--r-- | INSTALL/setup.d/70_doc | 13 | ||||
-rw-r--r-- | INSTALL/setup.d/99_cleanup | 18 |
9 files changed, 0 insertions, 223 deletions
diff --git a/INSTALL/setup.d/10_base b/INSTALL/setup.d/10_base deleted file mode 100644 index e429e65..0000000 --- a/INSTALL/setup.d/10_base +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash - -# add backports and testing repositories -echo "deb http://http.debian.net/debian jessie-backports main contrib" >>/etc/apt/sources.list - -# setup network retries for apt -echo "Acquire::Retries 5;" >/etc/apt/apt.conf.d/99NetRetries - -# upgrade distro -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 - -# 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 {} \; || : - done -done -rm -f /lib/systemd/system/sysinit.target.wants/proc-sys-fs-binfmt_misc.automount - -cp $INSTDIR/config/bashrc /etc/skel/.bash_aliases # sourced by .bashrc for new users - -cp $INSTDIR/config/sudo_devel /etc/sudoers.d/sudo_devel # Allow sudo without password - -# copy files for root account (already created) -find /etc/skel -type f -exec cp -av {} /root \; - -# workaround bug on dbus if host runs selinux -mkdir -p /etc/selinux/targeted/contexts/ -echo '<busconfig><selinux></selinux></busconfig>' >/etc/selinux/targeted/contexts/dbus_contexts - -# remount selinux ro to workaround bug in apt-get -cat <<EOF >/etc/rc.local -#!/bin/sh -e -# -# rc.local -# -# This script is executed at the end of each multiuser runlevel. -# Make sure that the script will "exit 0" on success or any other -# value on error. -# -# In order to enable or disable this script just change the execution -# bits. -# -# By default this script does nothing. - -if [ -d /sys/fs/selinux ]; then - mount -o remount,ro /sys/fs/selinux -fi - -exit 0 -EOF - -# generate locale and set to default -echo "en_US.UTF-8 UTF-8" >>/etc/locale.gen -/usr/sbin/locale-gen -echo "LANG=en_US.UTF-8" >>/etc/default/locale - -# by default, /tmp is not mounted in tmpfs: solve this -echo "tmpfs /tmp tmpfs noatime,size=50% 0 0" >>/etc/fstab - - - diff --git a/INSTALL/setup.d/20_worker_base b/INSTALL/setup.d/20_worker_base deleted file mode 100644 index b262afb..0000000 --- a/INSTALL/setup.d/20_worker_base +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -# add some cool base tools -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 - -# generate an extra environment file sourced by bashrc -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 \ - ; do - v=${!k} # get value - [[ "${v:0:1}" == "/" ]] && mkdir -p $v # create dir only if value starts with "/" - echo "export $k=$v" >>/etc/xdtrc -done - -mkdir -p $DEVUSER_HOME/bin -cat <<'EOF' >>$DEVUSER_HOME/.bashrc - -# added by worker image creation script (docker-image-builder) -export PATH=~/bin:$PATH -[[ -f /etc/xdtrc ]] && . /etc/xdtrc - -EOF - -chown -R $DEVUSER:$DEVUSER $XDT_DIR -chown -R $DEVUSER:$DEVUSER $DEVUSER_HOME - diff --git a/INSTALL/setup.d/30_yocto b/INSTALL/setup.d/30_yocto deleted file mode 100644 index af21a8c..0000000 --- a/INSTALL/setup.d/30_yocto +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -# 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 wget git git-core diffstat unzip texinfo gcc-multilib \ - build-essential chrpath socat - -# some packages are not mentioned or not pulled... -apt-get install -y libsdl1.2-dev cpio libzip2 lsb-release python3 - -# dev tools -apt-get install -y make ccache - -# for documentation -#apt-get install -y xsltproc docbook-utils fop dblatex xmlto - -# for gerrit -apt-get install -y git-review - -# libncurses5-dev for kernel 'make menuconfig' -apt-get install -y libncurses5-dev - -# copy meta init script in ~devel/bin: -wget -O $DEVUSER_HOME/bin/prepare_meta https://raw.githubusercontent.com/iotbzh/agl-manifest/master/prepare_meta -chmod +x $DEVUSER_HOME/bin/* - -# for image creation and compression -apt-get install -y python-lzma python-gpgme pbzip2 pigz lzop - -dpkg -i \ - $INSTDIR/tools/bmaptools/bmap-tools*.deb \ - $INSTDIR/tools/tar/*.deb \ - $INSTDIR/tools/xz-utils/*.deb - -# install specific scripts -mkdir -p /usr/local/bin -for x in $INSTDIR/tools/scripts_yocto/*; do - install --mode=755 $x /usr/local/bin/ -done - -# grab and install repo tool -wget -O /usr/local/bin/repo https://storage.googleapis.com/git-repo-downloads/repo -chmod a+x /usr/local/bin/repo - diff --git a/INSTALL/setup.d/31_yocto_toaster b/INSTALL/setup.d/31_yocto_toaster deleted file mode 100644 index 9dbb698..0000000 --- a/INSTALL/setup.d/31_yocto_toaster +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# for toaster -apt-get install -y python-pip -pip install "Django==1.6" "South==0.8.4" "argparse==1.2.1" "wsgiref==0.1.2" "beautifulsoup4>=4.4.0" - - diff --git a/INSTALL/setup.d/40_netboot b/INSTALL/setup.d/40_netboot deleted file mode 100644 index 05d6f30..0000000 --- a/INSTALL/setup.d/40_netboot +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# for network boot through tftp+nbd -apt-get install -y tftpd-hpa xnbd-server - -# adjust config file to have the server point to bitbake images deployment dir -sed -i -e "s#^\(TFTP_DIRECTORY=\).*\$#\1\"$XDT_BUILD/tmp/deploy/images\"#" /etc/default/tftpd-hpa - -# install specific scrips -mkdir -p /usr/local/bin -for x in $INSTDIR/tools/scripts_netboot/*; do - install --mode=755 $x /usr/local/bin/ -done - - diff --git a/INSTALL/setup.d/50_sdk b/INSTALL/setup.d/50_sdk deleted file mode 100644 index 1a44fd9..0000000 --- a/INSTALL/setup.d/50_sdk +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# install specific scripts -mkdir -p /usr/local/bin -for x in $INSTDIR/tools/scripts_sdk/*; do - install --mode=755 $x /usr/local/bin/ -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 - npm install --global gulp bower -fi - diff --git a/INSTALL/setup.d/60_x11_tools b/INSTALL/setup.d/60_x11_tools deleted file mode 100644 index 5c2cd75..0000000 --- a/INSTALL/setup.d/60_x11_tools +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -apt-get install -y gitg vim-gtk xterm fonts-liberation - -# update xterm resources to have truetype fonts and utf-8 -cat <<EOF >>/etc/X11/app-defaults/XTerm - -!iotbzh: enable truetype fonts and UTF-8 encoding -*VT100*faceName: mono -*VT100*faceSize: 13 -*VT100*locale: true -EOF - diff --git a/INSTALL/setup.d/70_doc b/INSTALL/setup.d/70_doc deleted file mode 100644 index 9336de9..0000000 --- a/INSTALL/setup.d/70_doc +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# 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 -y nodejs - npm install --global gulp bower -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://get.rvm.io | bash -s stable --ruby --gems=jekyll - diff --git a/INSTALL/setup.d/99_cleanup b/INSTALL/setup.d/99_cleanup deleted file mode 100644 index 3cea352..0000000 --- a/INSTALL/setup.d/99_cleanup +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -apt-get autoremove -y - -# remove big useless files -rm -rf /usr/lib/x86_64-linux-gnu/dri/*.so -rm -rf /usr/lib/perl/5.*/auto/Encode/JP/JP.so -rm -rf /usr/lib/perl/5.*/auto/Encode/KR/KR.so -rm -rf /usr/lib/perl/5.*/auto/Encode/CN/CN.so -rm -rf /usr/lib/perl/5.*/auto/Encode/TW/TW.so - -# keep doc ? -#rm -rf /usr/share/doc -#rm -rf /usr/share/man -#rm -rf /usr/share/locale - - - |