From 559b695a8518db9792fb67ef74e1d16a98d4b50a Mon Sep 17 00:00:00 2001
From: Oliver Grawert <ogra@ubuntu.com>
Date: Tue, 28 May 2013 11:13:57 +0200
Subject: [PATCH] Import patches-unapplied version 2.137 to
 ubuntu/saucy-proposed

Imported using git-ubuntu import.

Changelog parent: 0022f57f81f1370338635a8cd0c59776e6ff95bd

New changelog entries:
  * clear up /var/lib/initramfs-tools/ in the chroot after building initrds
  * remove ubuntu-touch/hooks/49-setup-demo-assets.chroot
  * handle sources.list in ubuntu-touch initrd creation
---
 debian/changelog                              |  8 +++++
 live-build/auto/build                         | 31 ++++++++++++++-----
 .../hooks/49-setup-demo-assets.chroot         | 15 ---------
 3 files changed, 31 insertions(+), 23 deletions(-)
 delete mode 100755 live-build/ubuntu-touch/hooks/49-setup-demo-assets.chroot

diff --git a/debian/changelog b/debian/changelog
index 8d767d67..aee51826 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+livecd-rootfs (2.137) saucy; urgency=low
+
+  * clear up /var/lib/initramfs-tools/ in the chroot after building initrds
+  * remove ubuntu-touch/hooks/49-setup-demo-assets.chroot
+  * handle sources.list in ubuntu-touch initrd creation
+
+ -- Oliver Grawert <ogra@ubuntu.com>  Tue, 28 May 2013 11:13:57 +0200
+
 livecd-rootfs (2.136) saucy; urgency=low
 
   * ubuntu-touch: determine the value for $kver inside the chroot, not
diff --git a/live-build/auto/build b/live-build/auto/build
index d44aecde..e093e98b 100755
--- a/live-build/auto/build
+++ b/live-build/auto/build
@@ -404,12 +404,19 @@ if [ "$SUBARCH" = "ac100" ] || [ "$SUBARCH" = "nexus7" ]; then
 fi
 
 if [ "$PROJECT" = "ubuntu-touch" ] && [ "$ARCH" = "armhf" ]; then
-	for subarch in maguro manta grouper mako; do
+	touchsubarches="maguro manta grouper mako"
 
-		lb chroot_proc install "$@"
-		lb chroot_sysfs install "$@"
-		lb chroot_devpts install "$@"
+	sourceslist="chroot/etc/apt/sources.list"
 
+	lb chroot_proc install "$@"
+	lb chroot_sysfs install "$@"
+	lb chroot_devpts install "$@"
+
+	mv "${sourceslist}" "${sourceslist}.orig"
+	echo "deb http://ftpmaster.internal/ubuntu/ $codename main universe" >$sourceslist
+	Chroot chroot "apt-get -y update"
+
+	for subarch in $touchsubarches; do
 		kpkg="$(Chroot chroot apt-cache depends linux-image-$subarch|grep Depends|sed -e 's/  Depends: //')"
 		kver=${kpkg#linux-image-}
 		Chroot chroot "apt-get -y install $kpkg"
@@ -420,14 +427,22 @@ if [ "$PROJECT" = "ubuntu-touch" ] && [ "$ARCH" = "armhf" ]; then
 
 		Chroot chroot "apt-get -y purge $kpkg"
 
-		lb chroot_devpts remove "$@"
-		lb chroot_sysfs remove "$@"
-		lb chroot_proc remove "$@"
-
 		cp "chroot/boot/bootimg-${subarch}.img" "$PREFIX-${subarch}-boot.img"
 		rm "chroot/boot/bootimg-${subarch}.img" "/chroot/boot/initrd.img-"* "/chroot/boot/vmlinuz-"*
 	done
+
+	lb chroot_devpts remove "$@"
+	lb chroot_sysfs remove "$@"
+	lb chroot_proc remove "$@"
+
+	rm -rf chroot/var/lib/initramfs-tools/*
 	Chroot chroot "apt-get -y purge crda wireless-regdb"
+	Chroot chroot "apt-get -y clean"
+
+	mv $sourceslist.orig $sourceslist
+	for file in $(find chroot/var/lib/apt/lists/ -name ftpmaster.internal*); do
+		rm $file
+	done
 fi
 
 # LTSP chroot building (only in 32bit and for Edubuntu (DVD))
diff --git a/live-build/ubuntu-touch/hooks/49-setup-demo-assets.chroot b/live-build/ubuntu-touch/hooks/49-setup-demo-assets.chroot
deleted file mode 100755
index feb5d70e..00000000
--- a/live-build/ubuntu-touch/hooks/49-setup-demo-assets.chroot
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/bash
-
-# Extract pictures to user
-tar -C /home/phablet/Pictures/ --strip-components=1 -xzf \
-    /usr/share/demo-assets/pictures.tgz
-chown -R phablet:phablet /home/phablet/Pictures
-
-# Copy videos to user
-cp -p /usr/share/demo-assets/videos/* /home/phablet/Videos/
-chown -R phablet:phablet /home/phablet/Videos
-
-# Set up fake telepathy-logger data
-mkdir -p /home/phablet/.local/share/TpLogger/logs
-cp -aRp /usr/share/demo-assets/telephony-app/* /home/phablet/.local/share/TpLogger/logs
-chown -R phablet.phablet /home/phablet/.local/