|
|
@@ -8,15 +8,6 @@ fi |
|
|
|
set -e |
|
|
|
set -x |
|
|
|
|
|
|
|
try_install() { |
|
|
|
# try to install packages, but ignore failure |
|
|
|
for pkg in "$@"; do |
|
|
|
if ! apt-get -y install "$pkg" ; then |
|
|
|
echo ---- WARNING: Failed to install package: $pkg |
|
|
|
fi |
|
|
|
done |
|
|
|
} |
|
|
|
|
|
|
|
# Set up live username and hostname |
|
|
|
cat >/etc/casper.conf <<"EOF" |
|
|
|
export USERNAME="ubuntu" |
|
|
@@ -31,13 +22,15 @@ cat >/etc/hosts.nilm <<"EOF" |
|
|
|
127.0.2.1 nilm.primary |
|
|
|
127.0.2.2 nilm.secondary |
|
|
|
EOF |
|
|
|
# And copy it for now (although it will get overwritten at boot) |
|
|
|
cat /etc/hosts.nilm >> /etc/hosts |
|
|
|
|
|
|
|
# Upgrade packages and remove old kernels |
|
|
|
apt-get update |
|
|
|
apt-get -y dist-upgrade |
|
|
|
apt-get -y --purge autoremove |
|
|
|
apt update |
|
|
|
apt -y dist-upgrade |
|
|
|
apt -y --purge autoremove |
|
|
|
for VER in $(ls --sort=version /lib/modules/ | head -n -1) ; do |
|
|
|
apt-get -y --purge remove "linux-.*$VER" |
|
|
|
apt -y --purge remove "linux-.*$VER" |
|
|
|
done |
|
|
|
|
|
|
|
# Disable upgrade popups |
|
|
@@ -49,10 +42,10 @@ debconf-set-selections <<"EOF" |
|
|
|
postfix postfix/mailname string localdomain |
|
|
|
postfix postfix/main_mailer_type select Local only |
|
|
|
EOF |
|
|
|
apt-get -y install postfix |
|
|
|
apt -y install postfix |
|
|
|
|
|
|
|
# Required packages |
|
|
|
apt-get -y install \ |
|
|
|
apt -y install \ |
|
|
|
python3 \ |
|
|
|
python2.7 \ |
|
|
|
python2.7-dev \ |
|
|
@@ -77,20 +70,29 @@ apt-get -y install \ |
|
|
|
python-scipy \ |
|
|
|
python-daemon |
|
|
|
|
|
|
|
# Install other useful but optional stuff |
|
|
|
try_install \ |
|
|
|
# Install other useful stuff |
|
|
|
apt -y install \ |
|
|
|
adb \ |
|
|
|
avrdude \ |
|
|
|
chromium-browser \ |
|
|
|
curl \ |
|
|
|
debconf-utils \ |
|
|
|
devscripts \ |
|
|
|
dfu-programmer \ |
|
|
|
dlocate \ |
|
|
|
emacs \ |
|
|
|
emacs-goodies-el \ |
|
|
|
esptool \ |
|
|
|
flashrom \ |
|
|
|
gcc-arm-none-eabi \ |
|
|
|
gcc-avr \ |
|
|
|
gdb-arm-none-eabi \ |
|
|
|
gddrescue \ |
|
|
|
gnuplot \ |
|
|
|
help2man \ |
|
|
|
ipython \ |
|
|
|
libnewlib-arm-none-eabi \ |
|
|
|
libreoffice \ |
|
|
|
libstdc++-arm-none-eabi-newlib \ |
|
|
|
texlive \ |
|
|
|
mailutils \ |
|
|
@@ -106,6 +108,7 @@ try_install \ |
|
|
|
openvpn \ |
|
|
|
python-matplotlib \ |
|
|
|
screen \ |
|
|
|
sigrok \ |
|
|
|
silversearcher-ag \ |
|
|
|
subversion \ |
|
|
|
tcpdump \ |
|
|
@@ -113,7 +116,7 @@ try_install \ |
|
|
|
|
|
|
|
# Install the packages required for en_US language support |
|
|
|
# This avoids a prompt and package download at first install |
|
|
|
try_install $(/usr/bin/check-language-support -l en_US) |
|
|
|
apt -y install $(/usr/bin/check-language-support -l en_US) |
|
|
|
|
|
|
|
# Set up timezone to America/New_York for the live CD |
|
|
|
ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime |
|
|
@@ -129,7 +132,7 @@ chmod +x $DESKTOP/* |
|
|
|
# Custom background image (which was already copied in by customize.sh) |
|
|
|
XML=/etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml |
|
|
|
BG=/usr/share/xfce4/backdrops/nilmbuntu.png |
|
|
|
apt-get -y install xmlstarlet |
|
|
|
apt -y install xmlstarlet |
|
|
|
xmlstarlet ed -L -u "//property[@name='image-path']/@value" -v "$BG" $XML |
|
|
|
xmlstarlet ed -L -u "//property[@name='image-style']/@value" -v "3" $XML |
|
|
|
|
|
|
|