aboutsummaryrefslogtreecommitdiffstats
path: root/setup.d/10_base
diff options
context:
space:
mode:
authorStephane Desneux <stephane.desneux@iot.bzh>2016-11-30 20:33:52 +0100
committerStephane Desneux <stephane.desneux@iot.bzh>2016-11-30 20:37:12 +0100
commit6643e51c254d2dfed65f03568d1ce11e000f01c3 (patch)
tree21e49ccd23ea04e241cb5b7cd52d80164e2a3d2d /setup.d/10_base
parent46067f331f1acb9512795a04b6f2f095b5470ecd (diff)
Initial content
Change-Id: I330ad2e8b08a4743e752b8fe9d1ccf9fa1215f8a Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
Diffstat (limited to 'setup.d/10_base')
-rw-r--r--setup.d/10_base61
1 files changed, 61 insertions, 0 deletions
diff --git a/setup.d/10_base b/setup.d/10_base
new file mode 100644
index 0000000..07633ea
--- /dev/null
+++ b/setup.d/10_base
@@ -0,0 +1,61 @@
+#!/bin/bash
+
+# add backports and testing repositories
+echo "deb http://http.debian.net/debian jessie-backports main contrib" >>/etc/apt/sources.list
+echo "deb http://http.debian.net/debian testing main contrib" >>/etc/apt/sources.list
+
+# 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
+
+# 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
+
+
+
+