[SCM] live-initramfs branch, upstream, updated. upstream/1.215.1-1-g35667bd

Daniel Baumann daniel at debian.org
Sun May 16 04:12:28 UTC 2010


The following commit has been merged in the upstream branch:
commit 35667bd4deb41faa9247fb7321a4d15e7f524cf7
Author: Daniel Baumann <daniel at debian.org>
Date:   Sun May 16 06:06:14 2010 +0200

    Adding upstream version 1.236.1.

diff --git a/Makefile b/Makefile
index 73bf2ba..a03d75f 100644
--- a/Makefile
+++ b/Makefile
@@ -32,7 +32,7 @@ install: test build
 	cp bin/live-getty bin/live-login bin/live-new-uuid bin/live-snapshot bin/live-swapfile $(DESTDIR)/sbin
 
 	mkdir -p $(DESTDIR)/usr/share/live-initramfs
-	cp bin/live-preseed bin/live-reconfigure contrib/languagelist $(DESTDIR)/usr/share/live-initramfs
+	cp bin/live-preseed bin/live-reconfigure bin/live-set-selections contrib/languagelist $(DESTDIR)/usr/share/live-initramfs
 
 	mkdir -p $(DESTDIR)/usr/share/initramfs-tools
 	cp -r hooks scripts $(DESTDIR)/usr/share/initramfs-tools
diff --git a/bin/live-preseed b/bin/live-preseed
index d98c4f3..add29bd 100755
--- a/bin/live-preseed
+++ b/bin/live-preseed
@@ -4,22 +4,29 @@ set -e
 
 PATH=/usr/sbin:/usr/bin:/sbin:/bin
 
+# Only do this once
+if [ -z "${DEBCONF_REDIR}" ]
+then
+	exec <&4
+	export DEBIAN_HAS_FRONTEND=1
+	export DEBCONF_REDIR=1
+fi
+
 root="${1}"
+. "$root/usr/share/debconf/confmodule"
+
 question="${2}"
 value="${3}"
 seen="${4}"
 
 [ "${seen}" ] || seen=true
 
-if ! (echo "SET ${question} ${value}"; echo "FSET ${question} seen ${seen}") | chroot "${1}" /usr/bin/debconf-communicate -fnoninteractive live-initramfs >/dev/null
+if ! db_set "${question}" "${value}"
 then
-
-chroot "${1}" /usr/bin/debconf-communicate -fnoninteractive live-initramfs >/dev/null << EOF
-REGISTER debian-installer/dummy ${question}
-SET ${question} ${value}
-FSET ${question} seen ${seen}
-EOF
-
+	db_register debian-installer/dummy "${question}"
+	db_set "${question}" "${value}"
 fi
 
+db_fset "${question}" seen "${seen}"
+
 exit 0
diff --git a/bin/live-set-selections b/bin/live-set-selections
new file mode 100755
index 0000000..c4c38dd
--- /dev/null
+++ b/bin/live-set-selections
@@ -0,0 +1,92 @@
+#!/bin/sh
+# Cloned-and-hacked from preseed/debconf-set-selections for live-initramfs.
+set -e
+
+OLDIFS="$IFS"
+CR=$(echo -en "\r")
+NL="
+"
+
+. /scripts/live-functions
+load_confmodule
+
+# Returns the first field in the current line
+first_field() {
+	echo "$line" | grep -q "[[:space:]]" || return 1
+	echo "$line" | sed -r 's/^([^[:space:]]*).*/\1/'
+}
+
+# Returns any fields after the first field in the current line
+rest_line() {
+	if echo "$line" | grep -q "[[:space:]]"; then
+		echo "$line" | sed 's/^[^[:space:]]*[[:space:]]*//'
+	fi
+}
+
+SEEN=1
+if [ "$1" = --unseen ]; then
+	SEEN=
+	shift
+fi
+
+file="$1"
+
+parse_error() {
+	echo "Error parsing preconfiguration file: $*" >&2
+	exit 1
+}
+
+IFS="$NL"
+multiline=""
+# TODO: this squashes \r elsewhere in the line too
+for line in $(grep -v '^#\|^[[:space:]]*$' "$file" | sed "s/$CR//g"); do
+	IFS="$OLDIFS"
+
+	line="$(echo "$line" | sed 's/^[[:space:]]*//')"
+	if echo "$line" | grep -q '\\$'; then
+		multiline="${multiline:+$multiline }$(echo "$line" | \
+			sed 's/[[:space:]]*\\$//')"
+		continue
+	elif [ -n "$multiline" ]; then
+		line="$multiline $line"
+		multiline=""
+	fi
+
+	package=""
+	var=""
+	type=""
+	val=""
+	if ! package="$(first_field)"; then
+		parse_error "Syntax error: unable to determine template owner"
+	fi
+	line="$(rest_line)"
+	if ! var="$(first_field)"; then
+		parse_error "Syntax error: unable to determine template name"
+	fi
+	line="$(rest_line)"
+	if ! type="$(first_field)"; then
+		# Allow for lines without separator before an empty value
+		if [ "$line" ]; then
+			type="$line"
+		else
+			parse_error "Syntax error: unable to determine template type"
+		fi
+	fi
+	line="$(rest_line)"
+	val="$line"
+
+	if [ "$type" = seen ]; then
+		# Set seen flag.
+		db_fset "$var" "$type" "$val" || true # how to handle this error?
+	else
+		if ! db_set "$var" "$val"; then
+			# Question does not exist yet.
+			db_register debian-installer/dummy "$var"
+			db_set "$var" "$val"
+			db_subst "$var" ID "$var"
+		fi
+		if [ "$SEEN" ]; then
+			db_fset "$var" seen true
+		fi
+	fi
+done
diff --git a/conf/compcache b/conf/compcache
index c93c776..4e04878 100644
--- a/conf/compcache
+++ b/conf/compcache
@@ -1 +1 @@
-COMPCACHE_SIZE="25%"
+COMPCACHE_SIZE="50%"
diff --git a/docs/ChangeLog.casper b/docs/ChangeLog.casper
index 2bed515..89ac843 100644
--- a/docs/ChangeLog.casper
+++ b/docs/ChangeLog.casper
@@ -1,3 +1,222 @@
+casper (1.236) lucid; urgency=low
+
+  * Check for LTS in the release name (LP: #558488).
+
+ -- Evan Dandrea <evand at ubuntu.com>  Wed, 21 Apr 2010 11:12:32 +0100
+
+casper (1.235) lucid; urgency=low
+
+  * Unbreak early command from previous commit.
+
+ -- Mario Limonciello <Mario_Limonciello at Dell.com>  Thu, 15 Apr 2010 02:54:15 -0500
+
+casper (1.234) lucid; urgency=low
+
+  * Only bring the network up while running preseed/early_command if
+    preseed/allow-network=true.
+
+ -- Colin Watson <cjwatson at ubuntu.com>  Wed, 14 Apr 2010 15:56:40 +0100
+
+casper (1.233) lucid; urgency=low
+
+  * Bring the network up while running preseed/early_command.
+  * Fix use of debconf passthrough frontend; DEBCONF_READFD and
+    DEBCONF_WRITEFD were backwards, and DEBIAN_HAS_FRONTEND and
+    DEBCONF_REDIR needed to be unset or else confmodule scripts would end up
+    trying to talk to closed file descriptors.
+  * Run debconf-communicate with a read-only template database and separate
+    config databases, and copy any changed values back to the master
+    databases at the end.  This allows us to use the noninteractive frontend
+    rather than passthrough when running apt-get in preseed/early_command or
+    dpkg to install driver updates, thereby ensuring that the template
+    database is properly initialised (LP: #557011).
+
+ -- Colin Watson <cjwatson at ubuntu.com>  Mon, 12 Apr 2010 23:41:09 +0100
+
+casper (1.232) lucid; urgency=low
+
+  * bump compcache size to 50% on live images for machines with less than
+    512MiB. This makes sure we don't hit OOM errors on systems with only
+    256MiB of RAM.
+
+ -- Oliver Grawert <ogra at ubuntu.com>  Mon, 12 Apr 2010 08:10:06 +0200
+
+casper (1.231) lucid; urgency=low
+
+  [ Jonathan Riddell ]
+  * Remove 37kubuntu_netbook_installer_link, now done with a patch in
+    kdebase-workspace
+
+  [ Colin Watson ]
+  * If copying live media to RAM or disk, explicitly copy .disk, since *
+    won't expand to include it (LP: #526305).
+  * Cache /bin/plymouth and /sbin/usplash_write before ejecting the CD, in
+   the hope that that helps with I/O errors on reboot (see LP #539027).
+
+  [ Luke Yelavich ]
+  * ubiquity-hooks/30accessibility: Copy the orca settings directory to the
+    gdm home directory, to allow for preferred orca settings to be used in
+    gdm (LP: #551515).
+
+ -- Luke Yelavich <themuso at ubuntu.com>  Fri, 09 Apr 2010 14:00:51 +1000
+
+casper (1.230) lucid; urgency=low
+
+  * Don't save the hardware clock on live CD reboot; we used to do this in
+    the sysvinit world, but it regressed when we switched to Upstart
+    (thanks, Norm Pierce; LP: #436535).
+  * When running update-initramfs on writable media, update initrd.lz rather
+    than initrd.gz if it's present, and make the update process a bit safer
+    while we're there (LP: #489736).
+  * Handle toram and todisk=DEVICE options on command line (LP: #526305).
+  * Policy version 3.8.4: no changes required.
+  * Convert to source format 3.0 (native).
+
+ -- Colin Watson <cjwatson at ubuntu.com>  Tue, 30 Mar 2010 11:41:24 +0100
+
+casper (1.229) lucid; urgency=low
+
+  [ Jonathan Riddell ]
+  * Update scripts/casper-bottom/34disable_kde_services for lucid
+
+  [ Evan Dandrea ]
+  * Don't let apt try to auto-detect the CD-ROM device using udev.  We
+    already know what it is, and using udev to find it again wont work
+    for USB disks.
+
+ -- Evan Dandrea <evand at ubuntu.com>  Tue, 23 Mar 2010 11:42:00 +0000
+
+casper (1.228) lucid; urgency=low
+
+  * Update for the new libplymouth2.
+
+ -- Steve Langasek <steve.langasek at ubuntu.com>  Fri, 12 Mar 2010 18:37:02 -0800
+
+casper (1.227) lucid; urgency=low
+
+  * casper-md5check: port from usplash to plymouth.  LP: #500198
+  * fix up our reliance on usplash, /dev/console elsewhere.  LP: #506418.
+
+ -- Steve Langasek <steve.langasek at ubuntu.com>  Fri, 12 Mar 2010 01:12:28 -0800
+
+casper (1.226) lucid; urgency=low
+
+  [ Colin Watson ]
+  * Stop using removed nfsro option for NFS/unionfs (thanks, Bernhard
+    Seibold; LP: #460781).
+
+  [ Jonathan Riddell ]
+  * Remove scripts/casper-bottom/48enable_kubuntu_netbook and ubiquity-
+    hooks/48enable_kubuntu_netbook now enabled in kubuntu-netbook-
+    default-settings
+
+ -- Jonathan Riddell <jriddell at ubuntu.com>  Wed, 10 Mar 2010 22:23:04 +0000
+
+casper (1.225) lucid; urgency=low
+
+  * Add ubiquity-hooks/49kubuntu_gnome_icon_cache to recreate the Gnome
+    icon cache on Kubuntu CDs, removed by livecd-rootfs
+
+ -- Jonathan Riddell <jriddell at ubuntu.com>  Mon, 08 Mar 2010 11:47:01 +0000
+
+casper (1.224) lucid; urgency=low
+
+  * Remove ubiquity-hooks/35copy_wallpaper_cache as now implement it in
+    ubiquity itself (LP: #530024)
+
+ -- Didier Roche <didrocks at ubuntu.com>  Mon, 01 Mar 2010 19:41:45 +0100
+
+casper (1.223) lucid; urgency=low
+
+  * Bind-mount /dev, /proc, and /sys into /root while running apt-cdrom.
+  * Copy /lib/udev/rules.d/60-cdrom_id.rules into the initramfs to go with
+    /lib/udev/cdrom_id, so that apt-cdrom will be able to find ID_CDROM=1
+    entries when we run it.  This should stop update-notifier from
+    repeatedly popping up during the live session.
+
+ -- Colin Watson <cjwatson at ubuntu.com>  Tue, 23 Feb 2010 01:35:30 +0000
+
+casper (1.222) lucid; urgency=low
+
+  * scripts/casper-bottom/47une_ubiquity:
+    - get back ubiquity favorite icon in UNE live (LP: #524381)
+    - rename the script from 47unr_ubiquity to 47une_ubiquity as well
+      as "UNR" mention
+
+ -- Didier Roche <didrocks at ubuntu.com>  Mon, 22 Feb 2010 14:01:25 +0100
+
+casper (1.221) lucid; urgency=low
+
+  * Remove the rest of the mythbuntu delta from 10adduser.  It will be
+    maintained in the mythbuntu-live-autostart package instead so that
+    users from ~mythbuntu-dev can administer it.
+
+ -- Mario Limonciello <superm1 at ubuntu.com>  Sun, 21 Feb 2010 20:22:00 -0600
+
+casper (1.220) lucid; urgency=low
+
+  * scripts/casper: calculate memory without "head" utility, thanks to
+    Petar Bogdanovic (LP: #25496).
+
+ -- Kees Cook <kees at ubuntu.com>  Fri, 19 Feb 2010 14:04:18 -0800
+
+casper (1.219) lucid; urgency=low
+
+  [ Mario Limonciello ]
+  * Disable casper-reconfigure from 22gnome_panel_data.  It doesn't (appear) to
+    serve a functional purpose as the postinst does nothing different for laptops.
+
+  [ Didier Roche ]
+  * add 35copy_wallpaper_cache to copy the wallpaper cache created at boot time
+    to the main user's directory. First boot will take it into account in
+    ureadahead profiling
+
+ -- Didier Roche <didrocks at ubuntu.com>  Wed, 17 Feb 2010 19:14:53 +0100
+
+casper (1.218) lucid; urgency=low
+
+  * Allow dpkg and apt-get to be installed from within commands that operate
+    in the chroot via early_command or driver updates. (LP: #521218)
+
+ -- Mario Limonciello <Mario_Limonciello at Dell.com>  Tue, 16 Feb 2010 13:38:48 -0600
+
+casper (1.217) lucid; urgency=low
+
+  [ Luke Yelavich ]
+  * ubiquity-hooks/30accessibility: Enable accessible login for the blindness
+    and braile accessibility profiles.
+
+  [ Colin Watson ]
+  * Use egrep rather than 'grep -E' (LP: #512386).
+
+  [ Julien Lavergne ]
+  * 15autologin: Add support for LXDM autologin (LP: #511976).
+
+  [ Evan Dandrea ]
+  * Properly shut down debconf-communicate so that its database gets
+    written (LP: #518272).
+
+ -- Evan Dandrea <evand at ubuntu.com>  Thu, 11 Feb 2010 08:25:53 +0000
+
+casper (1.216) lucid; urgency=low
+
+  [ Luke Yelavich ]
+  * scripts/casper-bottom/30accessibility && ubiquity-hooks/30accessibility:
+    - Remove code to disable pulseaudio, as it is no longer needed, and
+      the supporting code in the pulseaudio package was removed a long time
+      ago.
+    - Set the default empathy theme to classic for blindness and braille
+      accessibility profiles.
+
+  [ Jamie Bennett ]
+  * Speed up work around debconf-communicate. Replace several calls to
+    debconf-communicate with one persistent invocation followed by
+    confmodule calls.
+  * Disable guest account by rm'ing rather than waiting for dpkg to
+    remove it.
+
+ -- Colin Watson <cjwatson at ubuntu.com>  Wed, 03 Feb 2010 16:41:57 -0800
+
 casper (1.215) lucid; urgency=low
 
   [ Mario Limonciello ]
diff --git a/hooks/live b/hooks/live
index 5973d20..afa198d 100755
--- a/hooks/live
+++ b/hooks/live
@@ -44,6 +44,7 @@ mkdir -p "${DESTDIR}"/lib/live-initramfs
 # Executables
 copy_exec /usr/share/live-initramfs/live-reconfigure /bin
 copy_exec /usr/share/live-initramfs/live-preseed /bin
+copy_exec /usr/share/live-initramfs/live-set-selections /bin
 
 # Scripts
 cp /usr/share/initramfs-tools/scripts/live-functions "${DESTDIR}"/scripts
@@ -68,6 +69,12 @@ do
 	fi
 done
 
+if [ -e /lib/udev/rules.d/60-cdrom_id.rules ]
+then
+	mkdir -p ${DESTDIR}/lib/udev/rules.d
+	cp -p /lib/udev/rules.d/60-cdrom_id.rules ${DESTDIR}/lib/udev/rules.d
+fi
+
 # Handling other stuff
 
 # Configuration: keymap (usefull when using encryption)
diff --git a/scripts/live b/scripts/live
index 6f4f5c1..ec3a639 100755
--- a/scripts/live
+++ b/scripts/live
@@ -43,6 +43,35 @@ then
 	touch /live.vars
 fi
 
+network_started=
+
+start_network ()
+{
+	[ -z "$network_started" ] || return
+	[ -z "$NETBOOT" ] || return
+
+	mount -n -o bind /sys /root/sys
+	mount -n -o bind /proc /root/proc
+	mount -n -o bind /dev /root/dev
+	mkdir -p /root/var/run/network
+
+	# Close inherited fd's to prevent debconf-communicate from
+	# continuing to run post-live-initramfs.
+	chroot /root dhclient eth0 3>&- 4<&-
+
+	network_started=1
+}
+
+stop_network ()
+{
+	[ "$network_started" ] || return
+
+	chroot /root ifconfig eth0 down
+	umount /root/sys
+	umount /root/proc
+	umount /root/dev
+}
+
 Arguments ()
 {
 	PRESEEDS=""
@@ -431,19 +460,8 @@ Arguments ()
 			url=*)
 				URL_LOCATION="${ARGUMENT#url=}"
 
-				mount -o bind /sys /root/sys
-				mount -o bind /proc /root/proc
-				mount -o bind /dev /root/dev
-
-				mkdir -p /root/var/run/network
-				[ "${NETBOOT}" ] || chroot /root dhclient eth0
+				start_network
 				chroot /root wget -P /tmp "${URL_LOCATION}"
-				[ "${NETBOOT}" ] || chroot /root ifconfig eth0 down
-
-				umount /root/sys
-				umount /root/proc
-				umount /root/dev
-
 				LOCATIONS="/tmp/$(basename ${URL_LOCATION}) ${LOCATIONS}"
 				;;
 
@@ -667,7 +685,7 @@ is_nice_device ()
 {
 	sysfs_path="${1#/sys}"
 
-	if /lib/udev/path_id "${sysfs_path}" | grep -E -q "ID_PATH=(usb|pci-|platform-orion-ehci|platform-mmc|platform-mxsdhci|)"
+	if /lib/udev/path_id "${sysfs_path}" | egrep -q "ID_PATH=(usb|pci-|platform-orion-ehci|platform-mmc|platform-mxsdhci|)"
 	then
 		return 0
 	elif echo "${sysfs_path}" | grep -q '^/block/vd[a-z]$'
@@ -705,7 +723,7 @@ copy_live_to ()
 	if [ "${copytodev}" = "ram" ]
 	then
 		# copying to ram:
-		freespace=$( expr $(awk '/MemFree/{print $2}' /proc/meminfo) + $( awk '/\<Cached/{print $2}' /proc/meminfo ) )
+		freespace=$(awk '/^MemFree:/{f=$2} /^Cached:/{c=$2} END{print f+c}' /proc/meminfo)
 		mount_options="-o size=${size}k"
 		free_string="memory"
 		fstype="tmpfs"
@@ -759,7 +777,11 @@ copy_live_to ()
 				rsync -a --progress ${copyfrom}/* ${copyto} 1>/dev/console  # "cp -a" from busybox also copies hidden files
 			else
 				mkdir -p ${copyto}/${LIVE_MEDIA_PATH}
-				cp -a ${copyfrom}/${LIVE_MEDIA_PATH}/* ${copyto}/${LIVE_MEDIA_PATH}   # "cp -a" from busybox also copies hidden files
+				cp -a ${copyfrom}/${LIVE_MEDIA_PATH}/* ${copyto}/${LIVE_MEDIA_PATH}
+				if [ -e ${copyfrom}/${LIVE_MEDIA_PATH}/.disk ]
+				then
+					cp -a ${copyfrom}/${LIVE_MEDIA_PATH}/.disk ${copyto}
+				fi
 			fi
 		fi
 
@@ -1008,7 +1030,7 @@ do_snap_copy ()
 			todev=$(awk -v pat="$(base_path ${todir})" '$2 == pat { print $1 }' /proc/mounts)
 			freespace=$(df -k | awk '/'${todev}'/{print $4}')
 		else
-			freespace=$( expr $(awk '/MemFree/{print $2}' /proc/meminfo) + $( awk '/\<Cached/{print $2}' /proc/meminfo))
+			freespace=$(awk '/^MemFree:/{f=$2} /^Cached:/{c=$2} END{print f+c}' /proc/meminfo)
 		fi
 
 		tomount="/mnt/tmpsnap"
@@ -1677,7 +1699,7 @@ find_livefs ()
 
 	# or do the scan of block devices
 	# prefer removable devices over non-removable devices, so scan them first
-	for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -vE "/(loop|ram|dm-|fd)")
+	for sysblock in $(echo /sys/block/* | tr ' ' '\n' | egrep -v "/(loop|ram|dm-|fd)")
 	do
 		if [ "$(cat ${sysblock}/removable)" = "1" ]
 		then
@@ -1885,6 +1907,36 @@ mountroot ()
 		mount -n -o bind /dev "${rootmnt}/dev"
 	fi
 
+	# Open up two fifo's fd's for debconf-communicate to use. Speeds up
+	# the live-initramfs process considerably.
+	log_begin_msg "Creating debconf-communicate fifo mechanism"
+	mkfifo /tmp/debconf-in.fifo
+	mkfifo /tmp/debconf-out.fifo
+
+	# Make the template database read-only, so that passthrough debconf
+	# instances can write to it directly; otherwise templates are only
+	# passed through when necessary.  Use temporary config databases as
+	# well; we'll copy their contents back at the end.
+	DEBCONF_TMPDIR="$(chroot /root mktemp -dt debconf.XXXXXX)"
+	cp -a /root/var/cache/debconf/config.dat "/root$DEBCONF_TMPDIR/"
+	cp -a /root/var/cache/debconf/passwords.dat "/root$DEBCONF_TMPDIR/"
+	sed "s,^Filename: /var/cache/debconf/\(config\|passwords\).dat$,Filename: $DEBCONF_TMPDIR/\1.dat,; /^Name: templatedb/a\
++Readonly: true" /root/etc/debconf.conf >"/root$DEBCONF_TMPDIR/debconf.conf"
+
+	# Save the PID so it can be killed later.
+	DEBCONF_SYSTEMRC="$DEBCONF_TMPDIR/debconf.conf" chroot /root debconf-communicate -fnoninteractive live-initramfs > /tmp/debconf-out.fifo < /tmp/debconf-in.fifo &
+
+	if [ ! -p /tmp/debconf-in.fifo ] || [ ! -p /tmp/debconf-out.fifo ]
+	then
+		log_warning_msg "failed to setup debconf-communicate channel"
+	fi
+	log_end_msg
+
+	# Order matters!
+	# These file descriptors must stay open until we're finished with
+	# debconf-communicate.
+	exec 4</tmp/debconf-out.fifo 3>/tmp/debconf-in.fifo
+
 	maybe_break live-bottom
 	log_begin_msg "Running /scripts/live-bottom\n"
 
@@ -1896,6 +1948,20 @@ mountroot ()
 		umount "${rootmnt}/dev"
 	fi
 
+	# Close the fd's associated with debconf-communicate
+	exec 3>&- 4<&-
+	rm -f /tmp/debconf-in.fifo
+	rm -f /tmp/debconf-out.fifo
+
+	# Copy config database changes back to the master files.
+	chroot /root debconf-copydb tmpdb config \
+		--config=Name:tmpdb --config=Driver:File \
+		--config="Filename:$DEBCONF_TMPDIR/config.dat"
+	chroot /root debconf-copydb tmpdb passwords \
+		--config=Name:tmpdb --config=Driver:File \
+		--config="Filename:$DEBCONF_TMPDIR/passwords.dat"
+	rm -rf "$DEBCONF_TMPDIR"
+
 	exec 1>&6 6>&-
 	exec 2>&7 7>&-
 	kill ${tailpid}
diff --git a/scripts/live-bottom/10adduser b/scripts/live-bottom/10adduser
index c7adad2..51868d4 100755
--- a/scripts/live-bottom/10adduser
+++ b/scripts/live-bottom/10adduser
@@ -26,6 +26,7 @@ then
 fi
 
 . /scripts/live-functions
+load_confmodule
 
 log_begin_msg "Adding live session user"
 
@@ -34,14 +35,12 @@ log_begin_msg "Adding live session user"
 user_crypted="8Ab05sVQ4LLps" # as in $(echo "live" | mkpasswd -s)
 
 # U6aMy0wojraho is just a blank password
-chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null << EOF
-set passwd/make-user true
-set passwd/root-password-crypted *
-set passwd/user-password-crypted ${user_crypted}
-set passwd/user-fullname ${USERFULLNAME}
-set passwd/username ${USERNAME}
-set passwd/user-uid 1000
-EOF
+db_set passwd/make-user true
+db_set passwd/root-password-crypted '*'
+db_set passwd/user-password-crypted ${user_crypted}
+db_set passwd/user-fullname "$USERFULLNAME"
+db_set passwd/username "$USERNAME"
+db_set passwd/user-uid 999
 
 chroot /root /usr/bin/env -i HOME="/root" \
 	TERM="${TERM}" PATH="/usr/sbin:/usr/bin:/sbin:/bin" \
@@ -49,14 +48,12 @@ chroot /root /usr/bin/env -i HOME="/root" \
 		| grep -v "Shadow passwords are now on"
 
 # Clear out debconf database again to avoid confusing ubiquity later.
-chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null << EOF
-set passwd/make-user
-set passwd/root-password-crypted
-set passwd/user-password-crypted
-set passwd/user-fullname
-set passwd/username
-set passwd/user-uid
-EOF
+db_set passwd/make-user
+db_set passwd/root-password-crypted
+db_set passwd/user-password-crypted
+db_set passwd/user-fullname
+db_set passwd/username
+db_set passwd/user-uid
 
 if ! grep -qs "${USERNAME}" /root/etc/passwd
 then
diff --git a/scripts/live-bottom/15autologin b/scripts/live-bottom/15autologin
index a4df2df..12c937d 100755
--- a/scripts/live-bottom/15autologin
+++ b/scripts/live-bottom/15autologin
@@ -103,4 +103,12 @@ then
 	/root/etc/kde4/kdm/kdmrc
 fi
 
+if [ -f /root/etc/lxdm/lxdm.conf ]
+then
+	# Configure LXDM autologin
+	sed -i -r -e "s/^# autologin=dgod/autologin=$USERNAME/" \
+		  -e "s/^# session/session/" \
+	/root/etc/lxdm/lxdm.conf
+fi
+
 log_end_msg
diff --git a/scripts/live-bottom/22gnome_panel_data b/scripts/live-bottom/22gnome_panel_data
index 8f24bf4..09449e2 100755
--- a/scripts/live-bottom/22gnome_panel_data
+++ b/scripts/live-bottom/22gnome_panel_data
@@ -31,11 +31,6 @@ log_begin_msg "Configuring gnome-panel-data"
 
 # live-initramfs script
 
-if chroot /root laptop-detect > /dev/null 2>&1
-then
-	live-reconfigure /root gnome-panel-data
-fi
-
 if [ -n "${USERNAME}" ]
 then
 	chroot /root sudo -u "${USERNAME}" gconftool-2 -s -t bool /apps/panel/global/disable_lock_screen true
diff --git a/scripts/live-bottom/22sslcert b/scripts/live-bottom/22sslcert
index 1950eef..d54dc29 100755
--- a/scripts/live-bottom/22sslcert
+++ b/scripts/live-bottom/22sslcert
@@ -21,6 +21,7 @@ esac
 # live-initramfs header
 
 . /scripts/live-functions
+load_confmodule
 
 log_begin_msg "Regenerating SSL certificate..."
 
diff --git a/scripts/live-bottom/24preseed b/scripts/live-bottom/24preseed
index 7dd6394..1f5c513 100755
--- a/scripts/live-bottom/24preseed
+++ b/scripts/live-bottom/24preseed
@@ -26,6 +26,7 @@ then
 fi
 
 . /scripts/live-functions
+load_confmodule
 
 log_begin_msg "Loading preseed file"
 
@@ -33,14 +34,14 @@ log_begin_msg "Loading preseed file"
 
 if [ -e /preseed.cfg ]
 then
-	chroot /root debconf-set-selections < /preseed.cfg
+	live-set-selections /preseed.cfg
 fi
 
 if [ -n "${LOCATIONS}" ]
 then
 	for item in ${LOCATIONS}
 	do
-		chroot /root debconf-set-selections < "/root${ITEM}"
+		live-set-selections "/root$item"
 	done
 fi
 
@@ -55,14 +56,20 @@ then
 	done
 fi
 
-reply="$(echo "GET preseed/early_command" | chroot /root debconf-communicate -fnoninteractive live-initramfs)"
-
-if [ "${reply#0 }" != "${reply}" ]
+if db_get preseed/early_command && [ "$RET" ]
 then
-	reply="${reply#0 }"
-	sh -c "${reply}"
+	EARLY="$RET"
+	if db_get preseed/allow-network && [ "$RET" = true ]; then
+		start_network
+	fi
+
+	DEBIAN_HAS_FRONTEND= DEBCONF_REDIR= \
+	DEBIAN_FRONTEND=noninteractive \
+	sh -c "$EARLY"
 fi
 
+stop_network
+
 # Clear out debconf database backup files to save memory.
 rm -f /root/var/cache/debconf/*.dat-old
 
diff --git a/scripts/live-bottom/25configure_init b/scripts/live-bottom/25configure_init
index db23f19..c06617f 100755
--- a/scripts/live-bottom/25configure_init
+++ b/scripts/live-bottom/25configure_init
@@ -98,7 +98,7 @@ then
 	fi
 
 	# Avoid clobbering the user's clock
-	rm -f /root/etc/rc?.d/K??hwclock.sh
+	rm -f /root/etc/rc?.d/K??hwclock.sh /root/etc/init/hwclock-save.conf
 fi
 
 # Disable readahead since it doesn't play well with squashfs + unionfs
diff --git a/scripts/live-bottom/30accessibility b/scripts/live-bottom/30accessibility
index 4624077..75bfae4 100755
--- a/scripts/live-bottom/30accessibility
+++ b/scripts/live-bottom/30accessibility
@@ -109,20 +109,12 @@ case ${ACCESS} in
 		gct -s -t bool /desktop/gnome/interface/accessibility true
 		gct -s -t bool /desktop/gnome/applications/at/visual/startup true
 		gct -s -t string /desktop/gnome/applications/at/visual/exec orca
+		gct -s -t string /apps/empathy/conversation/theme classic
 		gct -s -t bool /apps/gksu/disable-grab true
 		gct -s -t string /desktop/gnome/applications/window_manager/default /usr/bin/metacity
 		sed -i -e 's/# Host alias specification/Defaults\tenv_keep = "ORBIT_SOCKETDIR XDG_SESSION_COOKIE GTK_MODULES"\n\n# Host alias specification/g' /root/etc/sudoers
 
 		remove_applet fast_user_switch
-		if [ -x /root/usr/bin/pulse-session ]
-		then
-			mkdir -p /root/var/lib/pulseaudio
-			touch /root/var/lib/pulseaudio/pulse_a11y_nostart
-			chroot /root chown root.root /var/lib/pulseaudio/pulse_a11y_nostart
-			mkdir -p /root/home/$USERNAME/.pulse
-			echo "autospawn = no" > /root/home/$USERNAME/.pulse/client.conf
-			chroot /root chown -R $USERNAME.$USERNAME /home/$USERNAME/.pulse
-		fi
 		if [ -x /root/usr/bin/orca ]
 		then
 			mkdir -p /root/home/$USERNAME/.orca
@@ -137,6 +129,7 @@ case ${ACCESS} in
 		gct -s -t string /desktop/gnome/applications/at/visual/exec orca
 		gct -s -t bool /apps/gksu/disable-grab true
 		gct -s -t string /desktop/gnome/applications/window_manager/default /usr/bin/metacity
+		gct -s -t string /apps/empathy/conversation/theme classic
 		sed -i -e 's/# Host alias specification/Defaults\tenv_keep = "ORBIT_SOCKETDIR XDG_SESSION_COOKIE GTK_MODULES"\n\n# Host alias specification/g' /root/etc/sudoers
 
 		if [ -x /root/usr/bin/orca ]
@@ -149,16 +142,6 @@ case ${ACCESS} in
 			chroot /root chown -R ${USERNAME}:${USERNAME} /home/${USERNAME}/.orca
 		fi
 
-		if [ -x /root/usr/bin/pulse-session ]
-		then
-			mkdir -p /root/var/lib/pulseaudio
-			touch /root/var/lib/pulseaudio/pulse_a11y_nostart
-			chroot /root chown root.root /var/lib/pulseaudio/pulse_a11y_nostart
-			mkdir -p /root/home/$USERNAME/.pulse
-			echo "autospawn = no" > /root/home/$USERNAME/.pulse/client.conf
-			chroot /root chown -R $USERNAME.$USERNAME /home/$USERNAME/.pulse
-		fi
-
 		remove_applet fast_user_switch
 		;;
 
diff --git a/scripts/live-bottom/34disable_kde_services b/scripts/live-bottom/34disable_kde_services
index 3350d61..41f881c 100755
--- a/scripts/live-bottom/34disable_kde_services
+++ b/scripts/live-bottom/34disable_kde_services
@@ -26,16 +26,15 @@ log_begin_msg "Disabling unnecessary KDE services..."
 
 # live-initramfs script
 
-rm -f /root/usr/share/services/kded/kwalletd.desktop
-rm -f /root/usr/share/kde4/services/kwalletd.desktop
 rm -f /root/usr/share/autostart/kab2kabc.desktop
 rm -f /root/usr/share/autostart/kabcdistlistupdater.desktop
 rm -f /root/usr/share/autostart/korgac.desktop
 rm -f /root/usr/share/autostart/printer-applet.desktop
 rm -f /root/usr/share/autostart/nepomukserver.desktop
+rm -f /root/usr/share/kde4/services/kwalletd.desktop
 rm -f /root/usr/share/kde4/services/kded/kpackagekitd.desktop
-rm -f /root/usr/share/kde4/services/kded/susefreespacenotifier.desktop
+rm -f /root/usr/share/kde4/services/kded/freespacenotifier.desktop
 rm -f /root/usr/share/kde4/services/plasma-runner-contacts.desktop  # starts akonadi
-rm -f /root/etc/xdg/autostart/update-notifier-kde.desktop
+rm -f /root/usr/share/kde4/services/kded/notificationhelper.desktop
 
 log_end_msg
diff --git a/scripts/live-bottom/41apt_cdrom b/scripts/live-bottom/41apt_cdrom
index 00606d5..eb7fbd8 100755
--- a/scripts/live-bottom/41apt_cdrom
+++ b/scripts/live-bottom/41apt_cdrom
@@ -33,7 +33,15 @@ log_begin_msg "Adding APT-CDROM source"
 
 if [ -d /root/cdrom ]
 then
-	chroot /root apt-cdrom -m add
+	mount -n -o bind /sys /root/sys
+	mount -n -o bind /proc /root/proc
+	mount -n -o bind /dev /root/dev
+
+	chroot /root apt-cdrom -o Acquire::cdrom::AutoDetect=false -m add
+
+	umount /root/dev
+	umount /root/proc
+	umount /root/sys
 fi
 
 log_end_msg
diff --git a/scripts/live-bottom/43disable_updateinitramfs b/scripts/live-bottom/43disable_updateinitramfs
index 0a6c7c0..44e2d1f 100755
--- a/scripts/live-bottom/43disable_updateinitramfs
+++ b/scripts/live-bottom/43disable_updateinitramfs
@@ -38,9 +38,22 @@ then
 cat > /root/usr/sbin/update-initramfs << 'EOF'
 #!/bin/sh
 
+set -e
+
 update-initramfs.distrib "$@"
-cp /initrd.img /cdrom/live/initrd.gz
-cp /vmlinuz /cdrom/live/vmlinuz
+
+if [ -e /cdrom/live/initrd.lz ]
+then
+	zcat /initrd.img | lzma -9c >/cdrom/live/initrd.lz.new
+	mv /cdrom/live/initrd.lz.new /cdrom/live/initrd.lz
+else
+	cp /initrd.img /cdrom/live/initrd.gz.new
+	mv /cdrom/live/initrd.gz.new /cdrom/live/initrd.gz
+fi
+
+cp /vmlinuz /cdrom/live/vmlinuz.new
+mv /cdrom/live/vmlinuz.new /cdrom/live/vmlinuz
+
 exit 0
 EOF
 
diff --git a/scripts/live-functions b/scripts/live-functions
index 4a23e69..9e138ec 100644
--- a/scripts/live-functions
+++ b/scripts/live-functions
@@ -5,7 +5,11 @@
 log_wait_msg ()
 {
 	# Print a message and wait for enter
-	if [ -x /sbin/usplash_write ]
+	if [ -x /bin/plymouth ] && plymouth --ping
+	then
+		plymouth message --text="$@"
+		plymouth watch-keystroke | read nunya
+	elif [ -x /sbin/usplash_write ]
 	then
 		/sbin/usplash_write "INPUTENTER ${@}"
 		read nunya < /dev/.initramfs/usplash_outfifo
@@ -111,3 +115,16 @@ panic() {
 	. /scripts/functions
 	panic "$@"
 }
+
+load_confmodule ()
+{
+	# Only do this once
+	if [ -z "$DEBCONF_REDIR" ]
+	then
+		exec <&4
+		export DEBIAN_HAS_FRONTEND=1
+		export DEBCONF_REDIR=1
+	fi
+
+	. /root/usr/share/debconf/confmodule
+}

-- 
live-initramfs



More information about the debian-live-changes mailing list