diff -pruN 51/debian/changelog 51ubuntu3/debian/changelog
--- 51/debian/changelog	2015-07-25 17:19:09.000000000 +0000
+++ 51ubuntu3/debian/changelog	2016-05-25 20:38:45.000000000 +0000
@@ -1,3 +1,35 @@
+live-installer (51ubuntu3) yakkety; urgency=medium
+
+  * Don't impose a prefix on places paths that are already URIs. (LP: #1575652)
+
+ -- Mathieu Trudel-Lapierre <cyphermox@ubuntu.com>  Wed, 25 May 2016 16:38:38 -0400
+
+live-installer (51ubuntu2) xenial; urgency=medium
+
+  * Validate signatures on components exported via a mirror, based on
+    net-retriever code. LP: #1565889.
+
+ -- Dimitri John Ledkov <xnox@ubuntu.com>  Wed, 06 Apr 2016 21:54:15 +0100
+
+live-installer (51ubuntu1) xenial; urgency=low
+
+  * Merge from Debian unstable.  Remaining changes:
+    - live-installer.d/ubuntu-kernel: Try to copy the kernel from the
+      top-level CD filesystem rather than the squashfs, in case it has been
+      removed from the squashfs to save space.
+    - debian/live-installer.postinst, debian/live-installer.templates:
+      Support preseeding live-installer/net-image to download an image from
+      the network.
+    - Reconfigure popularity-contest to regenerate host ID.
+    - support/*: Try to fetch filesystem from /cdrom/install/filesystem.*,
+      used for images where only the base system is provided by a squashfs.
+    - Install a kernel unless the squashfs contains one.
+    - Strip /cdrom/ prefix from all places.
+    - Iterate through places with /cdrom/ prefix, and then with a $mirror
+      prefix, to fetch remotely, in case a cdrom is exported as a mirror.
+
+ -- Mathieu Trudel-Lapierre <mathieu-tl@ubuntu.com>  Wed, 23 Dec 2015 12:00:30 -0500
+
 live-installer (51) unstable; urgency=medium
 
   [ Updated translations ]
@@ -36,6 +68,31 @@ live-installer (47) unstable; urgency=lo
 
  -- Christian Perrier <bubulle@debian.org>  Sun, 08 Mar 2015 11:27:38 +0100
 
+live-installer (46ubuntu2) xenial; urgency=high
+
+  * Refactor how PLACES are searched for base filesystems.
+  * Strip /cdrom/ prefix from all places.
+  * Iterate through places with /cdrom/ prefix, and then with a $mirror
+    prefix, to fetch remotely, in case a cdrom is exported as a mirror.
+
+ -- Dimitri John Ledkov <xnox@ubuntu.com>  Wed, 16 Dec 2015 18:10:55 +0000
+
+live-installer (46ubuntu1) vivid; urgency=medium
+
+  * Resynchronise with Debian.  Remaining changes:
+    - live-installer.d/ubuntu-kernel: Try to copy the kernel from the
+      top-level CD filesystem rather than the squashfs, in case it has been
+      removed from the squashfs to save space.
+    - debian/live-installer.postinst, debian/live-installer.templates:
+      Support preseeding live-installer/net-image to download an image from
+      the network.
+    - Reconfigure popularity-contest to regenerate host ID.
+    - support/*: Try to fetch filesystem from /cdrom/install/filesystem.*,
+      used for images where only the base system is provided by a squashfs.
+    - Install a kernel unless the squashfs contains one.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Tue, 18 Nov 2014 15:54:24 +0000
+
 live-installer (46) unstable; urgency=medium
 
   [ Colin Watson ]
@@ -48,6 +105,23 @@ live-installer (46) unstable; urgency=me
 
  -- Christian Perrier <bubulle@debian.org>  Wed, 10 Sep 2014 12:15:01 +0200
 
+live-installer (45ubuntu1) utopic; urgency=medium
+
+  * Resynchronise with Debian.  Remaining changes:
+    - live-installer.d/ubuntu-kernel: Try to copy the kernel from the
+      top-level CD filesystem rather than the squashfs, in case it has been
+      removed from the squashfs to save space.
+    - debian/live-installer.postinst, debian/live-installer.templates:
+      Support preseeding live-installer/net-image to download an image from
+      the network.
+    - Reconfigure popularity-contest to regenerate host ID.
+    - support/*: Try to fetch filesystem from /cdrom/install/filesystem.*,
+      used for images where only the base system is provided by a squashfs.
+    - Install a kernel unless the squashfs contains one.
+    - Copy extended attributes to target system.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Thu, 05 Jun 2014 11:04:35 +0100
+
 live-installer (45) unstable; urgency=low
 
   [ Updated translations ]
@@ -55,6 +129,28 @@ live-installer (45) unstable; urgency=lo
 
  -- Christian Perrier <bubulle@debian.org>  Sun, 10 Nov 2013 14:27:56 +0100
 
+live-installer (44ubuntu2) trusty; urgency=medium
+
+  * Copy extended attributes to target system (LP: #1302192).
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Wed, 09 Apr 2014 21:45:23 +0100
+
+live-installer (44ubuntu1) trusty; urgency=low
+
+  * Resynchronise with Debian.  Remaining changes:
+    - live-installer.d/ubuntu-kernel: Try to copy the kernel from the
+      top-level CD filesystem rather than the squashfs, in case it has been
+      removed from the squashfs to save space.
+    - debian/live-installer.postinst, debian/live-installer.templates:
+      Support preseeding live-installer/net-image to download an image from
+      the network.
+    - Reconfigure popularity-contest to regenerate host ID.
+    - support/*: Try to fetch filesystem from /cdrom/install/filesystem.*,
+      used for images where only the base system is provided by a squashfs.
+    - Install a kernel unless the squashfs contains one.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Tue, 29 Oct 2013 17:23:20 -0700
+
 live-installer (44) unstable; urgency=low
 
   [ Raphaël Hertzog ]
@@ -67,6 +163,22 @@ live-installer (44) unstable; urgency=lo
 
  -- Christian Perrier <bubulle@debian.org>  Sun, 08 Sep 2013 10:03:20 +0200
 
+live-installer (42ubuntu1) saucy; urgency=low
+
+  * Resynchronise with Debian.  Remaining changes:
+    - live-installer.d/ubuntu-kernel: Try to copy the kernel from the
+      top-level CD filesystem rather than the squashfs, in case it has been
+      removed from the squashfs to save space.
+    - debian/live-installer.postinst, debian/live-installer.templates:
+      Support preseeding live-installer/net-image to download an image from
+      the network.
+    - Reconfigure popularity-contest to regenerate host ID.
+    - support/*: Try to fetch filesystem from /cdrom/install/filesystem.*,
+      used for images where only the base system is provided by a squashfs.
+    - Install a kernel unless the squashfs contains one.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Fri, 02 Aug 2013 11:52:44 +0100
+
 live-installer (42) unstable; urgency=low
 
   [ Dmitrijs Ledkovs ]
@@ -77,6 +189,22 @@ live-installer (42) unstable; urgency=lo
 
  -- Christian Perrier <bubulle@debian.org>  Sun, 14 Jul 2013 13:17:07 +0200
 
+live-installer (41ubuntu1) saucy; urgency=low
+
+  * Resynchronise with Debian.  Remaining changes:
+    - live-installer.d/ubuntu-kernel: Try to copy the kernel from the
+      top-level CD filesystem rather than the squashfs, in case it has been
+      removed from the squashfs to save space.
+    - debian/live-installer.postinst, debian/live-installer.templates:
+      Support preseeding live-installer/net-image to download an image from
+      the network.
+    - Reconfigure popularity-contest to regenerate host ID.
+    - support/*: Try to fetch filesystem from /cdrom/install/filesystem.*,
+      used for images where only the base system is provided by a squashfs.
+    - Install a kernel unless the squashfs contains one.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Tue, 28 May 2013 14:00:25 +0100
+
 live-installer (41) unstable; urgency=low
 
   [ Colin Watson ]
@@ -89,6 +217,22 @@ live-installer (41) unstable; urgency=lo
 
  -- Christian Perrier <bubulle@debian.org>  Fri, 17 May 2013 10:48:47 +0200
 
+live-installer (40ubuntu1) saucy; urgency=low
+
+  * Resynchronise with Debian.  Remaining changes:
+    - live-installer.d/ubuntu-kernel: Try to copy the kernel from the
+      top-level CD filesystem rather than the squashfs, in case it has been
+      removed from the squashfs to save space.
+    - debian/live-installer.postinst, debian/live-installer.templates:
+      Support preseeding live-installer/net-image to download an image from
+      the network.
+    - Reconfigure popularity-contest to regenerate host ID.
+    - support/*: Try to fetch filesystem from /cdrom/install/filesystem.*,
+      used for images where only the base system is provided by a squashfs.
+    - Install a kernel unless the squashfs contains one.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Sun, 28 Apr 2013 15:54:43 +0100
+
 live-installer (40) unstable; urgency=low
 
   [ Raphaël Hertzog ]
@@ -101,6 +245,22 @@ live-installer (40) unstable; urgency=lo
 
  -- Christian Perrier <bubulle@debian.org>  Sun, 03 Mar 2013 15:09:32 +0100
 
+live-installer (39ubuntu1) raring; urgency=low
+
+  * Resynchronise with Debian.  Remaining changes:
+    - live-installer.d/ubuntu-kernel: Try to copy the kernel from the
+      top-level CD filesystem rather than the squashfs, in case it has been
+      removed from the squashfs to save space.
+    - debian/live-installer.postinst, debian/live-installer.templates:
+      Support preseeding live-installer/net-image to download an image from
+      the network.
+    - Reconfigure popularity-contest to regenerate host ID.
+    - support/*: Try to fetch filesystem from /cdrom/install/filesystem.*,
+      used for images where only the base system is provided by a squashfs.
+    - Install a kernel unless the squashfs contains one.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Mon, 18 Feb 2013 16:41:44 +0000
+
 live-installer (39) unstable; urgency=low
 
   [ Raphaël Hertzog ]
@@ -111,6 +271,22 @@ live-installer (39) unstable; urgency=lo
 
  -- Christian Perrier <bubulle@debian.org>  Sat, 22 Dec 2012 14:50:47 +0100
 
+live-installer (38ubuntu1) raring; urgency=low
+
+  * Resynchronise with Debian.  Remaining changes:
+    - live-installer.d/ubuntu-kernel: Try to copy the kernel from the
+      top-level CD filesystem rather than the squashfs, in case it has been
+      removed from the squashfs to save space.
+    - debian/live-installer.postinst, debian/live-installer.templates:
+      Support preseeding live-installer/net-image to download an image from
+      the network.
+    - Reconfigure popularity-contest to regenerate host ID.
+    - support/*: Try to fetch filesystem from /cdrom/install/filesystem.*,
+      used for images where only the base system is provided by a squashfs.
+    - Install a kernel unless the squashfs contains one.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Thu, 20 Dec 2012 13:12:53 +0000
+
 live-installer (38) unstable; urgency=low
 
   [ Raphaël Hertzog ]
@@ -131,6 +307,61 @@ live-installer (37) unstable; urgency=lo
 
  -- Christian Perrier <bubulle@debian.org>  Sun, 05 Aug 2012 18:28:58 +0200
 
+live-installer (36ubuntu7) quantal; urgency=low
+
+  * debian/live-installer.postinst: Set SUBARCH (LP: #1054143).
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Mon, 24 Sep 2012 18:24:49 +0100
+
+live-installer (36ubuntu6) quantal; urgency=low
+
+  * Override the title template used by base-installer's kernel installation
+    code.  Requires base-installer 1.122ubuntu11.
+  * Don't try to copy the kernel image from the CD if the squashfs doesn't
+    contain a kernel package (LP: #1049011).
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Tue, 11 Sep 2012 10:32:52 +0100
+
+live-installer (36ubuntu5) quantal; urgency=low
+
+  * Install a kernel unless the squashfs contains one (LP: #1028453).
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Sun, 09 Sep 2012 16:38:17 +0100
+
+live-installer (36ubuntu4) quantal; urgency=low
+
+  * debian/live-installer.postinst: If using net-image, create the temporary
+    location to store the retrieved image, otherwise it fails. (LP: #1042906)
+
+ -- Dave Walker (Daviey) <DaveWalker@ubuntu.com>  Thu, 30 Aug 2012 12:21:45 +0100
+
+live-installer (36ubuntu3) quantal; urgency=low
+
+  * support/*: Try to fetch filesystem from /cdrom/install/filesystem.*,
+    used for images where only the base system is provided by a squashfs.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Tue, 31 Jul 2012 10:59:52 +0100
+
+live-installer (36ubuntu2) quantal; urgency=low
+
+  * Reconfigure popularity-contest to regenerate host ID.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Sun, 22 Jul 2012 01:29:23 +0100
+
+live-installer (36ubuntu1) quantal; urgency=low
+
+  * Resynchronise with Debian.  Remaining changes:
+    - live-installer.d/ubuntu-kernel: Try to copy the kernel from the
+      top-level CD filesystem rather than the squashfs, in case it has been
+      removed from the squashfs to save space.
+    - debian/live-installer.postinst, debian/live-installer.templates:
+      Support preseeding live-installer/net-image to download an image from
+      the network.
+  * live-installer.d/ubuntu-kernel: Try to copy the kernel from install/ as
+    well as from casper/.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Sun, 22 Jul 2012 00:41:03 +0100
+
 live-installer (36) unstable; urgency=low
 
   [ Christian Perrier ]
@@ -175,6 +406,17 @@ live-installer (35) unstable; urgency=lo
 
  -- Christian Perrier <bubulle@debian.org>  Fri, 15 Jun 2012 19:30:49 +0200
 
+live-installer (34ubuntu1) quantal; urgency=low
+
+  * live-installer.d/ubuntu-kernel: Try to copy the kernel from the
+    top-level CD filesystem rather than the squashfs, in case it has been
+    removed from the squashfs to save space.
+  * debian/live-installer.postinst, debian/live-installer.templates: Support
+    preseeding live-installer/net-image to download an image from the
+    network.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Tue, 22 May 2012 17:37:05 +0100
+
 live-installer (34) unstable; urgency=low
 
   * Updating package to debhelper version 8.
@@ -855,3 +1097,4 @@ live-installer (0) unstable; urgency=low
   * Traditional Chinese (zh_TW.po) by Tetralet
 
  -- Otavio Salvador <otavio@ossystems.com.br>  Fri, 29 Jun 2007 15:14:37 -0300
+
diff -pruN 51/debian/control 51ubuntu3/debian/control
--- 51/debian/control	2015-02-13 04:01:20.000000000 +0000
+++ 51ubuntu3/debian/control	2015-12-17 00:13:41.000000000 +0000
@@ -1,7 +1,8 @@
 Source: live-installer
 Section: debian-installer
 Priority: optional
-Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
 Uploaders:
  Otavio Salvador <otavio@debian.org>,
  Christian Perrier <bubulle@debian.org>
diff -pruN 51/debian/live-installer.postinst 51ubuntu3/debian/live-installer.postinst
--- 51/debian/live-installer.postinst	2014-09-10 10:14:46.000000000 +0000
+++ 51ubuntu3/debian/live-installer.postinst	2016-05-25 21:08:06.000000000 +0000
@@ -1,49 +1,109 @@
-#!/bin/sh -e
-
+#!/bin/sh
+set -e
 . /usr/share/debconf/confmodule
 db_capb backup
 
 . /usr/lib/base-installer/library.sh
 
+TITLE_TEMPLATE=debian-installer/live-installer/title
+
 # Architecture and OS detection
 ARCH=`udpkg --print-architecture`
 OS=`udpkg --print-os`
 # Files that must not be overwritten by copy of live system
 FILES_TO_PRESERVE="/etc/fstab /etc/crypttab"
 
+SUBARCH="$(archdetect)"
+SUBARCH="${SUBARCH#*/}"
+
 NEWLINE="
 "
+keyring_dir=/usr/share/keyrings
+read_gpg_status() {
+	while read prefix keyword rest; do
+		[ "$prefix" = '[GNUPG:]' ] || continue
+		if [ "$keyword" = VALIDSIG ]; then
+			exit 0
+		fi
+	done
+	exit 1
+}
+
+# See kernel/README for the architecture-specific functions expected here
+if [ -f /usr/lib/base-installer/kernel.sh ]; then
+	. /usr/lib/base-installer/kernel.sh
+else
+	arch_get_kernel_flavour () {
+		warning "Unknown architecture '$ARCH'."
+		return 0
+	}
+	arch_check_usable_kernel () {
+		warning "Unknown architecture '$ARCH'."
+		return 0
+	}
+	arch_get_kernel () {
+		warning "Unknown architecture '$ARCH'."
+	}
+fi
+
+FLAVOUR="$(arch_get_kernel_flavour || true)"
 
 db_input low live-installer/mode || true
 db_go || exit 10 # back to menu
 db_get live-installer/mode
 mode="$RET"
+PLACE_FOUND=0
 
-install_live_system () {
-	# Look at
-	PLACES=""
-	PLACE_FOUND=0
-
-	# Load filesystem support
-	for script in $(ls /lib/live-installer/*); do
-		. $script
-	done
-
-	# XXX: To be dropped in jessie when a fixed partman-target is made
-	# available.
-	# Drop /var/lock and /var/run directories created by
-	# partman-target so that the tar call that follows can install
-	# symlinks there.
-	rmdir /target/var/lock /target/var/run 2>/dev/null || true
-
-	# Backup files that should not be overwritten by the copy
-	for f in $FILES_TO_PRESERVE; do
-	    if [ -e /target$f ] && [ ! -e /target/${f}.live-installer ]; then
-		mv /target$f /target${f}.live-installer
-	    fi
-	done
+process_places () {
+	PLACES="$1"
+	PREFIX="$2"
+	VERIFY="$3"
 
 	for place in $PLACES; do
+		if [ -n "$PREFIX" ] && ! echo "$place" | grep -qc '://'; then
+			place=$PREFIX$place
+		fi
+		case $place in
+		    *://*)
+			tmpdir=/tmp/live-installer
+			mkdir -p /tmp/live-installer
+			info "Downloading $place to $tmpdir/${place##*/}"
+			fetch-url "$place" "$tmpdir/${place##*/}" || continue
+			Component="$tmpdir/${place##*/}"			
+			if type gpgv >/dev/null && [ -d "$keyring_dir" ] && [ "$VERIFY" != "false" ]; then
+				if db_get debian-installer/allow_unauthenticated && [ "$RET" = true ]; then
+					log "Not verifying $Component signature: unauthenticated mode enabled"
+				else
+					if ! fetch-url "$place.gpg" "$Component.gpg"; then
+						log "$Component is unsigned"
+						continue
+					fi
+					for keyring in $keyring_dir/*; do
+						# on each iteration, clear the badsig flag
+						badsig=false
+
+						if ! log-output -t live-installer --pass-stdout \
+						     gpgv --status-fd 1 --keyring "$keyring" \
+						     --ignore-time-conflict \
+						     "$Component.gpg" "$Component" | read_gpg_status; then
+							badsig=true
+						else
+							break
+						fi	
+					done
+					if [ "$badsig" = true ]; then
+						log "Bad signature on $Component."
+						continue
+					fi
+				fi
+			fi
+			place=$Component
+			;;
+		    *)
+			tmpdir=
+			;;
+		esac
+
 		[ ! -e $place ] && continue
 
 		SUPPORT=$(echo $place | sed 's,.*\.\(.*\)$,\1,g')
@@ -82,11 +142,14 @@ install_live_system () {
 		exec 0>&4
 		IFS=$OLD_IFS
 		getfattr --dump --no-dereference --match=- --recursive . | \
-			(cd /target && setfattr --no-dereference --restore=-) \
-			|| true
+			(cd /target && setfattr --no-dereference --restore=-) || true
 
 		chdir /
 		eval ${SUPPORT}_teardown
+
+		if [ "$tmpdir" ]; then
+			rm -rf "$tmpdir"
+		fi
 	done
 
 	# Restore important configuration files
@@ -95,6 +158,58 @@ install_live_system () {
 			mv /target${f}.live-installer /target$f
 		fi
 	done
+}
+
+install_live_system () {
+	# Look at
+	PLACES=""
+
+	# Load filesystem support
+	for script in $(ls /lib/live-installer/*); do
+		. $script
+	done
+
+	if db_get live-installer/net-image && [ "$RET" ]; then
+		PLACES="$RET $PLACES"
+	fi
+
+	# XXX: To be dropped in jessie when a fixed partman-target is made
+	# available.
+	# Drop /var/lock and /var/run directories created by
+	# partman-target so that the tar call that follows can install
+	# symlinks there.
+	rmdir /target/var/lock /target/var/run 2>/dev/null || true
+
+	# Backup files that should not be overwritten by the copy
+	for f in $FILES_TO_PRESERVE; do
+		if [ -e /target$f ] && [ ! -e /target/${f}.live-installer ]; then
+			mv /target$f /target${f}.live-installer
+		fi
+	done
+
+	# look for explitly passed places, and local mounted things,
+	# do not verify
+	process_places "$PLACES" "/cdrom" "false"
+
+	if [ ${PLACE_FOUND} -eq 0 ]; then
+		# Did not find anything, what if there is a remote export?!
+		db_get mirror/protocol
+		protocol="$RET"
+		db_get mirror/$protocol/hostname
+		hostname="$RET"
+		db_get mirror/$protocol/directory
+		directory="/${RET#/}"
+		tmpdir=/tmp/live-installer
+		mkdir -p $tmpdir
+		PREFIX=$protocol://$hostname$directory
+		RET=0
+		fetch-url $PREFIX/.disk/base_installable $tmpdir/.base_installable 2>/dev/null || RET="$?"
+		if [ "$RET" -eq 0 ]; then
+			# possibly export of the CD, try fetching live image from there
+			# attempt to verify
+			process_places "$PLACES" "$PREFIX" "true"
+		fi
+	fi
 
 	if [ ${PLACE_FOUND} -eq 0 ]; then
 		error "Could not find any live images"
@@ -155,6 +270,16 @@ install_live_system () {
 	done
 }
 
+pick_kernel_if_missing () {
+	for kernel in /target/boot/vmlinu*; do
+		if [ -e "$kernel" ]; then
+			info "Kernel already present ($kernel)"
+			return
+		fi
+	done
+	pick_kernel
+}
+
 waypoint 1	check_target
 waypoint 1	get_mirror_info
 waypoint 100	install_live_system
@@ -164,8 +289,8 @@ waypoint 1	configure_apt_preferences
 waypoint 1	configure_apt
 waypoint 3	apt_update
 waypoint 5	post_install_hooks
-#waypoint 1	pick_kernel
-#waypoint 20	install_linux
+waypoint 1	pick_kernel_if_missing
+waypoint 20	install_kernel
 waypoint 10	install_extra
 waypoint 0	final_apt_preferences
 waypoint 0	cleanup
diff -pruN 51/debian/live-installer.templates 51ubuntu3/debian/live-installer.templates
--- 51/debian/live-installer.templates	2011-01-19 04:45:08.000000000 +0000
+++ 51ubuntu3/debian/live-installer.templates	2015-12-17 00:13:41.000000000 +0000
@@ -55,3 +55,9 @@ Type: boolean
 Default: true
 Description: for internal use; can be preseeded
  If false, uses base-installer for installation
+
+Template: live-installer/net-image
+Type: string
+Description: for internal use; can be preseeded
+ If set, download an image from the network.  Currently, the URL must end
+ with .btrfs, .ext2, .ext3, .ext4, or .squashfs.
diff -pruN 51/live-installer.d/popularity-contest 51ubuntu3/live-installer.d/popularity-contest
--- 51/live-installer.d/popularity-contest	1970-01-01 00:00:00.000000000 +0000
+++ 51ubuntu3/live-installer.d/popularity-contest	2012-07-22 00:27:40.000000000 +0000
@@ -0,0 +1,23 @@
+#!/bin/sh -e
+
+# Unfortunately, we can't use in-target here as this doesn't allow to set the
+# debconf frontend to noninteractive.
+
+. /lib/chroot-setup.sh
+
+if ! chroot_setup; then
+	logger -t live-installer -- "Unexpected error; command not executed: '$@'"
+	exit 1
+fi
+
+DEBIAN_FRONTEND=noninteractive
+export DEBIAN_FRONTEND
+
+# Reconfigure popularity-contest to regenerate host ID
+if [ -e /target/etc/popularity-contest.conf ]; then
+	rm -f /target/etc/popularity-contest.conf
+	log-output -t live-installer chroot /target \
+	dpkg-reconfigure --no-reload popularity-contest
+fi
+
+chroot_cleanup
diff -pruN 51/live-installer.d/ubuntu-kernel 51ubuntu3/live-installer.d/ubuntu-kernel
--- 51/live-installer.d/ubuntu-kernel	1970-01-01 00:00:00.000000000 +0000
+++ 51ubuntu3/live-installer.d/ubuntu-kernel	2012-09-11 09:26:50.000000000 +0000
@@ -0,0 +1,55 @@
+#!/bin/sh -e
+
+# If we've installed a kernel already, we're done.
+if ls /target/boot/vmlinu* >/dev/null 2>&1; then
+	exit 0
+fi
+
+# If no kernel package is installed, we don't need to repair it.
+if ! ls /target/boot/System.map* >/dev/null 2>&1; then
+	exit 0
+fi
+
+# Try some possible locations for the kernel we used to boot.  This lets us
+# save a couple of megabytes of CD space.
+
+find_cd_kernel () {
+	# Find the boot kernel on the CD, if possible.
+	local subarch prefix kernel
+
+	subarch="$(uname -r | cut -d- -f3)"
+	for dir in casper install; do
+		for prefix in vmlinux vmlinuz; do
+			kernel="/cdrom/$dir/$prefix"
+			if [ -e "$kernel" ]; then
+				echo "$kernel"
+				return
+			fi
+
+			if [ "$subarch" ]; then
+				kernel="/cdrom/$dir/$subarch/$prefix"
+				if [ -e "$kernel" ]; then
+					echo "$kernel"
+					return
+				fi
+
+				kernel="/cdrom/$dir/$prefix-$subarch"
+				if [ -e "$kernel" ]; then
+					echo "$kernel"
+					return
+				fi
+			fi
+		done
+	done
+}
+
+kernel="$(find_cd_kernel)"
+if [ "$kernel" ]; then
+	prefix="$(basename "$kernel" | cut -d- -f1)"
+	release="$(uname -r)"
+	target_kernel="/target/boot/$prefix-$release"
+	rm -f "$target_kernel"
+	cp -a "$kernel" "$target_kernel"
+fi
+
+exit 0
diff -pruN 51/support/btrfs 51ubuntu3/support/btrfs
--- 51/support/btrfs	2011-10-29 01:01:22.000000000 +0000
+++ 51ubuntu3/support/btrfs	2015-12-17 00:13:41.000000000 +0000
@@ -1,9 +1,10 @@
 #!/bin/sh -e
 
 # Debian (live-boot)
-PLACES="$PLACES /cdrom/live/filesystem.btrfs"
+PLACES="$PLACES /live/filesystem.btrfs"
 # Ubuntu (casper)
-PLACES="$PLACES /cdrom/casper/filesystem.btrfs"
+PLACES="$PLACES /casper/filesystem.btrfs"
+PLACES="$PLACES /install/filesystem.btrfs"
 
 btrfs_prepare() {
 	ANNA_QUIET=1 anna-install btrfs-modules || true
diff -pruN 51/support/dir 51ubuntu3/support/dir
--- 51/support/dir	2011-10-29 01:01:22.000000000 +0000
+++ 51ubuntu3/support/dir	2015-12-17 00:13:41.000000000 +0000
@@ -1,9 +1,10 @@
 #!/bin/sh -e
 
 # Debian (live-boot)
-PLACES="$PLACES /cdrom/live/filesystem.dir"
+PLACES="$PLACES /live/filesystem.dir"
 # Ubuntu (casper)
-PLACES="$PLACES /cdrom/casper/filesystem.dir"
+PLACES="$PLACES /casper/filesystem.dir"
+PLACES="$PLACES /install/filesystem.dir"
 
 dir_prepare() {
 	cd $place
diff -pruN 51/support/extX 51ubuntu3/support/extX
--- 51/support/extX	2011-10-29 01:01:22.000000000 +0000
+++ 51ubuntu3/support/extX	2015-12-17 00:13:41.000000000 +0000
@@ -1,9 +1,10 @@
 #!/bin/sh -e
 
 # Debian (live-boot)
-PLACES="$PLACES /cdrom/live/filesystem.ext2 /cdrom/live/filesystem.ext3 /cdrom/live/filesystem.ext4"
+PLACES="$PLACES /live/filesystem.ext2 /live/filesystem.ext3 /live/filesystem.ext4"
 # Ubuntu (casper)
-PLACES="$PLACES /cdrom/casper/filesystem.ext2 /cdrom/casper/filesystem.ext3 /cdrom/casper/filesystem.ext4"
+PLACES="$PLACES /casper/filesystem.ext2 /casper/filesystem.ext3 /casper/filesystem.ext4"
+PLACES="$PLACES /install/filesystem.ext2 /install/filesystem.ext3 /install/filesystem.ext4"
 
 extX_prepare() {
 	ANNA_QUIET=1 anna-install ${1}-modules || true
diff -pruN 51/support/squashfs 51ubuntu3/support/squashfs
--- 51/support/squashfs	2011-10-29 01:01:22.000000000 +0000
+++ 51ubuntu3/support/squashfs	2015-12-17 00:13:41.000000000 +0000
@@ -1,9 +1,10 @@
 #!/bin/sh -e
 
 # Debian (live-boot)
-PLACES="$PLACES /cdrom/live/filesystem.squashfs"
+PLACES="$PLACES /live/filesystem.squashfs"
 # Ubuntu (casper)
-PLACES="$PLACES /cdrom/casper/filesystem.squashfs"
+PLACES="$PLACES /casper/filesystem.squashfs"
+PLACES="$PLACES /install/filesystem.squashfs"
 
 squashfs_prepare() {
 	ANNA_QUIET=1 anna-install squashfs-modules || true
