--- /dev/null
+#!/bin/sh
+set -e
+
+CHANNEL=devel-proposed
+MYNAME=$(getent passwd `whoami` | cut -f5 -d: | cut -f1 -d,)
+MYMAIL=${DEBMEMAIL:-$EMAIL}
+
+# flash the latest image
+phablet-flash ubuntu-system --no-backup --channel $CHANNEL
+
+# make image writable
+adb shell "touch /userdata/.writable_image"
+# configure timezone
+adb shell "timedatectl set-timezone `cat /etc/timezone`"
+
+echo "rebooting to activate writable image..."
+adb reboot
+adb wait-for-device
+
+# install some necessary packages
+echo "connect to wifi now and press Enter"
+read n
+adb shell "apt-get install -y vim bzr ubuntu-ui-toolkit-autopilot ofono-phonesim"
+
+# set up bzr, vim, ssh
+adb shell "su -c 'mkdir ~/.ssh' phablet"
+adb push ~/.ssh/id_rsa.pub /home/phablet/.ssh/authorized_keys
+adb shell "chmod 600 /home/phablet/.ssh/authorized_keys"
+if [ -e ~/.vimrc ]; then
+ adb push ~/.vimrc /home/phablet/.vimrc
+ adb shell "echo 'set bg=light' >> /home/phablet/.vimrc"
+fi
+adb shell "chown -R phablet:phablet /home/phablet"
+
+# start ssh
+adb shell "start ssh"
+adb forward tcp:22000 tcp:22
killall apt-get || true
apt-get update
-DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y --force-yes vim patchutils offlineimap diffstat gtimelog libtool devhelp python3-doc manpages-dev weechat weechat-plugins weechat-scripts wdiff ccache listadmin quilt mutt editmoin lintian ubuntu-dev-tools dput easytag rsnapshot texlive-lang-german texlive-latex-extra powertop qemu-kvm qemu-utils bzr-buildpackage git build-essential fakeroot devscripts libglib2.0-doc libgtk-3-doc git-buildpackage d-feet debootstrap wmctrl mumble libnotify-bin svn-buildpackage pastebinit lptools openvpn pdfjam sbuild schroot exiv2 android-tools-adb phablet-tools gstreamer1.0-plugins-ugly flashplugin-installer valgrind
+DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y --force-yes vim patchutils offlineimap diffstat gtimelog libtool devhelp python3-doc manpages-dev weechat weechat-plugins weechat-scripts wdiff ccache listadmin quilt mutt editmoin lintian ubuntu-dev-tools dput easytag rsnapshot texlive-lang-german texlive-latex-extra powertop qemu-kvm qemu-utils bzr-buildpackage git build-essential fakeroot devscripts libglib2.0-doc libgtk-3-doc git-buildpackage d-feet debootstrap wmctrl mumble libnotify-bin svn-buildpackage pastebinit lptools openvpn pdfjam sbuild schroot exiv2 android-tools-adb phablet-tools gstreamer1.0-plugins-ugly flashplugin-installer valgrind calibre
apt-get -y --no-install-recommends build-dep postgresql-9.1 apport calibre gvfs udisks2 upower gnome-disk-utility systemd pygobject umockdev