# Exit if system was not booted by live-initramfs
grep -qs boot=live /proc/cmdline || exit 0
+# Exit if the system was booted from an ISO image rather than a physical CD
+grep -qs find_iso= /proc/cmdline && exit 0
+
# Read configuration variable file if it is present
[ -r /etc/live.conf ] && . /etc/live.conf
+casper (1.113) hardy; urgency=low
+
+ [ Tollef Fog Heen ]
+ * dpkg-divert away update-initramfs as it's useless on live CDs and
+ annoying when people install LVM and similar tools in order to rescue
+ a system. LP: #150188
+
+ [ Colin Watson ]
+ * Adjust /etc/sudoers editing code so that it doesn't repeatedly add
+ "NOPASSWD:" in persistent mode (LP: #175159).
+ * Avoid ejecting the CD if booting from an ISO image rather than from a
+ physical CD (thanks, Agostino Russo; LP: #176014).
+
+ -- Colin Watson <cjwatson@ubuntu.com> Wed, 19 Dec 2007 09:17:50 +0000
+
casper (1.112) hardy; urgency=low
* hooks/casper: no need to copy udevinfo into the initramfs, it's already
if [ -z "${NOSUDO}" ]
then
- if [ -f /root/etc/sudoers ]
+ if ! grep -q "${USERNAME}" /root/etc/sudoers
then
echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" >> /root/etc/sudoers
--- /dev/null
+#!/bin/sh
+# Fix for LP#150188
+
+PREREQ=""
+DESCRIPTION="Disabling update-initramfs (useless on a live CD)..."
+
+. /scripts/casper-functions
+
+prereqs()
+{
+ echo "$PREREQ"
+}
+
+case $1 in
+# get pre-requisites
+prereqs)
+ prereqs
+ exit 0
+ ;;
+esac
+
+log_begin_msg "$DESCRIPTION"
+
+chroot /root dpkg-divert --add --rename --quiet \
+ /usr/sbin/update-initramfs
+cat > /root/usr/sbin/update-initramfs <<EOF
+#! /bin/sh
+
+echo "update-initramfs is disabled since running on a live CD"
+exit 0
+
+EOF
+
+chmod 755 /root/usr/sbin/update-initramfs
+
+log_end_msg