11 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
6318e0a55a Update README 2014-02-18 18:25:24 -05:00
b7ca46922d Fix unmount in cleanup.sh 2014-02-18 16:54:12 -05:00
cb0da24a7d Bump version numbers 2014-02-18 14:58:45 -05:00
70272d3184 Add more default packages, remove obsolete TODO 2014-02-18 14:56:22 -05:00
ebb3db4ba2 Add OpenVPN 2013-08-28 10:28:54 -04:00
8 changed files with 85 additions and 33 deletions

8
README
View File

@@ -1,8 +1,7 @@
This live CD is customized by roughly following the guidelines at: This live CD is customized by roughly following the guidelines at:
https:// https://help.ubuntu.com/community/LiveCDCustomization
help.ubuntu.com/community/LiveCDCustomization https://help.ubuntu.com/community/LiveCDCustomizationFromScratch
help.ubuntu.com/community/LiveCDCustomizationFromScratch https://help.ubuntu.com/community/MakeALiveCD/DVD/BootableFlashFromHarddiskInstall
help.ubuntu.com/community/MakeALiveCD/DVD/BootableFlashFromHarddiskInstall
plus a lot of other info, like ubiquity and casper source code, and plus a lot of other info, like ubiquity and casper source code, and
additions for making the resulting iso EFI bootable. additions for making the resulting iso EFI bootable.
@@ -29,5 +28,6 @@ cleanup.sh
SHORT VERSION: SHORT VERSION:
sudo apt-get install squashfs-tools xorriso syslinux
time sudo sh -c "env BUILD_CONFIG=12.10 ./full-rebuild.sh" time sudo sh -c "env BUILD_CONFIG=12.10 ./full-rebuild.sh"
time sudo sh -c "env BUILD_CONFIG=13.04 ./full-rebuild.sh" time sudo sh -c "env BUILD_CONFIG=13.04 ./full-rebuild.sh"

15
TODO
View File

@@ -1,15 +0,0 @@
- Try other Ubuntu/Xubuntu versions
Problems with 3ce08771a631f9e373f65995fd2114a817326e98:
* Ubiquity chooser doesn't have nilmdb background --- skip it!
* Theme is still "Greybird" not "Clearlooks"
* Icons are still "elementary Xfce dark" not "elementary Xfce"
* Change xfdesktop background color to black
* Set default firefox homepage to http://nilmdb.com/
* /home/nilmdb should have /etc/skel stuff
* capture.sh should say skipping
* ubiquity still shows release notes?
* release notes need to exist
* in live CD, ssh_host_dsa_key is ba636e7440..
* quiet/splash removal failed --- preseed late_command didn't work
* build hybrid iso

View File

@@ -7,5 +7,5 @@ sudo umount ${FS}/dev/pts || true
sudo umount ${FS}/sys/kernel/security || true sudo umount ${FS}/sys/kernel/security || true
sudo umount ${FS}/sys || true sudo umount ${FS}/sys || true
sudo umount ${FS}/proc || true sudo umount ${FS}/proc || true
sudo umount mnt || true sudo umount ${MNT} || true
sudo rm --one-file-system -rf ${FS} ${ISO} ${MNT} ${DISK} sudo rm --one-file-system -rf ${FS} ${ISO} ${MNT} ${DISK}

View File

@@ -1,5 +1,5 @@
# output image # output image
VERSION="12.10.1" VERSION="12.10.2"
OUTPUT="nilmdbuntu-${VERSION}.iso" OUTPUT="nilmdbuntu-${VERSION}.iso"
# original ISOs # original ISOs

View File

@@ -1,5 +1,5 @@
# output image # output image
VERSION="13.04.1" VERSION="13.04.2"
OUTPUT="nilmdbuntu-${VERSION}.iso" OUTPUT="nilmdbuntu-${VERSION}.iso"
# original ISOs # original ISOs

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" export FLAVOUR="NilmDBuntu"
EOF 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 # Upgrade packages, remove old kernels
apt-get update apt-get update
# in 13.04, doing upgrade & dist-upgrade together tries to install 2 kernels # in 13.04, doing upgrade & dist-upgrade together tries to install 2 kernels
@@ -77,7 +80,7 @@ apt-get -y install \
python-scipy \ python-scipy \
python-daemon python-daemon
# install other useful but optional utilities # install other useful but optional stuff
try_install \ try_install \
emacs-goodies-el \ emacs-goodies-el \
emacs23-nox \ emacs23-nox \
@@ -97,7 +100,14 @@ try_install \
ack-grep \ ack-grep \
mutt \ mutt \
python-matplotlib \ python-matplotlib \
ipython ipython \
openvpn \
network-manager-openvpn-gnome \
openssl \
tcpdump \
screen \
devscripts \
mailutils
# required # required
apt-get -y install \ apt-get -y install \
@@ -122,11 +132,27 @@ import nilmrun.server
application = nilmrun.server.wsgi_application("/nilmrun") application = nilmrun.server.wsgi_application("/nilmrun")
EOF EOF
#### Edit apache config
# Create apache config by hacking up the default one. Might be a better way # 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... # to do this, and it'll probably break on new versions, but...
DEF=/etc/apache2/sites-available/default
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 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 perl -ne 'print unless m-^[^#]*</VirtualHost>-..1' $DEF.orig > $DEF
# Add the NilmDB config
cat >>$DEF <<"EOF" cat >>$DEF <<"EOF"
## NilmDB start ## NilmDB start
WSGIScriptAlias /nilmdb /home/nilmdb/nilmdb.wsgi WSGIScriptAlias /nilmdb /home/nilmdb/nilmdb.wsgi
@@ -142,10 +168,26 @@ cat >>$DEF <<"EOF"
WSGIProcessGroup nilmrun-procgroup WSGIProcessGroup nilmrun-procgroup
WSGIApplicationGroup nilmrun-appgroup WSGIApplicationGroup nilmrun-appgroup
</Location> </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 ## NilmDB end
EOF EOF
# Copy everything including and after the first </VirtualHost> line
perl -ne 'print if m-^[^#]*</VirtualHost>-..1' $DEF.orig >> $DEF perl -ne 'print if m-^[^#]*</VirtualHost>-..1' $DEF.orig >> $DEF
#### Done editing apache config
# Create nilmdb capture, processing, and cleanup files # Create nilmdb capture, processing, and cleanup files
cat > /home/nilmdb/capture.sh <<"EOF" cat > /home/nilmdb/capture.sh <<"EOF"
#!/bin/bash -e #!/bin/bash -e
@@ -260,14 +302,18 @@ cp /usr/share/applications/exo-web-browser.desktop $DESKTOP || true
chmod +x $DESKTOP/* # needs to be executable for 13.04+ chmod +x $DESKTOP/* # needs to be executable for 13.04+
# XFCE / theme customizations # XFCE / theme customizations
if [ -d /usr/share/themes/Clearlooks ] && \ if [ -d /usr/share/themes/Clearlooks ] ; then
[ -d /usr/share/icons/elementary-xfce ] ; then cat > /usr/share/gconf/defaults/88_nilmdbuntu-gtk-theme <<"EOF"
cat > /usr/share/gconf/defaults/88_nilmdbuntu-settings <<"EOF"
/desktop/gnome/interface/gtk_theme "Clearlooks" /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" /desktop/gnome/interface/icon_theme "elementary-xfce"
EOF EOF
update-gconf-defaults
fi fi
update-gconf-defaults
XML=/etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml XML=/etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml
BG=/usr/share/xfce4/backdrops BG=/usr/share/xfce4/backdrops
@@ -320,7 +366,7 @@ EOF
sed -i -s -e 's/Greybird/Default/g' $XML/xfwm4.xml || true 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/Greybird/Clearlooks/g' $XML/xsettings.xml || true
sed -i -s -e \ 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 # Firefox defaults
cat >/etc/firefox/syspref.js <<"EOF" cat >/etc/firefox/syspref.js <<"EOF"

View File

@@ -27,6 +27,10 @@ run() {
} }
set -e 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 proc none ${FS}/proc
mount -t sysfs none ${FS}/sys mount -t sysfs none ${FS}/sys
mount -t devpts none ${FS}/dev/pts 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 "echo 'nameserver 8.8.8.8' > /etc/resolv.conf"
run "dbus-uuidgen > /var/lib/dbus/machine-id" run "dbus-uuidgen > /var/lib/dbus/machine-id"
run "dpkg-divert --local --rename --add /sbin/initctl" 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 "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 set +e
if [ -z "$1" ] ; then if [ -z "$1" ] ; then