TZ=UTC # Time zones are in /usr/share/zoneinfo export DEBIAN_FRONTEND=noninteractive APT_GET="apt-get -y" APPLIANCE_BASE_DIR="/tmp/akanda-appliance" APPLIANCE_SCRIPT_DIR="$APPLIANCE_BASE_DIR/scripts" PACKAGES="ntp python2.7 python-pip wget dnsmasq bird6 iptables iptables-persistent tcpdump conntrack tshark mtr" PACKAGES_BUILD="python-dev build-essential isc-dhcp-client" DNS=8.8.8.8 RELEASE=`lsb_release -cs` echo "[*] Setup APT for $RELEASE" cat > /etc/apt/sources.list < /etc/apt/sources.list.d/backports.list < /etc/apt/preferences.d/bird Package: bird Pin: release a=$RELEASE-backports Pin-Priority: 1000 Package: bird6 Pin: release a=$RELEASE-backports Pin-Priority: 1000 EOF # We need the new kernel in order to fix some IPv6 bugs cat < /etc/apt/preferences.d/kernel Package: linux-image Pin: release a=wheezy-backports Pin-Priority: 1000 Package: initramfs-tools Pin: release a=wheezy-backports Pin-Priority: 1000 EOF fi echo "[*] Configure GRUB" cat << EOF > /etc/default/grub # If you change this file, run 'update-grub' afterwards to update # /boot/grub/grub.cfg. GRUB_DEFAULT=0 GRUB_TIMEOUT=0 GRUB_DISTRIBUTOR=Debian GRUB_CMDLINE_LINUX_DEFAULT="quiet" # Disable GSO (Generic Segmentation Offload) in order to improve IPv6 forwarding performance GRUB_CMDLINE_LINUX="debian-installer=en_US virtio_net.gso=0" EOF /usr/sbin/update-grub echo "[*] APT Update" apt-get update || exit 1 echo "[*] Upgrade to the 3.14 (or greater) backport kernel and update bash to fix CVE-2014-6271" apt-get -y install linux-image-3.16.0-0.bpo.4-amd64 bash echo "[*] Creating motd file..." cat >/etc/motd < /etc/hostname < /etc/resolv.conf echo "[*] Installing additional packages..." $APT_GET install $PACKAGES || exit 1 $APT_GET install $PACKAGES_BUILD || exit 1 mkdir /etc/dnsmasq.d cat > /etc/dnsmasq.conf < /tmp/akanda.sh < /etc/sysctl.conf < $log_file done echo "[*] Remove packages only required by install" $APT_GET remove $PACKAGES_BUILD || exit 1 $APT_GET autoremove $APT_GET clean echo "[*] Saving creation timestamp..." date > /etc/akanda-release echo "[*] Saving default timezone..." rm -f /etc/localtime ln -s /usr/share/zoneinfo/$TZ /etc/localtime echo "[*] Use bash instead of dash" rm /bin/sh ; ln -s /bin/bash /bin/sh echo "[*] Clean up udev rules..." rm -f /etc/udev/rules.d/70-persistent-net.rules echo "[*] Enjoy Akanda!" date echo "[*] Done."