6 Commits

Author SHA1 Message Date
812b1803ea Fix theme on 13.10 2014-02-20 13:14:35 -05:00
2f71b45b16 Fix icons in Ubuntu 13.10 2014-02-20 13:14:35 -05:00
e699801a3b Add 13.10 config 2014-02-20 13:14:34 -05:00
3618d9815f More reliable enter.sh 2014-02-20 13:14:34 -05:00
c17520bc8a Update for apache 2.4 2014-02-20 13:14:34 -05:00
4ddfa26355 Workaround Ubuntu 13.10 bug 2014-02-20 13:14:34 -05:00
3 changed files with 69 additions and 9 deletions

17
config-13.10 Normal file
View File

@@ -0,0 +1,17 @@
# output image
VERSION="13.10.2"
OUTPUT="nilmdbuntu-${VERSION}.iso"
# original ISOs
ISONAME="xubuntu-13.10-desktop-amd64.iso"
ORIG="tmp-13.10/$ISONAME"
ORIGURL="http://cdimage.ubuntu.com/xubuntu/releases/13.10/release/$ISONAME"
# work directories, temporary qemu HD image
FS="tmp-13.10/fs"
ISO="tmp-13.10/iso"
MNT="tmp-13.10/mnt"
DISK="tmp-13.10/disk.img"
# local user
USER=jim:jim

View File

@@ -24,6 +24,9 @@ export BUILD_SYSTEM="Ubuntu"
export FLAVOUR="NilmDBuntu"
EOF
# In 13.10, this is needed to upgrade the "whoopsie" package; bug #1272269
grep '13[.]10' /etc/issue && ln -sf /lib/init/upstart-job /etc/init.d/whoopsie
# Upgrade packages, remove old kernels
apt-get update
# in 13.04, doing upgrade & dist-upgrade together tries to install 2 kernels
@@ -129,11 +132,27 @@ import nilmrun.server
application = nilmrun.server.wsgi_application("/nilmrun")
EOF
#### Edit apache config
# Create apache config by hacking up the default one. Might be a better way
# to do this, and it'll probably break on apache 2.4, but...
DEF=/etc/apache2/sites-available/default
# to do this, and it'll probably break on new versions, but...
APACHE_VER=$(dpkg -s apache2 | grep ^Version | cut -d ' ' -f 2)
if dpkg --compare-versions $APACHE_VER ge 2.4 ; then
DEF=/etc/apache2/sites-available/000-default.conf
NEED_PERMISSIONS=1
else
DEF=/etc/apache2/sites-available/default
NEED_PERMISSIONS=0
fi
# Cut out any existing NilmDB stuff
perl -ne 'print unless /## NilmDB start/../## NilmDB end/' $DEF > $DEF.orig
# Copy everything up to the first </VirtualHost> line
perl -ne 'print unless m-^[^#]*</VirtualHost>-..1' $DEF.orig > $DEF
# Add the NilmDB config
cat >>$DEF <<"EOF"
## NilmDB start
WSGIScriptAlias /nilmdb /home/nilmdb/nilmdb.wsgi
@@ -149,10 +168,26 @@ cat >>$DEF <<"EOF"
WSGIProcessGroup nilmrun-procgroup
WSGIApplicationGroup nilmrun-appgroup
</Location>
EOF
if [ $NEED_PERMISSIONS == 1 ] ; then
cat >>$DEF <<"EOF"
<Directory /home/nilmdb>
Options All
AllowOverride All
Require all granted
</Directory>
EOF
fi
cat >>$DEF <<"EOF"
## NilmDB end
EOF
# Copy everything including and after the first </VirtualHost> line
perl -ne 'print if m-^[^#]*</VirtualHost>-..1' $DEF.orig >> $DEF
#### Done editing apache config
# Create nilmdb capture, processing, and cleanup files
cat > /home/nilmdb/capture.sh <<"EOF"
#!/bin/bash -e
@@ -267,14 +302,18 @@ cp /usr/share/applications/exo-web-browser.desktop $DESKTOP || true
chmod +x $DESKTOP/* # needs to be executable for 13.04+
# XFCE / theme customizations
if [ -d /usr/share/themes/Clearlooks ] && \
[ -d /usr/share/icons/elementary-xfce ] ; then
cat > /usr/share/gconf/defaults/88_nilmdbuntu-settings <<"EOF"
if [ -d /usr/share/themes/Clearlooks ] ; then
cat > /usr/share/gconf/defaults/88_nilmdbuntu-gtk-theme <<"EOF"
/desktop/gnome/interface/gtk_theme "Clearlooks"
EOF
fi
if [ -d /usr/share/icons/elementary-xfce ] ; then
cat > /usr/share/gconf/defaults/88_nilmdbuntu-icon-theme <<"EOF"
/desktop/gnome/interface/icon_theme "elementary-xfce"
EOF
update-gconf-defaults
fi
update-gconf-defaults
XML=/etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml
BG=/usr/share/xfce4/backdrops
@@ -327,7 +366,7 @@ EOF
sed -i -s -e 's/Greybird/Default/g' $XML/xfwm4.xml || true
sed -i -s -e 's/Greybird/Clearlooks/g' $XML/xsettings.xml || true
sed -i -s -e \
's/elementary-xfce-dark/elementary-xfce/g' $XML/xsettings.xml || true
's/elementary-xfce-dark(er)?/elementary-xfce/g' $XML/xsettings.xml || true
# Firefox defaults
cat >/etc/firefox/syspref.js <<"EOF"

View File

@@ -27,6 +27,10 @@ run() {
}
set -e
umount ${FS}/dev/pts || true
umount ${FS}/sys/kernel/security || true
umount ${FS}/sys || true
umount ${FS}/proc || true
mount -t proc none ${FS}/proc
mount -t sysfs none ${FS}/sys
mount -t devpts none ${FS}/dev/pts
@@ -34,9 +38,9 @@ mount -t devpts none ${FS}/dev/pts
run "echo 'nameserver 8.8.8.8' > /etc/resolv.conf"
run "dbus-uuidgen > /var/lib/dbus/machine-id"
run "dpkg-divert --local --rename --add /sbin/initctl"
run "ln -s /bin/true /sbin/initctl"
run "ln -sf /bin/true /sbin/initctl"
run "dpkg-divert --local --rename --add /usr/sbin/update-grub"
run "ln -s /bin/true /usr/sbin/update-grub"
run "ln -sf /bin/true /usr/sbin/update-grub"
set +e
if [ -z "$1" ] ; then