Readd scripts/live-bottom 1.136.3-2_grml.03
authorMichael Prokop <devnull@localhost>
Sat, 16 Aug 2008 18:41:31 +0000 (20:41 +0200)
committerMichael Prokop <devnull@localhost>
Sat, 16 Aug 2008 18:41:31 +0000 (20:41 +0200)
43 files changed:
bin/live-preseed
debian/changelog
debian/rules
docs/AUTHORS
docs/CREDITS
docs/ChangeLog.casper
grml/05mountpoints [new file with mode: 0755]
hooks/live
scripts/live
scripts/live-bottom/02etc_live_conf
scripts/live-bottom/02timezone
scripts/live-bottom/05mountpoints
scripts/live-bottom/06hostname
scripts/live-bottom/10adduser
scripts/live-bottom/12fstab
scripts/live-bottom/13swap
scripts/live-bottom/14locales
scripts/live-bottom/15autologin
scripts/live-bottom/19keyboard
scripts/live-bottom/20xconfig
scripts/live-bottom/21xdriver
scripts/live-bottom/21xvidemode
scripts/live-bottom/22gnome_panel_data
scripts/live-bottom/22screensaver
scripts/live-bottom/23etc_modules
scripts/live-bottom/23networking
scripts/live-bottom/24preseed
scripts/live-bottom/25configure_init
scripts/live-bottom/30accessibility
scripts/live-bottom/31disable_update_notifier
scripts/live-bottom/32disable_hibernation
scripts/live-bottom/33enable_apport_crashes
scripts/live-bottom/34disable_kpersonalizer
scripts/live-bottom/35fix_language_selector
scripts/live-bottom/36disable_trackerd
scripts/live-bottom/38disable_restricted_manager
scripts/live-bottom/41apt_cdrom
scripts/live-bottom/42disable_apparmor
scripts/live-bottom/43disable_updateinitramfs
scripts/live-bottom/44pk_allow
scripts/live-bottom/99hook
scripts/live-functions
scripts/live-helpers

index 36154ea..d98c4f3 100755 (executable)
@@ -11,10 +11,10 @@ seen="${4}"
 
 [ "${seen}" ] || seen=true
 
-if ! (echo "SET ${question} ${value}"; echo "FSET ${question} seen ${seen}") | chroot "${1}" debconf-communicate -fnoninteractive live-initramfs >/dev/null
+if ! (echo "SET ${question} ${value}"; echo "FSET ${question} seen ${seen}") | chroot "${1}" /usr/bin/debconf-communicate -fnoninteractive live-initramfs >/dev/null
 then
 
-chroot "${1}" debconf-communicate -fnoninteractive live-initramfs >/dev/null << EOF
+chroot "${1}" /usr/bin/debconf-communicate -fnoninteractive live-initramfs >/dev/null << EOF
 REGISTER debian-installer/dummy ${question}
 SET ${question} ${value}
 FSET ${question} seen ${seen}
index 442c7c1..f98f532 100644 (file)
@@ -1,11 +1,16 @@
 live-initramfs (1.136.3-2~grml.03) unstable; urgency=low
 
+  The "OMG, I hate the booting toolchain" release.
+
   * Improve boot failure splash.
+  * Don't remove scripts/live-bottom in grml package but
+    remove it in build sequence, this provides better
+    synching with Debian.
   * Readd scripts/live-bottom/05mountpoints, otherwise
     we suffer from "run-init: nuking initramfs contents".
   * Update debian/control.
 
- -- Michael Prokop <mika@grml.org>  Sat, 16 Aug 2008 15:19:05 +0200
+ -- Michael Prokop <mika@grml.org>  Sat, 16 Aug 2008 20:38:36 +0200
 
 live-initramfs (1.136.3-2~grml.02) unstable; urgency=low
 
index a979afc..55b12ba 100755 (executable)
@@ -44,9 +44,16 @@ install: build
 
        # Installing package
        $(MAKE) install DESTDIR=$(CURDIR)/debian/live-initramfs
-       # Install grml specific configuration
+
+       # Install grml specific configuration:
        install -m 644 grml/live.conf ./debian/live-initramfs/etc/live.conf
+       # Get rid of unnecessary stuff:
        rm -rf ./debian/live-initramfs/usr/share/initramfs-tools/scripts/live-bottom/
+       # ... and install important stuff again:
+
+       mkdir ./debian/live-initramfs/usr/share/initramfs-tools/scripts/live-bottom/
+       install -m 755 grml/05mountpoints \
+         ./debian/live-initramfs/usr/share/initramfs-tools/scripts/live-bottom/05mountpoints
 
        # Removing double files
        rm -f debian/live-initramfs/usr/share/doc/live-initramfs/COPYING
index e10c045..57494a6 100644 (file)
@@ -2,6 +2,10 @@ Main Authors:
 
   * Daniel Baumann <daniel@debian.org>
 
+Main Contributors:
+
+  * Chris Lamb <chris@chris-lamb.co.uk>
+
 Original Authors:
 
   live-initramfs is a fork of casper <http://packages.ubuntu.com/casper/>.
index 495d6eb..2a1ae50 100644 (file)
@@ -5,6 +5,8 @@ Patches (alphabetical order):
   * Arnaud Cornet <arnaud.cornet@gmail.com>
   * Bas Wijnen <wijnen@debian.org>
   * Ben Armstrong <synrg@debian.org>
+  * Ben Voui <intrigeri@boum.org>
+  * Chris Lamb <chris@chris-lamb.co.uk>
   * Davide Natalini <davide.natalini@studio.unibo.it>
   * Frederic Lehobey <Frederic.Lehobey@free.fr>
   * Hadar Weiss <whadar@gmail.com>
@@ -14,8 +16,10 @@ Patches (alphabetical order):
   * Malcom Gilles <live@ouabain.org>
   * Marco Amadori <marco.amadori@gmail.com>
   * Mathieu Geli <mathieu.geli@gmail.com>
+  * Michael Prokop <mika@grml.org>
   * Michal Suchanek <hramrach@centrum.cz>
   * Oliver Osburg <o.osburg@uni-jena.de>
   * Otavio Salvador <otavio@debian.org>
   * Sebastian Raveau <sebastien.raveau@epita.fr>
+  * Steven Shiau <steven@nchc.org.tw>
   * Thomas Lange <lange@informatik.uni-koeln.de>
index 564e69b..153901c 100644 (file)
@@ -1,3 +1,31 @@
+casper (1.139) intrepid; urgency=low
+
+  * add compcache conf.d configuration for initramfs-tools
+
+ -- Oliver Grawert <ogra@ubuntu.com>  Thu, 14 Aug 2008 00:25:54 +0200
+
+casper (1.138) intrepid; urgency=low
+
+  [ Tormod Volden ]
+  * use full path for vol_id in swap-on-raid detection (LP: #136804)
+
+  [ Martin Pitt ]
+  * 33enable_apport_crashes: Change the apport default file, not the
+    update-notifier gconf keys, to undo the corresponding change for disabling
+    apport right before the release.
+  * Add 45disable_guest_account: Purge the gdm-guest-session package from the
+    live system, since having guest sessions in a live session does not make
+    much sense. (See gdm-guest-login spec)
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Thu, 31 Jul 2008 14:19:07 +0200
+
+casper (1.137) intrepid; urgency=low
+
+  * Update scripts/casper-bottom/15autologin for KDM from KDE 4.
+  * Update 32disable_hibernation for KDE 4.
+
+ -- Jonathan Riddell <jriddell@ubuntu.com>  Thu, 17 Jul 2008 13:41:38 +0100
+
 casper (1.136) intrepid; urgency=low
 
   * Remove bad-and-wrong setting of PATH to include directories under /root;
@@ -38,10 +66,28 @@ casper (1.133) intrepid; urgency=low
     loopfile
   * Reverted changes to casper-helpers as requested by Mithrandir since
     replaying the journal on a hibernated system would lead to file system
-    corruption.
+    corruption (LP: #230703).
 
  -- Evan Dandrea <evand@ubuntu.com>  Wed, 18 Jun 2008 12:34:58 -0400
 
+casper (1.132ubuntu0.2) hardy-proposed; urgency=low
+
+  * Test if livemedia is a directory before trying to mount it as a
+    loopfile
+  * Reverted changes to casper-helpers as requested by Mithrandir since
+    replaying the journal on a hibernated system would lead to file system
+    corruption (LP: #230703).
+
+ -- Agostino Russo <agostino.russo@gmail.com>  Tue, 10 Jun 2008 00:27:12 +0100
+
+casper (1.132ubuntu0.1) hardy-proposed; urgency=low
+
+  * Do not scan only vfat volumes when looking for cow devices (LP: #230703)
+  * Allow casper to use a squashfs filesystem within an arbitrary path (LP:
+    #230716, #207137)
+
+ -- Agostino Russo <agostino.russo@gmail.com>  Thu, 15 May 2008 22:10:50 +0100
+
 casper (1.132) intrepid; urgency=low
 
   [ Colin Watson ]
diff --git a/grml/05mountpoints b/grml/05mountpoints
new file mode 100755 (executable)
index 0000000..a8717d7
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+       echo "${PREREQ}"
+}
+
+case "${1}" in
+       prereqs)
+               prereqs
+               exit 0
+               ;;
+esac
+
+# live-initramfs header
+
+. /scripts/live-functions
+
+log_begin_msg "Moving mount points"
+
+# live-initramfs script
+
+# Move to the new root filesystem so that programs there can get at it.
+if [ ! -d /root/live/image ]
+then
+       mkdir -p /root/live/image
+       mount -n --move /live/image /root/live/image
+fi
+
+log_end_msg
index 190fac5..dea7f0c 100755 (executable)
@@ -103,6 +103,9 @@ manual_add_modules nls_iso8859-1
 manual_add_modules nls_utf8
 manual_add_modules vfat
 
+# Filesystem: ntfs
+manual_add_modules ntfs
+
 # Hardware: cdrom
 manual_add_modules ide-cd
 manual_add_modules ide-generic
index 15710c2..caaf45b 100755 (executable)
@@ -561,6 +561,9 @@ is_nice_device ()
        if /lib/udev/path_id "${sysfs_path}" | grep -E -q "ID_PATH=(usb|pci-[^-]*-[ide|scsi|usb])"
        then
                return 0
+       elif echo "${sysfs_path}" | grep -q '^/block/vd[a-z]$'
+       then
+               return 0
        fi
 
        return 1
@@ -604,14 +607,14 @@ copy_live_to ()
                        fstype=$(get_fstype "${dev}")
                        freespace=$(fs_size "${dev}")
                else
-                       [ "$quiet" != "y" ] && log_warning_msg "${copytodev} is not a block device."
+                       log_warning_msg "${copytodev} is not a block device."
                        return 1
                fi
        fi
 
        if [ "${freespace}" -lt "${size}" ]
        then
-               [ "${quiet}" != "y" ] && log_warning_msg "Not enough free ${free_string} (${freespace}k free, ${size}k needed) to copy live media in ${copytodev}."
+               log_warning_msg "Not enough free ${free_string} (${freespace}k free, ${size}k needed) to copy live media in ${copytodev}."
                return 1
        fi
 
@@ -685,7 +688,7 @@ do_netmount ()
                NFSROOT=${ROOTSERVER}:${NFSROOT}
        fi
 
-       [ "${quiet}" != "y" ] && log_begin_msg "Trying netboot from ${NFSROOT}"
+       log_begin_msg "Trying netboot from ${NFSROOT}"
 
        if [ "${NETBOOT}" != "nfs" ] && do_cifsmount
        then
@@ -697,7 +700,7 @@ do_netmount ()
                rc=0
        fi
 
-       [ "${quiet}" != "y" ] && log_end_msg
+       log_end_msg
        return ${rc}
 }
 
@@ -719,12 +722,20 @@ do_httpmount ()
                                squashfs|tgz|tar)
                                        if [ "${webfile}" = "FETCH" ]
                                        then
-                                               [ "${quiet}" != "y" ] &&
-                                                       log_begin_msg "Trying wget ${url} -O ${dest}/$(basename ${url})"
-                                               wget "${url}" -O "${dest}/$(basename ${url})"
+                                               case "$url" in
+                                                       tftp*)
+                                                               ip="$(dirname $url | sed -e 's|tftp://||g')"
+                                                               log_begin_msg "Trying tftp -g -b 10240 -r $(basename ${url})  -l ${dest}/$(basename ${url}) $ip"
+                                                               tftp -g -b 10240 -r $(basename ${url})  -l ${dest}/$(basename ${url}) $ip
+                                                       ;;
+
+                                                       *)
+                                                               log_begin_msg "Trying wget ${url} -O ${dest}/$(basename ${url})"
+                                                               wget "${url}" -O "${dest}/$(basename ${url})"
+                                                               ;;
+                                               esac
                                        else
-                                               [ "${quiet}" != "y" ] &&
-                                                       log_begin_msg "Trying to mount ${url} on ${dest}/$(basename ${url})"
+                                               log_begin_msg "Trying to mount ${url} on ${dest}/$(basename ${url})"
                                                if [ "${webfile}" = "FTPFS" ]
                                                then
                                                        FUSE_MOUNT="curlftpfs"
@@ -741,7 +752,7 @@ do_httpmount ()
                                        ;;
 
                                *)
-                                       [ "${quiet}" != "y" ] && log_begin_msg "Unrecognized archive extension for ${url}"
+                                       log_begin_msg "Unrecognized archive extension for ${url}"
                                        ;;
                        esac
                fi
@@ -766,7 +777,7 @@ do_nfsmount ()
                NFSOPTS=""
        fi
 
-       [ "${quiet}" != "y" ] && log_begin_msg "Trying nfsmount -o nolock -o ro ${NFSOPTS} ${NFSROOT} ${mountpoint}"
+       log_begin_msg "Trying nfsmount -o nolock -o ro ${NFSOPTS} ${NFSROOT} ${mountpoint}"
 
        # FIXME: This for loop is an ugly HACK round an nfs bug
        for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13
@@ -791,7 +802,7 @@ do_cifsmount ()
                        CIFSOPTS="${NFSOPTS}"
                fi
 
-               [ "${quiet}" != "y" ] && log_begin_msg "Trying mount.cifs ${NFSROOT} ${mountpoint} ${CIFSOPTS}"
+               log_begin_msg "Trying mount.cifs ${NFSROOT} ${mountpoint} ${CIFSOPTS}"
                modprobe -q cifs
 
                if mount.cifs "${NFSROOT}" "${mountpoint}" "${CIFSOPTS}"
@@ -851,7 +862,7 @@ do_snap_copy ()
        else
                return 1
 
-               [ "${quiet}" != "y" ] && log_warning_msg "Unable to find the snapshot ${snap_type} medium"
+               log_warning_msg "Unable to find the snapshot ${snap_type} medium"
        fi
 }
 
@@ -1016,7 +1027,7 @@ setup_unionfs ()
                        rofslist="${image} ${rofslist}"
                elif [ -f "${image}" ]
                then
-                       if /sbin/losetup --help 2>&1 | grep -q -- "-r\b"
+                       if losetup --help 2>&1 | grep -q -- "-r\b"
                        then
                                backdev=$(get_backing_device "${image}" "-r")
                        else
@@ -1030,8 +1041,9 @@ setup_unionfs ()
                        fi
 
                        mkdir -p "${croot}/${imagename}"
-                       echo "debug: Mounting backdev \"${backdev}\" (image = ${image}) on croot/imagename \"${croot}/${imagename}\""
+                       log_begin_msg "Mounting \"${image}\" on \"${croot}${imagename}\" via \"${backdev}\""
                        mount -t "${fstype}" -o ro,noatime "${backdev}" "${croot}/${imagename}" || panic "Can not mount ${backdev} (${image}) on ${croot}/${imagename}" && rofsstring="${croot}/${imagename}=${roopt}:${rofsstring}" && rofslist="${croot}/${imagename} ${rofslist}"
+                       log_end_msg
                fi
        done
 
@@ -1082,7 +1094,7 @@ setup_unionfs ()
                        cow_fstype=$(get_fstype "${cowprobe}")
                        cow_mountopt="rw,noatime"
                else
-                       [ "${quiet}" != "y" ] && log_warning_msg "Unable to find the persistent medium"
+                       log_warning_msg "Unable to find the persistent medium"
                        cowdevice="tmpfs"
                        cow_fstype="tmpfs"
                        cow_mountopt="rw,noatime,mode=755"
@@ -1109,11 +1121,12 @@ setup_unionfs ()
        else
                cowdevice="tmpfs"
                cow_fstype="tmpfs"
+               cow_mountopt="rw,noatime,mode=755"
        fi
 
        if [ "${cow_fstype}" = "nfs" ]
        then
-               [ "${quiet}" != "y" ] && log_begin_msg \
+               log_begin_msg \
                        "Trying nfsmount ${nfs_cow_opts} ${cowdevice} /cow"
                nfsmount ${nfs_cow_opts} ${cowdevice} /cow || \
                        panic "Can not mount ${cowdevice} (n: ${cow_fstype}) on /cow"
@@ -1153,6 +1166,7 @@ setup_unionfs ()
        fi
 
        # tmpfs file systems
+       touch /etc/fstab
        mkdir -p "${rootmnt}/live"
        mount -t tmpfs tmpfs ${rootmnt}/live
 
@@ -1168,7 +1182,7 @@ setup_unionfs ()
                        mount -t $(get_fstype "${homecow}") -o rw,noatime "${homecow}" "${rootmnt}/home"
                        export HOMEMOUNTED=1 # used to proper calculate free space in do_snap_copy()
                else
-                       [ "${quiet}" != "y" ] && log_warning_msg "Unable to find the persistent home medium"
+                       log_warning_msg "Unable to find the persistent home medium"
                fi
 
                # Look for other snapshots to copy in
@@ -1196,7 +1210,7 @@ setup_unionfs ()
 
        # shows cow fs on /cow for use by live-snapshot
        mkdir -p "${rootmnt}/live/cow"
-       mount -o move /cow "${rootmnt}/live/cow" || mount -o bind /cow "${rootmnt}/live/cow" || [ "${quiet}" != "y" ] && log_warning_msg "Unable to move or bind /cow to ${rootmnt}/live/cow"
+       mount -o move /cow "${rootmnt}/live/cow" >/dev/null 2>&1 || mount -o bind /cow "${rootmnt}/live/cow" || log_warning_msg "Unable to move or bind /cow to ${rootmnt}/live/cow"
 }
 
 check_dev ()
@@ -1335,12 +1349,15 @@ mountroot ()
        tail -f live.log >&7 &
        tailpid="${!}"
 
+       # Ensure 'panic' function is overridden
+       . /scripts/live-functions
+
        Arguments
 
        set_usplash_timeout
-       [ "${quiet}" != "y" ] && log_begin_msg "Running /scripts/live-premount"
+       log_begin_msg "Running /scripts/live-premount"
        run_scripts /scripts/live-premount
-       [ "${quiet}" != "y" ] && log_end_msg
+       log_end_msg
 
        # Needed here too because some things (*cough* udev *cough*)
        # changes the timeout
@@ -1408,10 +1425,10 @@ mountroot ()
        log_end_msg
 
        maybe_break live-bottom
-       [ "${quiet}" != "y" ] && log_begin_msg "Running /scripts/live-bottom"
+       log_begin_msg "Running /scripts/live-bottom"
 
        run_scripts /scripts/live-bottom
-       [ "${quiet}" != "y" ] && log_end_msg
+       log_end_msg
 
        exec 1>&6 6>&-
        exec 2>&7 7>&-
index 1623de8..815e379 100755 (executable)
@@ -22,7 +22,7 @@ esac
 
 . /scripts/live-functions
 
-log_begin_msg "Copying config on real root fs..."
+log_begin_msg "Copying config on real root fs"
 
 # live-initramfs script
 
index e4e91ff..64faf3b 100755 (executable)
@@ -27,7 +27,7 @@ fi
 
 . /scripts/live-functions
 
-log_begin_msg "Setting timezone..."
+log_begin_msg "Setting timezone"
 
 # live-initramfs script
 
index a334af8..a8717d7 100755 (executable)
@@ -22,7 +22,7 @@ esac
 
 . /scripts/live-functions
 
-log_begin_msg "Moving mount points..."
+log_begin_msg "Moving mount points"
 
 # live-initramfs script
 
index 446bc23..29a080f 100755 (executable)
@@ -27,7 +27,7 @@ fi
 
 . /scripts/live-functions
 
-log_begin_msg "Setting hostname..."
+log_begin_msg "Setting hostname"
 
 # live-initramfs script
 
index 1a80e26..7498476 100755 (executable)
@@ -27,7 +27,7 @@ fi
 
 . /scripts/live-functions
 
-log_begin_msg "Adding live session user..."
+log_begin_msg "Adding live session user"
 
 # live-initramfs script
 
@@ -40,12 +40,13 @@ 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 999
+set passwd/user-uid 1000
 EOF
 
 chroot /root /usr/bin/env -i HOME="/root" \
        TERM="${TERM}" PATH="/usr/sbin:/usr/bin:/sbin:/bin" \
-       /usr/lib/user-setup/user-setup-apply > /dev/null
+       /usr/lib/user-setup/user-setup-apply 2>&1 \
+               | 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
@@ -64,8 +65,12 @@ then
                echo "${USERNAME}  ALL=(ALL) NOPASSWD: ALL" >> /root/etc/sudoers
 
                chroot /root sudo -u "${USERNAME}" sh -c "echo 'SU_TO_ROOT_SU=sudo' >> /home/${USERNAME}/.su-to-rootrc"
-               chroot /root sudo -u "${USERNAME}" gconftool-2 -s -t bool /apps/gksu/sudo-mode true
-               chroot /root sudo -u "${USERNAME}" gconftool-2 -s -t bool /apps/gksu/display-no-pass-info false
+
+               if [ -x /root/usr/bin/gconftool-2 ]
+               then
+                       chroot /root sudo -u "${USERNAME}" gconftool-2 -s -t bool /apps/gksu/sudo-mode true
+                       chroot /root sudo -u "${USERNAME}" gconftool-2 -s -t bool /apps/gksu/display-no-pass-info false
+               fi
 
 chroot /root sudo -u "${USERNAME}" sh -c "umask 0077 && mkdir -p /home/${USERNAME}/.kde/share/config && cat > /home/${USERNAME}/.kde/share/config/kdesurc" << EOF
 [super-user-command]
index 936eeae..ee242a4 100755 (executable)
@@ -28,7 +28,7 @@ then
        exit 0
 fi
 
-log_begin_msg "Configuring fstab..."
+log_begin_msg "Configuring fstab"
 
 # live-initramfs script
 
index 303fbbb..ecbdce1 100755 (executable)
@@ -27,7 +27,7 @@ fi
 
 . /scripts/live-functions
 
-log_begin_msg "Setting up swap..."
+log_begin_msg "Setting up swap"
 
 # live-initramfs script
 
index 94e3cf2..aa75369 100755 (executable)
@@ -27,7 +27,7 @@ fi
 
 . /scripts/live-functions
 
-log_begin_msg "Setting up locales..."
+log_begin_msg "Setting up locales"
 
 # live-initramfs script
 
@@ -75,34 +75,44 @@ then
                locale="${locale}_${uploc}.UTF-8"
        fi
 
-       LANG=$(grep "^${locale}" /root/usr/share/i18n/SUPPORTED | grep UTF-8 | sed -e 's, .*,,' -e q)
+       LANG=
+       language="$(echo ${locale} | cut -d. -f1)"
+       eval $(awk '/^'"${locale}"'/ { print "LANG=" $1 " codepage=" $2; exit; }' /root/usr/share/i18n/SUPPORTED)
 
-       language="${LANG%%.UTF-8*}"
-       if [ -d /root/etc/default/kdm.d/ ]
+       if [ -z "${LANG}" ]
        then
+               # Try and fallback to another codepage for this language.
+               eval $(awk '/^'"${language}"'/ { print "LANG=" $1 " codepage=" $2; exit; }' /root/usr/share/i18n/SUPPORTED)
 
-cat > /root/etc/default/kdm.d/live-autologin << EOF
-LANGUAGE=${language}
-EOF
+               if [ -n "${LANG}" ]
+               then
+                       log_warning_msg "Choosing locale '${LANG}' as '${locale}' is unsupported."
+               fi
+       fi
 
-       elif [ -f /root/etc/kde3/kdm/kdmrc ]
+       if [ -z "${LANG}" ]
        then
-               sed -i -r -e "s/#Language=.*/Language=${language}/" \
-                       /root/etc/kde3/kdm/kdmrc
+               log_warning_msg "Locale '${locale}' is unsupported."
+               codepage="UTF-8"
+               language="en_US"
+               locale="${language}.${codepage}"
+               LANG="${language}.${codepage}"
        fi
 
-       if [ -z "${LANG}" ]
+       if [ -d /root/etc/default/kdm.d/ ]
        then
-               log_warning_msg "Locale ${locale} is unsupported."
-               locale="en_US.UTF-8"
-               LANG="${locale}"
+               printf 'LANGUAGE=%s\n' "${LANG}" >> /root/etc/default/kdm.d/live-autologin
+       elif [ -f /root/etc/kde3/kdm/kdmrc ]
+       then
+               sed -i -r -e "s/#Language=.*/Language=${language}/" \
+                       /root/etc/kde3/kdm/kdmrc
        fi
 
        really_export LANG
 
        printf 'LANG="%s"\n' "${LANG}" >> /root/etc/default/locale
        printf 'LANG="%s"\n' "${LANG}" >> /root/etc/environment
-       printf '%s UTF-8\n' "${LANG}" > /root/etc/locale.gen
+       printf '%s %s\n' "${LANG}" "${codepage}" > /root/etc/locale.gen
        chroot /root /usr/sbin/locale-gen
 fi
 
index 2c880b7..bb9902e 100755 (executable)
@@ -20,17 +20,17 @@ esac
 
 # live-initramfs header
 
-. /scripts/live-functions
-
-log_begin_msg "Setting up automatic login..."
-
-# live-initramfs script
-
 if [ -n "${NOXAUTOLOGIN}" ]
 then
        exit 0
 fi
 
+. /scripts/live-functions
+
+log_begin_msg "Setting up automatic login"
+
+# live-initramfs script
+
 # chroot needed to handle symlinks correctly
 if chroot /root [ -f /etc/gdm/gdm-cdd.conf ]
 then
@@ -71,13 +71,13 @@ then
                  -e "s/^#?AutoLoginUser=.*\$/AutoLoginUser=${USERNAME}/" \
                  -e "s/^#?AutoReLogin=.*\$/AutoReLogin=true/" \
        /root/etc/kde3/kdm/kdmrc
-elif [ -f /root/usr/lib/kde4/etc/kde4/kdm/kdmrc ]
+elif [ -f /root/etc/kde4/kdm/kdmrc ]
 then
        # Configure KDM-KDE4 autologin
        sed -i -r -e "s/^#?AutoLoginEnable=.*\$/AutoLoginEnable=true/" \
                  -e "s/^#?AutoLoginUser=.*\$/AutoLoginUser=$USERNAME/" \
                  -e "s/^#?AutoReLogin=.*\$/AutoReLogin=true/" \
-       /root/usr/lib/kde4/etc/kde4/kdm/kdmrc
+       /root/etc/kde4/kdm/kdmrc
 fi
 
 log_end_msg
index 784aa05..5f1d9e7 100755 (executable)
@@ -27,7 +27,7 @@ fi
 
 . /scripts/live-functions
 
-log_begin_msg "Setting up console keyboard..."
+log_begin_msg "Setting up console keyboard"
 
 # live-initramfs script
 
index 8886af8..3e927a3 100755 (executable)
@@ -27,8 +27,6 @@ fi
 
 . /scripts/live-functions
 
-log_begin_msg "Configuring X..."
-
 # live-initramfs script
 
 if [ "${TERM_TYPE}" = "serial" ]
@@ -43,6 +41,13 @@ then
        exit 0
 fi
 
+if [ ! -x /root/usr/bin/X ]
+then
+       exit 0
+fi
+
+log_begin_msg "Configuring X"
+
 locale=en_US.UTF-8
 
 mount -n -o bind /sys /root/sys
@@ -77,7 +82,9 @@ ${setmodel}
 ${setoptions}
 EOF
 
-DEBUG_XORG_PACKAGE=1 DEBUG_XORG_DEBCONF=1 live-reconfigure /root xserver-xorg
+DEBUG_XORG_PACKAGE=1 DEBUG_XORG_DEBCONF=1 live-reconfigure /root xserver-xorg 2>&1 \
+       | grep -v "overwriting possibly-customised configuration" \
+       | grep -v "file; backup in /etc/X11/xorg.conf"
 umount /root/sys
 umount /root/proc
 umount /root/dev
index c96f0ea..075a53e 100755 (executable)
@@ -25,9 +25,14 @@ then
        exit 0
 fi
 
+if [ ! -x /root/usr/bin/X ]
+then
+       exit 0
+fi
+
 . /scripts/live-functions
 
-log_begin_msg "Configuring X kludges..."
+log_begin_msg "Configuring X video driver"
 
 # live-initramfs script
 
@@ -49,3 +54,4 @@ EOF
        umount /root/dev
 fi
 
+log_end_msg
index a11dc77..24116e9 100755 (executable)
@@ -25,9 +25,14 @@ then
        exit 0
 fi
 
+if [ ! -x /root/usr/bin/X ]
+then
+       exit 0
+fi
+
 . /scripts/live-functions
 
-log_begin_msg "Configuring X kludges..."
+log_begin_msg "Configuring X video modes"
 
 # live-initramfs script
 
index 8322c9c..9767e45 100755 (executable)
@@ -27,7 +27,7 @@ fi
 
 . /scripts/live-functions
 
-log_begin_msg "Configuring gnome-panel-data..."
+log_begin_msg "Configuring gnome-panel-data"
 
 # live-initramfs script
 
index 967d8c9..584d234 100755 (executable)
@@ -27,7 +27,7 @@ fi
 
 . /scripts/live-functions
 
-log_begin_msg "Configuring screensaver..."
+log_begin_msg "Configuring screensaver"
 
 # live-initramfs script
 
index 4cc300a..2240a1b 100755 (executable)
@@ -22,7 +22,7 @@ esac
 
 . /scripts/live-functions
 
-log_begin_msg "Preconfiguring /etc/modules..."
+log_begin_msg "Preconfiguring /etc/modules"
 
 # live-initramfs script
 
index 5e9afe9..6a66996 100755 (executable)
@@ -27,7 +27,7 @@ fi
 
 . /scripts/live-functions
 
-log_begin_msg "Preconfiguring networking..."
+log_begin_msg "Preconfiguring networking"
 
 # live-initramfs script
 
index a8f5a46..2536bd0 100755 (executable)
@@ -27,7 +27,7 @@ fi
 
 . /scripts/live-functions
 
-log_begin_msg "Loading preseed file..."
+log_begin_msg "Loading preseed file"
 
 # live-initramfs script
 
index 6ca1775..3c2f765 100755 (executable)
@@ -22,7 +22,7 @@ esac
 
 . /scripts/live-functions
 
-log_begin_msg "Setting up init..."
+log_begin_msg "Setting up init"
 
 # live-initramfs script
 
index 6bfcc45..7753154 100755 (executable)
@@ -27,7 +27,7 @@ fi
 
 . /scripts/live-functions
 
-log_begin_msg "Configuring accessibility options..."
+log_begin_msg "Configuring accessibility options"
 
 # live-initramfs script
 
index 7a6fef8..e363049 100755 (executable)
@@ -27,7 +27,7 @@ fi
 
 . /scripts/live-functions
 
-log_begin_msg "Disabling update-notifier..."
+log_begin_msg "Disabling update-notifier"
 
 # live-initramfs script
 
@@ -37,7 +37,10 @@ log_begin_msg "Disabling update-notifier..."
 chroot /root dpkg-divert --add --rename --quiet \
        /usr/lib/update-notifier/apt-check
 
-ln -s /bin/true /root/usr/lib/update-notifier/apt-check
+if [ -e /root/usr/lib/update-notifier/apt-check ]
+then
+       ln -s /bin/true /root/usr/lib/update-notifier/apt-check
+fi
 
 # For KDE, adept_notifier's only useful function at the moment is an
 # 'apt-get update' equivalent, so we disable it entirely.
index ec0e03a..8c9eb9a 100755 (executable)
@@ -27,7 +27,7 @@ fi
 
 . /scripts/live-functions
 
-log_begin_msg "Configuring power management..."
+log_begin_msg "Configuring power management"
 
 # live-initramfs script
 
index f300652..47e650d 100755 (executable)
@@ -27,15 +27,13 @@ fi
 
 . /scripts/live-functions
 
-log_begin_msg "Enabling notifications about program crashes..."
+log_begin_msg "Enabling detection of crashes"
 
 # live-initramfs script
 
-update_notifier_version=$(chroot /root dpkg-query -W --showformat='${Version}' update-notifier 2>/dev/null) || update_notifier_version=""
-
-if [ -n "${update_notifier_version}" ]
+if [ -e /root/etc/default/apport ]
 then
-       chroot /root sudo -u "${USERNAME}" gconftool-2 -t bool -s /apps/update-notifier/show_apport_crashes true
+       sed -i 's/enabled=0/enabled=1/' /root/etc/default/apport
 fi
 
 log_end_msg
index e19cf2a..d61c879 100755 (executable)
@@ -27,7 +27,7 @@ fi
 
 . /scripts/live-functions
 
-log_begin_msg "Disabling kpersonalizer..."
+log_begin_msg "Disabling kpersonalizer"
 
 # live-initramfs script
 
index 70495c4..8452d12 100755 (executable)
@@ -27,7 +27,7 @@ fi
 
 . /scripts/live-functions
 
-log_begin_msg "Fixing language selector..."
+log_begin_msg "Fixing language selector"
 
 # live-initramfs script
 
index 62ad1df..667131d 100755 (executable)
@@ -27,7 +27,7 @@ fi
 
 . /scripts/live-functions
 
-log_begin_msg "Disabling trackerd..."
+log_begin_msg "Disabling trackerd"
 
 # live-initramfs script
 
index 16a78f3..d585d3c 100755 (executable)
@@ -2,8 +2,6 @@
 
 PREREQ=""
 
-. /scripts/live-functions
-
 prereqs()
 {
        echo "$PREREQ"
@@ -22,7 +20,9 @@ then
        exit 0
 fi
 
-log_begin_msg "Disabling restricted-manager..."
+. /scripts/live-functions
+
+log_begin_msg "Disabling restricted-manager"
 
 rm -f /root/etc/xdg/autostart/restricted-manager.desktop
 rm -f /root/etc/xdg/autostart/restricted-manager-kde.desktop
@@ -30,7 +30,10 @@ rm -f /root/etc/xdg/autostart/restricted-manager-kde.desktop
 # Since we disable restricted-manager, there isn't much point generating the
 # fglrx or nvidia modules either. The other restricted modules may still be
 # useful.
-sed -i 's/^DISABLED_MODULES=""/DISABLED_MODULES="fglrx nv"/' \
-       /root/etc/default/linux-restricted-modules-common
+if [ -e /root/etc/default/linux-restricted-modules-common ]
+then
+       sed -i 's/^DISABLED_MODULES=""/DISABLED_MODULES="fglrx nv"/' \
+               /root/etc/default/linux-restricted-modules-common
+fi
 
 log_end_msg
index 63da284..00606d5 100755 (executable)
@@ -27,10 +27,13 @@ fi
 
 . /scripts/live-functions
 
-log_begin_msg "Adding APT-CDROM source..."
+log_begin_msg "Adding APT-CDROM source"
 
 # live-initramfs script
 
-chroot /root apt-cdrom -m add
+if [ -d /root/cdrom ]
+then
+       chroot /root apt-cdrom -m add
+fi
 
 log_end_msg
index d325ddb..f87cab4 100755 (executable)
@@ -27,10 +27,13 @@ fi
 
 . /scripts/live-functions
 
-log_begin_msg "Disabling AppArmor (does not work with stacked file systems)..."
+log_begin_msg "Disabling AppArmor (does not work with stacked file systems)"
 
 # live-initramfs script
 
-chroot /root update-rc.d -f apparmor remove
+if [ -x /root/etc/init.d/apparmor ]
+then
+       chroot /root update-rc.d -f apparmor remove
+fi
 
 log_end_msg
index a973843..0a434ed 100755 (executable)
@@ -22,7 +22,7 @@ esac
 
 . /scripts/live-functions
 
-log_begin_msg "Disabling update-initramfs (useless on a live CD)..."
+log_begin_msg "Disabling update-initramfs"
 
 # live-initramfs script
 
index 6ed8d96..7fd026e 100755 (executable)
@@ -22,11 +22,12 @@ esac
 
 . /scripts/live-functions
 
-log_begin_msg "Grant administrative PolicyKit pivilieges to default user..."
+log_begin_msg "Grant administrative PolicyKit pivilieges to default user"
 
 # live-initramfs script
 
 # configure PolicyKit in live session
+mkdir -p /root/etc/PolicyKit
 cat << EOF > /root/etc/PolicyKit/PolicyKit.conf
 <?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- -->
 
index a27a96a..17895ca 100755 (executable)
@@ -27,7 +27,7 @@ fi
 
 . /scripts/live-functions
 
-log_begin_msg "Executing custom hook script..."
+log_begin_msg "Executing custom hook script"
 
 # live-initramfs script
 
index c5055a0..0684dc0 100644 (file)
@@ -1,8 +1,48 @@
-#!/bin/sh
 
 . /scripts/functions
 . /live.vars
 
+# Override log_*_msg until #494257 is merged
+
+_log_msg()
+{
+       if [ "$quiet" = "y" ]; then return; fi
+       printf "$@"
+}
+
+log_success_msg()
+{
+       _log_msg "Success: $@\n"
+}
+
+log_failure_msg()
+{
+       _log_msg "Failure: $@\n"
+}
+
+log_warning_msg()
+{
+       _log_msg "Warning: $@\n"
+}
+
+log_begin_msg()
+{
+       if [ -x /sbin/usplash_write ]; then
+               /sbin/usplash_write "TEXT $@"
+       fi
+       _log_msg "Begin: $@ ... "
+}
+
+log_end_msg()
+{
+       if [ -x /sbin/usplash_write ]; then
+               /sbin/usplash_write "SUCCESS ok"
+       fi
+       _log_msg "done.\n"
+}
+
+##
+
 log_wait_msg ()
 {
        # Print a message and wait for enter
@@ -12,7 +52,7 @@ log_wait_msg ()
                read nunya < /dev/.initramfs/usplash_outfifo
        fi
 
-       _log_msg "Waiting: ${@} ..."
+       _log_msg "Waiting: ${@} ... \n"
 }
 
 really_export ()
@@ -58,3 +98,46 @@ lang2locale() {
                echo "C"
        fi
 }
+
+# Override panic from scripts/functions
+panic() {
+
+       DEB_1="\033[1;31m .''\`.  \033[0m"
+       DEB_2="\033[1;31m: :'  : \033[0m"
+       DEB_3="\033[1;31m\`. \`'\`  \033[0m"
+       DEB_4="\033[1;31m  \`-    \033[0m"
+
+       LIVELOG="\033[1;37m/live.log\033[0m"
+       DEBUG="\033[1;37mdebug\033[0m"
+
+       # Reset redirections to avoid buffering
+       exec 1>&6 6>&-
+       exec 2>&7 7>&-
+       kill ${tailpid}
+
+       printf "\n\n"
+       printf "     ${DEB_1}\n"
+       printf "     ${DEB_2}  \033[1;37mBOOT FAILED!\033[0m\n"
+       printf "     ${DEB_3}\n"
+       printf "     ${DEB_4}  This Debian Live image failed to boot.\n\n"
+
+       printf "  Please file a bug against the 'live-initramfs' package or email the Debian\n"
+       printf "  Live mailing list at <debian-live-devel@lists.alioth.debian.org>, making\n"
+       printf "  sure to note the exact version, name and distribution of the image you were\n"
+       printf "  attempting to boot.\n\n"
+
+       printf "  The file ${LIVELOG} contains some debugging information but booting with the\n"
+       printf "  ${DEBUG} command-line parameter will greatly increase its verbosity which is\n"
+       printf "  extremely useful when diagnosing issues.\n\n"
+
+       if [ -n "${panic}" ]; then
+               printf "  live-initramfs will now restart your system. "
+       else
+               printf "  live-initramfs will now start a shell. "
+       fi
+       printf "The error message was:\n\n    "
+
+       # Call original panic
+       . /scripts/functions
+       panic "$@"
+}
index b8b9cf1..bb5653c 100644 (file)
@@ -1,4 +1,3 @@
-#!/bin/sh
 # live-initramfs helper functions, used by live-initramfs on boot and by live-snapshot
 
 if [ ! -x "/bin/fstype" ]
@@ -31,14 +30,37 @@ subdevices ()
 
 is_supported_fs ()
 {
-       # FIXME: do something better like the scan of supported filesystems
        fstype="${1}"
 
-       case ${fstype} in
-               vfat|iso9660|udf|ext2|ext3|ntfs|jffs2)
+       # Validate input first
+       if [ -z "${fstype}" ]
+       then
+               return 1
+       fi
+
+       # Try to look if it is already supported by the kernel
+       if grep -q ${fstype} /proc/filesystems
+       then
                return 0
-               ;;
-       esac
+       else
+               # Then try to add support for it the gentle way using the initramfs capabilities
+               modprobe ${fstype}
+               if grep -q ${fstype} /proc/filesystems
+               then
+                       return 0
+               # Then try the hard way if /root is already reachable
+               else
+                       kmodule="/root/lib/modules/`uname -r`/${fstype}/${fstype}.ko"
+                       if [ -e "${kmodule}" ]
+                       then
+                               insmod "${kmodule}"
+                               if grep -q ${fstype} /proc/filesystems
+                               then
+                                       return 0
+                               fi
+                       fi
+               fi
+       fi
 
        return 1
 }
@@ -167,7 +189,15 @@ setup_loop ()
        local readonly=${6}
 
        modprobe -q -b "${module}"
-       udevsettle
+
+       if [ -x /sbin/udevadm ]
+       then
+               # lenny
+               udevadm settle
+       else
+               # etch
+               udevsettle
+       fi
 
        for loopdev in ${pattern}
        do
@@ -178,7 +208,7 @@ setup_loop ()
 
                        if [ -n ${readonly} ]
                        then
-                               if /sbin/losetup --help 2>&1 | grep -q -- "-r\b"
+                               if losetup --help 2>&1 | grep -q -- "-r\b"
                                then
                                        options="${options} -r"
                                fi