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

index d98c4f3..36154ea 100755 (executable)
@@ -11,10 +11,10 @@ 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 ! (echo "SET ${question} ${value}"; echo "FSET ${question} seen ${seen}") | chroot "${1}" debconf-communicate -fnoninteractive live-initramfs >/dev/null
 then
 
-chroot "${1}" /usr/bin/debconf-communicate -fnoninteractive live-initramfs >/dev/null << EOF
+chroot "${1}" debconf-communicate -fnoninteractive live-initramfs >/dev/null << EOF
 REGISTER debian-installer/dummy ${question}
 SET ${question} ${value}
 FSET ${question} seen ${seen}
index bb61942..0de5b6c 100644 (file)
@@ -1,50 +1,7 @@
 # /etc/live.conf - configuration file for live-initramfs(7)
 
-# We have a Debian based system of course:
-export BUILD_SYSTEM="Debian"
+USERNAME="user"
+USERFULLNAME="Debian Live user"
+HOSTNAME="debian"
 
-# grml specific settings:
-export USERNAME="grml"
-export USERFULLNAME="grml user"
-export HOSTNAME="grml"
-
-# unionfs or aufs?
-export UNIONTYPE="aufs"
-# we do not want to have a modified /etc/initab:
-export NOAUTOLOGIN="Yes"
-# grml does not require /fastboot:
-export NOFASTBOOT="Yes"
-# disable "mount failed for selinuxfs on /selinux" warning message:
-export SELINUX_INIT="No"
-# do not touch /etc/sudoers:
-export NOSUDO="Yes"
-# do not touch anything inside passwd/shadow/group/gshadow:
-export NOUSER="Yes"
-# do not generate xorg.conf via dexconf - let's use grml-x instead:
-export NOXAUTOCONFIG="Yes"
-# do not modify /etc/fstab:
-export NOFSTAB="Yes"
-# do not modify /etc/hosts:
-export NOHOSTS="Yes"
-
-export NOACCESSIBILITY="Yes"
-export NOAPPARMOR="Yes"
-export NOAPTCDROM="Yes"
-export NOCONSOLEKEYBOARD="Yes"
-export NOKPERSONALIZER="Yes"
-export NOKWALLET="Yes"
-export NOLANGUAGESELECTOR="Yes"
-export NOLOCALES="Yes"
-export NONETWORKING="Yes"
-export NOPERSISTENT="Yes"
-export NOPOWERMANAGEMENT="Yes"
-export NOPRESEED="Yes"
-export NOPROGRAMCRASHES="Yes"
-export NORESTRICTEDMANAGER="Yes"
-export NOTIMEZONE="Yes"
-export NOUPDATENOTIFIER="Yes"
-export NOXAUTOLOGIN="Yes"
-export NOXSCREENSAVER="Yes"
-export NOGNOMEPANEL="Yes"
-
-# EOF
+export USERNAME USERFULLNAME HOSTNAME
index b99df49..a760dba 100644 (file)
@@ -1,5 +1,2 @@
-01_add_rsync.dpatch
-02_more_verbose_toram.diff
 03_fix_cow_tmpfs_mount.dpatch
 04_get_rid_of_utillinux-mountbinary.dpatch
-05_boot_failure_message_grml.dpatch
index 0e1bf0e..a979afc 100755 (executable)
@@ -44,6 +44,9 @@ install: build
 
        # Installing package
        $(MAKE) install DESTDIR=$(CURDIR)/debian/live-initramfs
+       # Install grml specific configuration
+       install -m 644 grml/live.conf ./debian/live-initramfs/etc/live.conf
+       rm -rf ./debian/live-initramfs/usr/share/initramfs-tools/scripts/live-bottom/
 
        # Removing double files
        rm -f debian/live-initramfs/usr/share/doc/live-initramfs/COPYING
index 57494a6..e10c045 100644 (file)
@@ -2,10 +2,6 @@ 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 2a1ae50..495d6eb 100644 (file)
@@ -5,8 +5,6 @@ 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>
@@ -16,10 +14,8 @@ 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 153901c..564e69b 100644 (file)
@@ -1,31 +1,3 @@
-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;
@@ -66,28 +38,10 @@ 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 (LP: #230703).
+    corruption.
 
  -- 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/live.conf b/grml/live.conf
new file mode 100644 (file)
index 0000000..bb61942
--- /dev/null
@@ -0,0 +1,50 @@
+# /etc/live.conf - configuration file for live-initramfs(7)
+
+# We have a Debian based system of course:
+export BUILD_SYSTEM="Debian"
+
+# grml specific settings:
+export USERNAME="grml"
+export USERFULLNAME="grml user"
+export HOSTNAME="grml"
+
+# unionfs or aufs?
+export UNIONTYPE="aufs"
+# we do not want to have a modified /etc/initab:
+export NOAUTOLOGIN="Yes"
+# grml does not require /fastboot:
+export NOFASTBOOT="Yes"
+# disable "mount failed for selinuxfs on /selinux" warning message:
+export SELINUX_INIT="No"
+# do not touch /etc/sudoers:
+export NOSUDO="Yes"
+# do not touch anything inside passwd/shadow/group/gshadow:
+export NOUSER="Yes"
+# do not generate xorg.conf via dexconf - let's use grml-x instead:
+export NOXAUTOCONFIG="Yes"
+# do not modify /etc/fstab:
+export NOFSTAB="Yes"
+# do not modify /etc/hosts:
+export NOHOSTS="Yes"
+
+export NOACCESSIBILITY="Yes"
+export NOAPPARMOR="Yes"
+export NOAPTCDROM="Yes"
+export NOCONSOLEKEYBOARD="Yes"
+export NOKPERSONALIZER="Yes"
+export NOKWALLET="Yes"
+export NOLANGUAGESELECTOR="Yes"
+export NOLOCALES="Yes"
+export NONETWORKING="Yes"
+export NOPERSISTENT="Yes"
+export NOPOWERMANAGEMENT="Yes"
+export NOPRESEED="Yes"
+export NOPROGRAMCRASHES="Yes"
+export NORESTRICTEDMANAGER="Yes"
+export NOTIMEZONE="Yes"
+export NOUPDATENOTIFIER="Yes"
+export NOXAUTOLOGIN="Yes"
+export NOXSCREENSAVER="Yes"
+export NOGNOMEPANEL="Yes"
+
+# EOF
index dea7f0c..190fac5 100755 (executable)
@@ -103,9 +103,6 @@ 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 caaf45b..15710c2 100755 (executable)
@@ -561,9 +561,6 @@ 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
@@ -607,14 +604,14 @@ copy_live_to ()
                        fstype=$(get_fstype "${dev}")
                        freespace=$(fs_size "${dev}")
                else
-                       log_warning_msg "${copytodev} is not a block device."
+                       [ "$quiet" != "y" ] && log_warning_msg "${copytodev} is not a block device."
                        return 1
                fi
        fi
 
        if [ "${freespace}" -lt "${size}" ]
        then
-               log_warning_msg "Not enough free ${free_string} (${freespace}k free, ${size}k needed) to copy live media in ${copytodev}."
+               [ "${quiet}" != "y" ] && log_warning_msg "Not enough free ${free_string} (${freespace}k free, ${size}k needed) to copy live media in ${copytodev}."
                return 1
        fi
 
@@ -688,7 +685,7 @@ do_netmount ()
                NFSROOT=${ROOTSERVER}:${NFSROOT}
        fi
 
-       log_begin_msg "Trying netboot from ${NFSROOT}"
+       [ "${quiet}" != "y" ] && log_begin_msg "Trying netboot from ${NFSROOT}"
 
        if [ "${NETBOOT}" != "nfs" ] && do_cifsmount
        then
@@ -700,7 +697,7 @@ do_netmount ()
                rc=0
        fi
 
-       log_end_msg
+       [ "${quiet}" != "y" ] && log_end_msg
        return ${rc}
 }
 
@@ -722,20 +719,12 @@ do_httpmount ()
                                squashfs|tgz|tar)
                                        if [ "${webfile}" = "FETCH" ]
                                        then
-                                               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
+                                               [ "${quiet}" != "y" ] &&
+                                                       log_begin_msg "Trying wget ${url} -O ${dest}/$(basename ${url})"
+                                               wget "${url}" -O "${dest}/$(basename ${url})"
                                        else
-                                               log_begin_msg "Trying to mount ${url} on ${dest}/$(basename ${url})"
+                                               [ "${quiet}" != "y" ] &&
+                                                       log_begin_msg "Trying to mount ${url} on ${dest}/$(basename ${url})"
                                                if [ "${webfile}" = "FTPFS" ]
                                                then
                                                        FUSE_MOUNT="curlftpfs"
@@ -752,7 +741,7 @@ do_httpmount ()
                                        ;;
 
                                *)
-                                       log_begin_msg "Unrecognized archive extension for ${url}"
+                                       [ "${quiet}" != "y" ] && log_begin_msg "Unrecognized archive extension for ${url}"
                                        ;;
                        esac
                fi
@@ -777,7 +766,7 @@ do_nfsmount ()
                NFSOPTS=""
        fi
 
-       log_begin_msg "Trying nfsmount -o nolock -o ro ${NFSOPTS} ${NFSROOT} ${mountpoint}"
+       [ "${quiet}" != "y" ] && 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
@@ -802,7 +791,7 @@ do_cifsmount ()
                        CIFSOPTS="${NFSOPTS}"
                fi
 
-               log_begin_msg "Trying mount.cifs ${NFSROOT} ${mountpoint} ${CIFSOPTS}"
+               [ "${quiet}" != "y" ] && log_begin_msg "Trying mount.cifs ${NFSROOT} ${mountpoint} ${CIFSOPTS}"
                modprobe -q cifs
 
                if mount.cifs "${NFSROOT}" "${mountpoint}" "${CIFSOPTS}"
@@ -862,7 +851,7 @@ do_snap_copy ()
        else
                return 1
 
-               log_warning_msg "Unable to find the snapshot ${snap_type} medium"
+               [ "${quiet}" != "y" ] && log_warning_msg "Unable to find the snapshot ${snap_type} medium"
        fi
 }
 
@@ -1027,7 +1016,7 @@ setup_unionfs ()
                        rofslist="${image} ${rofslist}"
                elif [ -f "${image}" ]
                then
-                       if losetup --help 2>&1 | grep -q -- "-r\b"
+                       if /sbin/losetup --help 2>&1 | grep -q -- "-r\b"
                        then
                                backdev=$(get_backing_device "${image}" "-r")
                        else
@@ -1041,9 +1030,8 @@ setup_unionfs ()
                        fi
 
                        mkdir -p "${croot}/${imagename}"
-                       log_begin_msg "Mounting \"${image}\" on \"${croot}${imagename}\" via \"${backdev}\""
+                       echo "debug: Mounting backdev \"${backdev}\" (image = ${image}) on croot/imagename \"${croot}/${imagename}\""
                        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
 
@@ -1094,7 +1082,7 @@ setup_unionfs ()
                        cow_fstype=$(get_fstype "${cowprobe}")
                        cow_mountopt="rw,noatime"
                else
-                       log_warning_msg "Unable to find the persistent medium"
+                       [ "${quiet}" != "y" ] && log_warning_msg "Unable to find the persistent medium"
                        cowdevice="tmpfs"
                        cow_fstype="tmpfs"
                        cow_mountopt="rw,noatime,mode=755"
@@ -1121,12 +1109,11 @@ setup_unionfs ()
        else
                cowdevice="tmpfs"
                cow_fstype="tmpfs"
-               cow_mountopt="rw,noatime,mode=755"
        fi
 
        if [ "${cow_fstype}" = "nfs" ]
        then
-               log_begin_msg \
+               [ "${quiet}" != "y" ] && 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"
@@ -1166,7 +1153,6 @@ setup_unionfs ()
        fi
 
        # tmpfs file systems
-       touch /etc/fstab
        mkdir -p "${rootmnt}/live"
        mount -t tmpfs tmpfs ${rootmnt}/live
 
@@ -1182,7 +1168,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
-                       log_warning_msg "Unable to find the persistent home medium"
+                       [ "${quiet}" != "y" ] && log_warning_msg "Unable to find the persistent home medium"
                fi
 
                # Look for other snapshots to copy in
@@ -1210,7 +1196,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" >/dev/null 2>&1 || mount -o bind /cow "${rootmnt}/live/cow" || log_warning_msg "Unable to move or bind /cow to ${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"
 }
 
 check_dev ()
@@ -1349,15 +1335,12 @@ mountroot ()
        tail -f live.log >&7 &
        tailpid="${!}"
 
-       # Ensure 'panic' function is overridden
-       . /scripts/live-functions
-
        Arguments
 
        set_usplash_timeout
-       log_begin_msg "Running /scripts/live-premount"
+       [ "${quiet}" != "y" ] && log_begin_msg "Running /scripts/live-premount"
        run_scripts /scripts/live-premount
-       log_end_msg
+       [ "${quiet}" != "y" ] && log_end_msg
 
        # Needed here too because some things (*cough* udev *cough*)
        # changes the timeout
@@ -1425,10 +1408,10 @@ mountroot ()
        log_end_msg
 
        maybe_break live-bottom
-       log_begin_msg "Running /scripts/live-bottom"
+       [ "${quiet}" != "y" ] && log_begin_msg "Running /scripts/live-bottom"
 
        run_scripts /scripts/live-bottom
-       log_end_msg
+       [ "${quiet}" != "y" ] && log_end_msg
 
        exec 1>&6 6>&-
        exec 2>&7 7>&-
diff --git a/scripts/live-bottom/01integrity_check b/scripts/live-bottom/01integrity_check
new file mode 100755 (executable)
index 0000000..e4710f3
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+       echo "${PREREQ}"
+}
+
+case "${1}" in
+       prereqs)
+               prereqs
+               exit 0
+               ;;
+esac
+
+# live-initramfs script
+
+if grep -qs integrity-check /proc/cmdline
+then
+       cd /live/image
+       md5sum -c md5sum.txt < /dev/tty8 > /dev/tty8
+       reboot
+       while :; do sleep 60; done
+fi
diff --git a/scripts/live-bottom/02etc_live_conf b/scripts/live-bottom/02etc_live_conf
new file mode 100755 (executable)
index 0000000..1623de8
--- /dev/null
@@ -0,0 +1,51 @@
+#!/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 "Copying config on real root fs..."
+
+# live-initramfs script
+
+if [ -f /etc/live.conf ]
+then
+       if [ ! -z "${LIVECONF}" ]
+       then
+               # Updating live.conf
+               sed -i -e 's/\(USERNAME="\).*"/\1'"${USERNAME}"'"/g' \
+                      -e 's/\(USERFULLNAME="\).*"/\1'"${USERFULLNAME}"'"/g' \
+                      -e 's/\(HOSTNAME="\).*"/\1'"${HOSTNAME}"'"/g' \
+               /etc/live.conf
+       fi
+
+       cp -p /etc/live.conf /root/etc/live.conf
+else
+
+cat > /root/etc/live.conf << EOF
+export USERNAME="${USERNAME}"
+export USERFULLNAME="${USERFULLNAME}"
+export HOSTNAME="${HOSTNAME}"
+EOF
+
+fi
+
+log_end_msg
diff --git a/scripts/live-bottom/02timezone b/scripts/live-bottom/02timezone
new file mode 100755 (executable)
index 0000000..e4e91ff
--- /dev/null
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+       echo "${PREREQ}"
+}
+
+case "${1}" in
+       prereqs)
+               prereqs
+               exit 0
+               ;;
+esac
+
+# live-initramfs header
+
+if [ -n "${NOTIMEZONE}" ]
+then
+       exit 0
+fi
+
+. /scripts/live-functions
+
+log_begin_msg "Setting timezone..."
+
+# live-initramfs script
+
+if [ -n "${TIMEZONE}" ]
+then
+       area="$(echo ${TIMEZONE} | cut -f1 -d '/')"
+       zone="$(echo ${TIMEZONE} | cut -f2 -d '/')"
+
+chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null << EOF
+set tzdata/Areas ${area}
+set tzdata/Zones/${area} ${zone}
+EOF
+
+       cp -f /root/usr/share/zoneinfo/${area}/${zone} /root/etc/localtime
+else
+
+chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null << EOF
+set tzdata/Areas Etc
+set tzdata/Zones/Etc UTC
+EOF
+
+       cp -f /root/usr/share/zoneinfo/UTC /root/etc/localtime
+fi
+
+if [ -n "${UTC}" ]
+then
+       sed -i -e "s/UTC=.*/UTC=${UTC}/" /root/etc/default/rcS
+fi
+
+log_end_msg
diff --git a/scripts/live-bottom/06hostname b/scripts/live-bottom/06hostname
new file mode 100755 (executable)
index 0000000..446bc23
--- /dev/null
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+       echo "${PREREQ}"
+}
+
+case "${1}" in
+       prereqs)
+               prereqs
+               exit 0
+               ;;
+esac
+
+# live-initramfs header
+
+if [ -n "${NOHOSTS}" ]
+then
+        exit 0
+fi
+
+. /scripts/live-functions
+
+log_begin_msg "Setting hostname..."
+
+# live-initramfs script
+
+echo "${HOSTNAME}" > /root/etc/hostname
+
+cat >> /root/etc/hosts << EOF
+127.0.0.1 localhost
+127.0.1.1 ${HOSTNAME}
+
+# The following lines are desirable for IPv6 capable hosts
+::1     ip6-localhost ip6-loopback
+fe00::0 ip6-localnet
+ff00::0 ip6-mcastprefix
+ff02::1 ip6-allnodes
+ff02::2 ip6-allrouters
+ff02::3 ip6-allhosts
+EOF
+
+hostname "${HOSTNAME}"
+
+log_end_msg
diff --git a/scripts/live-bottom/10adduser b/scripts/live-bottom/10adduser
new file mode 100755 (executable)
index 0000000..1a80e26
--- /dev/null
@@ -0,0 +1,93 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+       echo "${PREREQ}"
+}
+
+case "${1}" in
+       prereqs)
+               prereqs
+               exit 0
+               ;;
+esac
+
+# live-initramfs header
+
+if [ -n "${NOUSER}" ]
+then
+       exit 0
+fi
+
+. /scripts/live-functions
+
+log_begin_msg "Adding live session user..."
+
+# live-initramfs script
+
+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 999
+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
+
+# 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
+
+if [ -z "${NOSUDO}" ]
+then
+       if ! grep -q "${USERNAME}" /root/etc/sudoers
+       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
+
+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]
+super-user-command=sudo
+EOF
+
+               if [ -f /root/usr/share/apps/konsole/sumc.desktop ]
+               then
+                       chroot /root sudo -u "${USERNAME}" sh -c "umask 0077 && mkdir -p /home/${USERNAME}/.kde/share/apps/konsole && sed -e's/Exec=su.*$/Exec=sudo mc -c/' /usr/share/apps/konsole/sumc.desktop > /home/${USERNAME}/.kde/share/apps/konsole/sumc.desktop"
+               fi
+
+               if [ -f /root/usr/share/apps/konsole/su.desktop ]
+               then
+                       chroot /root sudo -u "${USERNAME}" sh -c "umask 0077 && mkdir -p /home/${USERNAME}/.kde/share/apps/konsole && sed -e's/Exec=su.*$/Exec=sudo -i/' /usr/share/apps/konsole/su.desktop > /home/${USERNAME}/.kde/share/apps/konsole/su.desktop"
+               fi
+       fi
+fi
+
+if [ -L /root/home/${USERNAME}/Examples ]
+then
+       chroot /root install -o ${USERNAME} -g ${USERNAME} -d /home/${USERNAME}/Desktop/
+       mv /root/home/${USERNAME}/Examples /root/home/${USERNAME}/Desktop/
+fi
+
+log_end_msg
diff --git a/scripts/live-bottom/12fstab b/scripts/live-bottom/12fstab
new file mode 100755 (executable)
index 0000000..936eeae
--- /dev/null
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+FSTAB=/root/etc/fstab
+
+prereqs()
+{
+       echo "${PREREQ}"
+}
+
+case "${1}" in
+       prereqs)
+               prereqs
+               exit 0
+               ;;
+esac
+
+# live-initramfs header
+
+. /scripts/live-functions
+
+if [ -n "${NOFSTAB}" ]
+then
+       exit 0
+fi
+
+log_begin_msg "Configuring fstab..."
+
+# live-initramfs script
+
+cat >> ${FSTAB} << EOF
+# /etc/fstab: static file system information.
+#
+# <file system> <mount point>   <type>  <options>       <dump>  <pass>
+
+${UNIONTYPE} / ${UNIONTYPE} rw 0 0
+tmpfs /tmp tmpfs nosuid,nodev 0 0
+EOF
+
+# disabled for now
+#rm -f /root/etc/rcS.d/S*checkroot.sh
+
+if [ "${NOFASTBOOT}" != "Yes" ]
+then
+       touch root/fastboot
+fi
+
+log_end_msg
diff --git a/scripts/live-bottom/13swap b/scripts/live-bottom/13swap
new file mode 100755 (executable)
index 0000000..303fbbb
--- /dev/null
@@ -0,0 +1,64 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+       echo "${PREREQ}"
+}
+
+case "${1}" in
+       prereqs)
+               prereqs
+               exit 0
+               ;;
+esac
+
+# live-initramfs header
+
+if [ -n "${NOSWAP}" ] || [ -n "${NOFSTAB}" ]
+then
+       exit 0
+fi
+
+. /scripts/live-functions
+
+log_begin_msg "Setting up swap..."
+
+# live-initramfs script
+
+FSTAB=/root/etc/fstab
+devices=""
+
+for device in /dev/[hs]d[a-z][0-9]*
+do
+       if ! [ -b "${device}" ]
+       then
+               continue
+       fi
+
+       /lib/udev/vol_id ${device%%[0-9]*} | grep -q "^ID_FS_USAGE=raid" && continue
+
+       magic=$(/bin/dd if="${device}" bs=4086 skip=1 count=1 2>/dev/null | /bin/dd bs=10 count=1 2>/dev/null) || continue
+
+       if [ "${magic}" = "SWAPSPACE2" -o "${magic}" = "SWAP-SPACE" ]
+       then
+               #log "Found ${device}"
+               devices="${devices} ${device}"
+       fi
+done
+
+for device in ${devices}
+do
+
+cat >> ${FSTAB} << EOF
+${device} swap swap defaults 0 0
+EOF
+
+done
+
+log_end_msg
diff --git a/scripts/live-bottom/14locales b/scripts/live-bottom/14locales
new file mode 100755 (executable)
index 0000000..94e3cf2
--- /dev/null
@@ -0,0 +1,109 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+       echo "${PREREQ}"
+}
+
+case "${1}" in
+       prereqs)
+               prereqs
+               exit 0
+               ;;
+esac
+
+# live-initramfs header
+
+if [ -n "${NOLOCALES}" ]
+then
+       exit 0
+fi
+
+. /scripts/live-functions
+
+log_begin_msg "Setting up locales..."
+
+# live-initramfs script
+
+if [ -e /root/etc/default/locale ]
+then
+       grep_file=/root/etc/default/locale
+elif [ -e /root/etc/environment ]
+then
+       # Old locales policy
+       grep_file=/root/etc/environment
+fi
+
+if [ -n "${grep_file}" ]
+then
+       # use rootfs configured locale
+       locale=$(grep -s 'LANG=' ${grep_file} | sed s/'LANG='// | tr -d '"' )
+fi
+
+if [ -n "${LOCALE}" ]
+then
+       locale="${LOCALE}"
+       set_locale="true"
+fi
+
+if [ -z "${locale}" ]
+then
+       # Set a default one
+       locale=en_US.UTF-8
+       set_locale="true"
+fi
+
+if [ "${set_locale}" ]
+then
+       if echo "${locale}" | grep -sqE '^[[:lower:]]{2}$'
+       then
+               # input is like "locale=it", so we will convert and setup also the keyboard if not already set
+               if [ -z "${KBD}" ]
+               then
+                       # FIXME: look if this keyb is supported
+                       KBD="${locale}"
+                       really_export KBD
+               fi
+
+               uploc=$(echo "${locale}" | tr '[a-z]' '[A-Z]')
+               locale="${locale}_${uploc}.UTF-8"
+       fi
+
+       LANG=$(grep "^${locale}" /root/usr/share/i18n/SUPPORTED | grep UTF-8 | sed -e 's, .*,,' -e q)
+
+       language="${LANG%%.UTF-8*}"
+       if [ -d /root/etc/default/kdm.d/ ]
+       then
+
+cat > /root/etc/default/kdm.d/live-autologin << EOF
+LANGUAGE=${language}
+EOF
+
+       elif [ -f /root/etc/kde3/kdm/kdmrc ]
+       then
+               sed -i -r -e "s/#Language=.*/Language=${language}/" \
+                       /root/etc/kde3/kdm/kdmrc
+       fi
+
+       if [ -z "${LANG}" ]
+       then
+               log_warning_msg "Locale ${locale} is unsupported."
+               locale="en_US.UTF-8"
+               LANG="${locale}"
+       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
+       chroot /root /usr/sbin/locale-gen
+fi
+
+log_end_msg
diff --git a/scripts/live-bottom/15autologin b/scripts/live-bottom/15autologin
new file mode 100755 (executable)
index 0000000..2c880b7
--- /dev/null
@@ -0,0 +1,83 @@
+#!/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 "Setting up automatic login..."
+
+# live-initramfs script
+
+if [ -n "${NOXAUTOLOGIN}" ]
+then
+       exit 0
+fi
+
+# chroot needed to handle symlinks correctly
+if chroot /root [ -f /etc/gdm/gdm-cdd.conf ]
+then
+       GDMCONF=/etc/gdm/gdm-cdd.conf
+else
+       GDMCONF=/etc/gdm/gdm.conf
+fi
+
+# chroot needed to handle symlinks correctly
+if chroot /root [ -f ${GDMCONF} ]
+then
+       # true hack ! -- nohar
+       chroot /root cp /usr/share/gdm/defaults.conf /etc/gdm/gdm.conf
+
+       # Configure GDM autologin
+       chroot /root \
+       sed -i -e "s/^AutomaticLoginEnable=.*\$/AutomaticLoginEnable=true/" \
+              -e "s/^AutomaticLogin=.*\$/AutomaticLogin=${USERNAME}/" \
+              -e "s/^TimedLoginEnable=.*\$/TimedLoginEnable=true/" \
+              -e "s/^TimedLogin=.*\$/TimedLogin=${USERNAME}/" \
+              -e "s/^TimedLoginDelay=.*\$/TimedLoginDelay=10/" \
+       ${GDMCONF}
+fi
+
+if [ -d /root/etc/default/kdm.d/ ]
+then
+
+cat >> /root/etc/default/kdm.d/live-autologin << EOF
+AUTOLOGINUSER=${USERNAME}
+AUTOLOGINAGAIN=true
+AUTOLOGINDELAY=0
+EOF
+
+elif [ -f /root/etc/kde3/kdm/kdmrc ]
+then
+       # Configure KDM autologin
+       sed -i -r -e "s/^#?AutoLoginEnable=.*\$/AutoLoginEnable=true/" \
+                 -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 ]
+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
+fi
+
+log_end_msg
diff --git a/scripts/live-bottom/19keyboard b/scripts/live-bottom/19keyboard
new file mode 100755 (executable)
index 0000000..784aa05
--- /dev/null
@@ -0,0 +1,99 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+       echo "${PREREQ}"
+}
+
+case "${1}" in
+       prereqs)
+               prereqs
+               exit 0
+               ;;
+esac
+
+# live-initramfs header
+
+if [ -n "${NOCONSOLEKEYBOARD}" ]
+then
+       exit 0
+fi
+
+. /scripts/live-functions
+
+log_begin_msg "Setting up console keyboard..."
+
+# live-initramfs script
+
+kbd=
+cslayout=
+csvariant=
+csmodel=
+
+# commandline
+if [ -n "${KBD}" ]
+then
+       kbd="${KBD}"
+else
+       kbd=us
+fi
+
+really_export kbd
+
+if [ -n "${KLAYOUT}" ]
+then
+       cslayout="${KLAYOUT}"
+fi
+
+if [ -n "${KVARIANT}" ]
+then
+       csvariant="${KVARIANT}"
+fi
+
+if [ -n "${KMODEL}" ]
+then
+       csmodel="${KMODEL}"
+fi
+
+if [ -x /root/bin/setupcon ] && [ -f /root/etc/default/console-setup ]
+then
+       if [ "${cslayout}" ]
+       then
+               chroot /root sed -i "s/^XKBLAYOUT=.*/XKBLAYOUT=\"${cslayout}\"/" \
+               /etc/default/console-setup
+
+               if [ "${csvariant}" ]
+               then
+                       chroot /root sed -i "s/^XKBVARIANT=.*/XKBVARIANT=\"${csvariant}\"/" \
+                       /etc/default/console-setup
+               else
+                       live-preseed /root console-setup/variantcode '' false
+               fi
+
+               if [ "${csmodel}" ]
+               then
+                       chroot /root sed -i "s/^XKBMODEL=.*/XKBMODEL=\"${csmodel}\"/" \
+                       /etc/default/console-setup
+               else
+                       live-preseed /root console-setup/modelcode '' false
+               fi
+       else
+               live-preseed /root console-setup/layoutcode '' false
+               live-preseed /root console-setup/variantcode '' false
+               live-preseed /root console-setup/modelcode '' false
+       fi
+
+       sed -i 's/CONSOLE_SCREEN=$/CONSOLE_SCREEN=setupcon/; t END; b; : END; n; b END' /root/etc/init.d/usplash
+else
+       chroot /root /usr/sbin/install-keymap ${kbd}
+       live-preseed /root debian-installer/keymap "${kbd}"
+       live-preseed /root kbd-chooser/method "${kbd}"
+fi
+
+log_end_msg
diff --git a/scripts/live-bottom/20xconfig b/scripts/live-bottom/20xconfig
new file mode 100755 (executable)
index 0000000..8886af8
--- /dev/null
@@ -0,0 +1,85 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+       echo "${PREREQ}"
+}
+
+case "${1}" in
+       prereqs)
+               prereqs
+               exit 0
+               ;;
+esac
+
+# live-initramfs header
+
+if [ -n "${NOXAUTOCONFIG}" ]
+then
+       exit 0
+fi
+
+. /scripts/live-functions
+
+log_begin_msg "Configuring X..."
+
+# live-initramfs script
+
+if [ "${TERM_TYPE}" = "serial" ]
+then
+       # Don't bother trying to configure or start X on a serial console
+       rm -f /root/etc/rc?.d/S??[gkx]dm
+       exit 0
+fi
+
+if [ -n "${TEXTONLY}" ]
+then
+       exit 0
+fi
+
+locale=en_US.UTF-8
+
+mount -n -o bind /sys /root/sys
+mount -n -o bind /proc /root/proc
+mount -n -o bind /dev /root/dev
+
+if [ -n "${XDEBCONF}" -a -x /root/usr/sbin/xdebconfigurator ]
+then
+       # xdebconfigurator
+       chroot /root /usr/sbin/xdebconfigurator
+fi
+
+if [ -n "${KOPTIONS}" ]
+then
+       setoptions="set xserver-xorg/config/inputdevice/keyboard/options ${KOPTIONS}"
+fi
+
+if [ -n "${KVARIANT}" ]
+then
+       setvariant="set xserver-xorg/config/inputdevice/keyboard/variant ${KVARIANT}"
+fi
+
+if [ -n "${KMODEL}" ]
+then
+       setmodel="set xserver-xorg/config/inputdevice/keyboard/model ${KMODEL}"
+fi
+
+chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null << EOF
+set xserver-xorg/config/inputdevice/keyboard/layout ${kbd}
+${setvariant}
+${setmodel}
+${setoptions}
+EOF
+
+DEBUG_XORG_PACKAGE=1 DEBUG_XORG_DEBCONF=1 live-reconfigure /root xserver-xorg
+umount /root/sys
+umount /root/proc
+umount /root/dev
+
+log_end_msg
diff --git a/scripts/live-bottom/21xdriver b/scripts/live-bottom/21xdriver
new file mode 100755 (executable)
index 0000000..c96f0ea
--- /dev/null
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+       echo "${PREREQ}"
+}
+
+case "${1}" in
+       prereqs)
+               prereqs
+               exit 0
+               ;;
+esac
+
+# live-initramfs header
+
+if [ -n "${NOXAUTOCONFIG}" ]
+then
+       exit 0
+fi
+
+. /scripts/live-functions
+
+log_begin_msg "Configuring X kludges..."
+
+# live-initramfs script
+
+if [ -n "$XDRIVER" ]
+then
+       mount -n -o bind /sys /root/sys
+       mount -n -o bind /proc /root/proc
+       mount -n -o bind /dev /root/dev
+
+chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null << EOF
+set xserver-xorg/autodetect_video_card false
+set xserver-xorg/config/device/driver ${XDRIVER}
+EOF
+
+       chroot /root dexconf
+
+       umount /root/sys
+       umount /root/proc
+       umount /root/dev
+fi
+
diff --git a/scripts/live-bottom/21xvidemode b/scripts/live-bottom/21xvidemode
new file mode 100755 (executable)
index 0000000..a11dc77
--- /dev/null
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+       echo "${PREREQ}"
+}
+
+case "${1}" in
+       prereqs)
+               prereqs
+               exit 0
+               ;;
+esac
+
+# live-initramfs header
+
+if [ -n "${NOXAUTOCONFIG}" ]
+then
+       exit 0
+fi
+
+. /scripts/live-functions
+
+log_begin_msg "Configuring X kludges..."
+
+# live-initramfs script
+
+if [ -n "$XVIDEOMODE" ]
+then
+       mount -n -o bind /sys /root/sys
+       mount -n -o bind /proc /root/proc
+       mount -n -o bind /dev /root/dev
+
+chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null << EOF
+set xserver-xorg/config/monitor/mode-list ${XVIDEOMODE}
+set xserver-xorg/config/display/modes ${XVIDEOMODE}
+EOF
+
+       chroot /root dexconf
+
+       umount /root/sys
+       umount /root/proc
+       umount /root/dev
+fi
+
+log_end_msg
diff --git a/scripts/live-bottom/22gnome_panel_data b/scripts/live-bottom/22gnome_panel_data
new file mode 100755 (executable)
index 0000000..8322c9c
--- /dev/null
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+       echo "${PREREQ}"
+}
+
+case "${1}" in
+       prereqs)
+               prereqs
+               exit 0
+               ;;
+esac
+
+# live-initramfs header
+
+if [ -n "${NOGNOMEPANEL}" ]
+then
+       exit 0
+fi
+
+. /scripts/live-functions
+
+log_begin_msg "Configuring gnome-panel-data..."
+
+# live-initramfs script
+
+if [ -x /root/usr/sbin/laptop-detect ]
+then
+       if chroot /root laptop-detect
+       then
+               live-reconfigure /root gnome-panel-data
+       fi
+fi
+
+panel_version=$(chroot /root /usr/bin/dpkg-query -W --showformat='${Version}' gnome-panel-data 2>/dev/null) || panel_version=""
+
+if [ -n "${panel_version}" ]
+then
+       chroot /root sudo -u "${USERNAME}" gconftool-2 -s -t bool /apps/panel/global/disable_lock_screen true
+fi
+
+log_end_msg
diff --git a/scripts/live-bottom/22screensaver b/scripts/live-bottom/22screensaver
new file mode 100755 (executable)
index 0000000..967d8c9
--- /dev/null
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+       echo "${PREREQ}"
+}
+
+case "${1}" in
+       prereqs)
+               prereqs
+               exit 0
+               ;;
+esac
+
+# live-initramfs header
+
+if [ -n "${NOXSCREENSAVER}" ]
+then
+       exit 0
+fi
+
+. /scripts/live-functions
+
+log_begin_msg "Configuring screensaver..."
+
+# live-initramfs script
+
+gnome_screensaver_version=$(chroot /root dpkg-query -W --showformat='${Version}' gnome-screensaver 2>/dev/null) || gnome_screensaver_version=""
+
+if [ -n "${gnome_screensaver_version}" ]
+then
+       # Support legacy gconf value
+       chroot /root sudo -u "${USERNAME}" gconftool-2 -t bool -s /apps/gnome-screensaver/lock false
+       chroot /root sudo -u "${USERNAME}" gconftool-2 -t bool -s /apps/gnome-screensaver/lock_enabled false
+fi
+
+log_end_msg
diff --git a/scripts/live-bottom/23etc_modules b/scripts/live-bottom/23etc_modules
new file mode 100755 (executable)
index 0000000..4cc300a
--- /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 "Preconfiguring /etc/modules..."
+
+# live-initramfs script
+
+# load the right modules
+case "${DPKG_ARCH}" in
+       powerpc|ppc64)
+               echo snd_powermac >> /root/etc/modules
+               ;;
+esac
+
+log_end_msg
diff --git a/scripts/live-bottom/23networking b/scripts/live-bottom/23networking
new file mode 100755 (executable)
index 0000000..5e9afe9
--- /dev/null
@@ -0,0 +1,157 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+       echo "${PREREQ}"
+}
+
+case "${1}" in
+       prereqs)
+               prereqs
+               exit 0
+               ;;
+esac
+
+# live-initramfs header
+
+if [ -n "${NONETWORKING}" ]
+then
+       exit 0
+fi
+
+. /scripts/live-functions
+
+log_begin_msg "Preconfiguring networking..."
+
+# live-initramfs script
+
+IFFILE="/root/etc/network/interfaces"
+
+if [ "${STATICIP}" = "frommedia" -a -e  "${IFFILE}" ]
+then
+       # will use existent /etc/network/interfaces
+       log_end_msg
+       exit 0
+fi
+
+cat > "${IFFILE}" << EOF
+auto lo
+iface lo inet loopback
+
+EOF
+
+if [ -x /sbin/udevadm ]
+then
+       # lenny
+       udevadm trigger
+       udevadm settle
+else
+       # etch
+       udevtrigger
+       udevsettle
+fi
+
+if [ -z "${NETBOOT}" -a -n "${STATICIP}" -a "${STATICIP}" != "frommedia" ]
+then
+       parsed=$(echo "${STATICIP}" | sed -e 's/:/ /g')
+
+       for ifline in ${parsed}
+       do
+               ifname="$(echo ${ifline} | cut -f1 -d ',')"
+               ifaddress="$(echo ${ifline} | cut -f2 -d ',')"
+               ifnetmask="$(echo ${ifline} | cut -f3 -d ',')"
+               ifgateway="$(echo ${ifline} | cut -f4 -d ',')"
+
+cat >> "${IFFILE}" << EOF
+auto ${ifname}
+iface ${ifname} inet static
+    address ${ifaddress}
+    netmask ${ifnetmask}
+    gateway ${ifgateway}
+
+EOF
+
+       done
+else
+       if [ -z "${NETBOOT}" ]
+       then
+               # default, dhcp assigned
+               method="dhcp"
+       else
+               # make sure that the preconfigured interface would not get reassigned by dhcp
+               # on startup by ifup script - otherwise our root fs might be disconnected!
+               method="manual"
+       fi
+
+       # iterate the physical interfaces and add them to the interfaces list
+       if [ "${method}" != dhcp ] || [ ! -x /root/usr/sbin/NetworkManager ]
+       then
+               for interface in /sys/class/net/eth* /sys/class/net/ath* /sys/class/net/wlan*
+               do
+                       [ -e ${interface} ] || continue
+                       i="$(basename ${interface})"
+
+cat >> "${IFFILE}" << EOF
+auto ${i}
+iface ${i} inet ${method}
+
+EOF
+
+               done
+       fi
+
+       if [ ! -f /root/etc/resolv.conf ] || [ -z "$(cat /root/etc/resolv.conf)" ]
+       then
+               if [ -f /netboot.config ]
+               then
+                       # create a resolv.conf if it is not present or empty
+                       cp /netboot.config /root/var/log/netboot.config
+
+                       rc_search=$(cat netboot.config | awk '/domain/{print $3}')
+                       rc_server0=$(cat netboot.config | awk '/dns0/{print $5}')
+                       rc_server1=$(cat netboot.config | awk '/dns0/{print $8}')
+                       rc_server0="nameserver ${rc_server0}"
+
+                       if [ "${rc_server1}" = "0.0.0.0" ]
+                       then
+                               rc_server1=""
+                       else
+                               rc_server1="nameserver ${rc_server1}"
+                       fi
+
+cat > /root/etc/resolv.conf << EOF
+# /etc/resolv.conf
+# Autogenerated by live-initramfs
+search ${rc_search}
+domain ${rc_search}
+${rc_server0}
+${rc_server1}
+EOF
+
+                       cat /root/etc/resolv.conf >> /root/var/log/netboot.config
+               fi
+       fi
+fi
+
+#if [ ! -x /root/usr/sbin/NetworkManager ]
+#then
+#      for i in eth0 eth1 eth2 ath0 wlan0
+#      do
+#              grep -q "iface ${i}" ${IFFILE} && continue
+#
+#cat >> "${IFFILE}" << EOF
+#auto ${i}
+#iface ${i} inet dhcp
+#
+#EOF
+#
+#      done
+#fi
+
+log_end_msg
diff --git a/scripts/live-bottom/24preseed b/scripts/live-bottom/24preseed
new file mode 100755 (executable)
index 0000000..a8f5a46
--- /dev/null
@@ -0,0 +1,68 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+       echo "${PREREQ}"
+}
+
+case "${1}" in
+       prereqs)
+               prereqs
+               exit 0
+               ;;
+esac
+
+# live-initramfs header
+
+if [ -n "${NOPRESEED}" ]
+then
+       exit 0
+fi
+
+. /scripts/live-functions
+
+log_begin_msg "Loading preseed file..."
+
+# live-initramfs script
+
+if [ -e /preseed.cfg ]
+then
+       chroot /root debconf-set-selections < /preseed.cfg
+fi
+
+if [ -f "/root/${LOCATION}" ]
+then
+       chroot /root debconf-set-selections < "/root/${LOCATION}"
+fi
+
+if [ -n "${PRESEEDS}" ]
+then
+       for preseed in ${PRESEEDS}
+       do
+               question="${preseed%%=*}"
+               value="${preseed#*=}"
+
+               live-preseed /root "${question}" "${value}"
+       done
+fi
+
+reply="$(echo "GET preseed/early_command" | chroot /root debconf-communicate -fnoninteractive live-initramfs)"
+
+if [ "${reply#0 }" != "${reply}" ]
+then
+       reply="${reply#0 }"
+       sh -c "${reply}"
+fi
+
+# Clear out debconf database backup files to save memory.
+rm -f /root/var/cache/debconf/*.dat-old
+
+log_end_msg
+
+exit 0
diff --git a/scripts/live-bottom/25configure_init b/scripts/live-bottom/25configure_init
new file mode 100755 (executable)
index 0000000..6ca1775
--- /dev/null
@@ -0,0 +1,119 @@
+#!/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 "Setting up init..."
+
+# live-initramfs script
+
+# Arrange for shells on virtual consoles, rather than login prompts
+
+if [ -z "${NOAUTOLOGIN}" ]
+then
+       if [ -n "${USERNAME}" ]
+       then
+               if [ ! -z "${LIVE_GETTY}" ]
+               then
+                       if echo "${DEFCONSOLE}" | grep -qs ttyS
+                       then
+                               # AUTOMATIC SERIAL CONSOLE #
+                               PORT=$(echo "${DEFCONSOLE}" | \
+                                       sed -e 's%,.*%%')
+                               SPEED=$(echo "${DEFCONSOLE}" | \
+                                       sed -e 's%ttyS[0-9]\+,%%' \
+                                       -e's%\([0-9]\+\).*%\1%')
+
+                               if ! ( sed -n -e'/^[^#]/p' /root/etc/inittab | grep -qs ":respawn:/sbin/getty.*${PORT}" )
+                               then
+                                       IDs="A B C D E F G H I J K L M N O P Q R S T Q U V V X Y Z 0 1 2 3 4 5 6 7 8 9"
+
+                                       for ID1 in ${IDs}
+                                       do
+                                               for ID2 in ${IDs}
+                                               do
+                                                       ID="${ID1}${ID2}"
+
+                                                       if ! grep "^${ID}:" /etc/inittab
+                                                       then
+                                                               #make sure it is not already in use
+                                                               break 2
+                                                       fi
+                                               done
+                                       done
+
+                                       echo "${ID}:2345:respawn:/sbin/live-getty -L ${PORT} ${SPEED} vt100" >> /root/etc/inittab
+                               fi
+                       fi
+
+                       if [ -f /root/etc/inittab ]
+                       then
+                               sed -i -e'/^[^#]/s%respawn:/sbin/getty%respawn:/sbin/live-getty%' /root/etc/inittab
+                       fi
+               else
+                       if [ -f /root/etc/inittab ]
+                       then
+                               sed -i -e "s|^\([^:]*:[^:]*:[^:]*\):.*getty.*\<\(tty[0-9]*\).*$|\1:/bin/login -f ${USERNAME} </dev/\2 >/dev/\2 2>\&1|" /root/etc/inittab
+                       fi
+
+                       if [ "/root/etc/event.d/tty*" != "$(echo /root/etc/event.d/tty*)" ]
+                       then
+                               for f in /root/etc/event.d/tty*
+                               do
+                                       sed -i -e "s|^respawn.*|respawn /bin/login -f ${USERNAME} </dev/$(basename ${f}) > /dev/$(basename ${f}) 2>\&1|" ${f}
+                               done
+                       fi
+               fi
+
+               # Since we use autologin, lastlog doesn't make sense on the console.
+               sed -i '/^[^#].*pam_lastlog\.so/s/^/# /' /root/etc/pam.d/login
+       fi
+fi
+
+# do not try to remove files if using file-rc
+if [ -d /etc/rc0.d ]
+then
+       # This has the nice side effect of the cron.{daily,weekly,monthly} jobs in
+       # /etc/crontab remaining disabled, yet also not run by anacron
+       if [ -x /root/usr/sbin/anacron ]
+       then
+               chroot /root dpkg-divert --add --rename --quiet /usr/sbin/anacron
+               ln -s /bin/true /usr/sbin/anacron
+       fi
+
+       # No point, really
+       rm -f /root/etc/rc?.d/[SK]??postfix
+
+       # Avoid clobbering the user's clock
+       rm -f /root/etc/rc?.d/K??hwclock.sh
+fi
+
+# Disable readahead since it doesn't play well with squashfs + unionfs
+# use chmod instead of mv to not trigger unionfs bugs.
+if [ -e /root/sbin/readahead-list ]
+then
+       chmod -x /root/sbin/readahead-list
+fi
+
+log_end_msg
+
+exit 0
diff --git a/scripts/live-bottom/30accessibility b/scripts/live-bottom/30accessibility
new file mode 100755 (executable)
index 0000000..6bfcc45
--- /dev/null
@@ -0,0 +1,138 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+       echo "${PREREQ}"
+}
+
+case "${1}" in
+       prereqs)
+               prereqs
+               exit 0
+               ;;
+esac
+
+# live-initramfs header
+
+if [ -n "${NOACCESSIBILITY}" ]
+then
+       exit 0
+fi
+
+. /scripts/live-functions
+
+log_begin_msg "Configuring accessibility options..."
+
+# live-initramfs script
+
+gconf_version=$(chroot /root /usr/bin/dpkg-query -W --showformat='${Version}' gconf2 2>/dev/null) || gconf_version=""
+
+gct ()
+{
+       if [ "${gconf_version}" ]
+       then
+               chroot /root sudo -u "${USERNAME}" gconftool-2 "${@}"
+       fi
+}
+
+case ${ACCESS} in
+       access=v1)
+               # Lesser Visual Impairment
+               gct -s -t string /desktop/gnome/interface/gtk_theme HighContrastLargePrint
+               gct -s -t string /desktop/gnome/interface/icon_theme HighContrast
+               gct -s -t string /desktop/gnome/interface/monospace_font_name "monospace 18"
+               gct -s -t string /desktop/gnome/interface/font_name "sans 18"
+               gct -s -t string /apps/metacity/general/theme Atlanta
+               gct -s -t string /desktop/gnome/background/picture_filename ""
+               gct -s -t string /desktop/gnome/background/picture_options none
+               gct -s -t string /desktop/gnome/background/primary_color \#666666
+               gct -s -t string /desktop/gnome/background/secondary_color \#7F7F7F
+               gct -s -t string /desktop/gnome/background/color_shading_type solid
+               gct -s -t int /desktop/gnome/peripherals/mouse/cursor_size 48
+               gct -s -t string /desktop/gnome/peripherals/mouse/cursor_theme whiteglass
+               ;;
+
+       access=v2)
+               # Moderate Visual Impairment
+               gct -s -t bool /desktop/gnome/interface/accessibility true
+               gct -s -t bool /desktop/gnome/applications/at/visual/startup true
+               gct -s -t bool /apps/gksu/disable-grab true
+
+               if type orca > /dev/null 2>&1
+               then
+                       mkdir -p /root/home/${USERNAME}/.orca
+                       echo "import orca.settings" >> /root/home/${USERNAME}/.orca/user-settings.py
+                       echo "orca.settings.enableSpeech = False" >> /root/home/${USERNAME}/.orca/user-settings.py
+                       echo "orca.settings.enableMagnifier = True" >> /root/home/${USERNAME}/.orca/user-settings.py
+                       chroot /root chown -R ${USERNAME}:${USERNAME} /home/${USERNAME}/.orca
+               fi
+               ;;
+
+       access=v3)
+               # Blindness
+               # Disabled for now, until we know eSpeak works.
+               #gct -s -t bool /desktop/gnome/sound/enable_esd false
+               gct -s -t bool /desktop/gnome/interface/accessibility true
+               gct -s -t bool /desktop/gnome/applications/at/visual/startup true
+               gct -s -t bool /apps/gksu/disable-grab true
+               gct -s -t string /desktop/gnome/applications/window_manager/default /usr/bin/metacity
+               ;;
+
+       braille=ask)
+               # Braille
+               gct -s -t bool /desktop/gnome/interface/accessibility true
+               gct -s -t bool /desktop/gnome/applications/at/visual/startup true
+               gct -s -t bool /apps/gksu/disable-grab true
+               gct -s -t string /desktop/gnome/applications/window_manager/default /usr/bin/metacity
+
+               if type orca > /dev/null 2>&1
+               then
+                       mkdir -p /root/home/${USERNAME}/.orca
+                       echo "import orca.settings" >> /root/home/${USERNAME}/.orca/user-settings.py
+                       echo "orca.settings.enableSpeech = False" >> /root/home/${USERNAME}/.orca/user-settings.py
+                       echo "orca.settings.enableBraille = True" >> /root/home/${USERNAME}/.orca/user-settings.py
+                       chroot /root chown -R ${USERNAME}:${USERNAME} /home/${USERNAME}/.orca
+               fi
+               ;;
+
+       access=m1)
+               # Minor Motor Difficulties
+               gct -s -t bool /desktop/gnome/accessibility/keyboard/enable true
+               gct -s -t bool /desktop/gnome/accessibility/keyboard/mousekeys_enable true
+               gct -s -t bool /desktop/gnome/accessibility/keyboard/stickykeys_enable true
+               gct -s -t bool /desktop/gnome/accessibility/keyboard/stickykeys_modifier_beep true
+               gct -s -t bool /desktop/accessibility/gnome/keyboard/stickykeys_two_key_off false
+               gct -s -t bool /desktop/gnome/peripherals/keyboard/repeat true
+               gct -s -t int /desktop/gnome/peripherals/keyboard/delay 700
+               gct -s -t int /desktop/gnome/peripherals/keyboard/rate 10
+               gct -s -t bool /apps/gksu/disable-grab true
+
+               if [ -e /root/etc/xdg/xfce4/mcs_settings/keyboard.xml ]
+               then
+                       sed -i 's/0/1/' /root/etc/xdg/xfce4/mcs_settings/keyboard.xml
+               fi
+               ;;
+
+       access=m2)
+               # Motor Difficulties - pointing devices
+               gct -s -t bool /desktop/gnome/accessibility/keyboard/enable true
+               gct -s -t bool /desktop/gnome/interface/accessibility true
+               gct -s -t bool /desktop/gnome/accessibility/keyboard/stickykeys_enable true
+               gct -s -t bool /desktop/gnome/accessibility/keyboard/stickykeys_modifier_beep false
+               gct -s -t bool /desktop/accessibility/gnome/keyboard/stickykeys_two_key_off false
+               gct -s -t list --list-type=string /desktop/gnome/accessibility/startup/exec_ats [onboard]
+
+               if [ -e /root/etc/xdg/xfce4/mcs_settings/keyboard.xml ]
+               then
+                       sed -i '/Sticky/ s/0/1/' /root/etc/xdg/xfce4/mcs_settings/keyboard.xml
+               fi
+               ;;
+esac
+
+log_end_msg
diff --git a/scripts/live-bottom/31disable_update_notifier b/scripts/live-bottom/31disable_update_notifier
new file mode 100755 (executable)
index 0000000..7a6fef8
--- /dev/null
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+       echo "${PREREQ}"
+}
+
+case "${1}" in
+       prereqs)
+               prereqs
+               exit 0
+               ;;
+esac
+
+# live-initramfs header
+
+if [ -n "${NOUPDATENOTIFIER}" ]
+then
+       exit 0
+fi
+
+. /scripts/live-functions
+
+log_begin_msg "Disabling update-notifier..."
+
+# live-initramfs script
+
+# For GNOME, we divert away apt-check to avoid a regular 'apt-get update'
+# equivalent in the live session. We want to run update-notifier for crash
+# report handling.
+chroot /root dpkg-divert --add --rename --quiet \
+       /usr/lib/update-notifier/apt-check
+
+ln -s /bin/true /root/usr/lib/update-notifier/apt-check
+
+# For KDE, adept_notifier's only useful function at the moment is an
+# 'apt-get update' equivalent, so we disable it entirely.
+rm -f /root/usr/share/autostart/adept_notifier_auto.desktop
+
+log_end_msg
diff --git a/scripts/live-bottom/32disable_hibernation b/scripts/live-bottom/32disable_hibernation
new file mode 100755 (executable)
index 0000000..ec0e03a
--- /dev/null
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+       echo "${PREREQ}"
+}
+
+case "${1}" in
+       prereqs)
+               prereqs
+               exit 0
+               ;;
+esac
+
+# live-initramfs header
+
+if [ -n "${NOPOWERMANAGEMENT}" ]
+then
+       exit 0
+fi
+
+. /scripts/live-functions
+
+log_begin_msg "Configuring power management..."
+
+# live-initramfs script
+
+gpm_version=$(chroot /root /usr/bin/dpkg-query -W --showformat='${Version}' gnome-power-manager 2>/dev/null) || panel_version=""
+
+if [ -n "${gpm_version}" ]
+then
+       #live-reconfigure /root gnome-power-manager
+       # Gnome < 2.20
+       chroot /root sudo -u "${USERNAME}" gconftool-2 -s -t bool /apps/gnome-power-manager/can_hibernate false
+       # Gnome >= 2.20
+       chroot /root sudo -u "${USERNAME}" gconftool-2 -s -t bool /apps/gnome-power-manager/general/can_hibernate false
+fi
+
+log_end_msg
diff --git a/scripts/live-bottom/33enable_apport_crashes b/scripts/live-bottom/33enable_apport_crashes
new file mode 100755 (executable)
index 0000000..f300652
--- /dev/null
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+       echo "${PREREQ}"
+}
+
+case "${1}" in
+       prereqs)
+               prereqs
+               exit 0
+               ;;
+esac
+
+# live-initramfs header
+
+if [ -n "${NOPROGRAMCRASHES}" ]
+then
+       exit 0
+fi
+
+. /scripts/live-functions
+
+log_begin_msg "Enabling notifications about program 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}" ]
+then
+       chroot /root sudo -u "${USERNAME}" gconftool-2 -t bool -s /apps/update-notifier/show_apport_crashes true
+fi
+
+log_end_msg
diff --git a/scripts/live-bottom/34disable_kpersonalizer b/scripts/live-bottom/34disable_kpersonalizer
new file mode 100755 (executable)
index 0000000..e19cf2a
--- /dev/null
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+       echo "${PREREQ}"
+}
+
+case "${1}" in
+       prereqs)
+               prereqs
+               exit 0
+               ;;
+esac
+
+# live-initramfs header
+
+if [ -n "${NOKPERSONALIZER}" ]
+then
+       exit 0
+fi
+
+. /scripts/live-functions
+
+log_begin_msg "Disabling kpersonalizer..."
+
+# live-initramfs script
+
+if chroot /root /usr/bin/which kpersonalizer >/dev/null
+then
+       # Disable first-login wizard for KDE
+       if [ ! -f /root/etc/kde3/kpersonalizerrc ]
+       then
+
+cat > /root/etc/kde3/kpersonalizerrc << EOF
+[General]
+FirstLogin=false
+EOF
+
+       else
+               echo "I'm not smart enough to disable kpersonalizer startup" >&2
+               echo "Because kpersonalizerrc already exists" >&2
+       fi
+fi
+
+log_end_msg
diff --git a/scripts/live-bottom/35fix_language_selector b/scripts/live-bottom/35fix_language_selector
new file mode 100755 (executable)
index 0000000..70495c4
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+       echo "${PREREQ}"
+}
+
+case "${1}" in
+       prereqs)
+               prereqs
+               exit 0
+               ;;
+esac
+
+# live-initramfs header
+
+if [ -n "${NOLANGUAGESELECTOR}" ]
+then
+       exit 0
+fi
+
+. /scripts/live-functions
+
+log_begin_msg "Fixing language selector..."
+
+# live-initramfs script
+
+if [ -e /root/usr/share/applications/language-selector.desktop ]
+then
+       sed -i '/^Exec/ s|/usr/bin/gnome-language-selector|& -n|' /root/usr/share/applications/language-selector.desktop
+fi
+
+if [ -x /root/usr/bin/fontconfig-voodoo ]
+then
+       chroot /root fontconfig-voodoo --auto --quiet || true
+fi
+
+log_end_msg
diff --git a/scripts/live-bottom/36disable_trackerd b/scripts/live-bottom/36disable_trackerd
new file mode 100755 (executable)
index 0000000..62ad1df
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+       echo "${PREREQ}"
+}
+
+case "${1}" in
+       prereqs)
+               prereqs
+               exit 0
+               ;;
+esac
+
+# live-initramfs header
+
+if [ -n "${NOTIMEZONE}" ]
+then
+       exit 0
+fi
+
+. /scripts/live-functions
+
+log_begin_msg "Disabling trackerd..."
+
+# live-initramfs script
+
+rm -f /root/etc/xdg/autostart/tracker-applet.desktop \
+       /root/etc/xdg/autostart/trackerd.desktop \
+       /root/usr/share/autostart/trackerd.desktop
+
+log_end_msg
diff --git a/scripts/live-bottom/38disable_restricted_manager b/scripts/live-bottom/38disable_restricted_manager
new file mode 100755 (executable)
index 0000000..16a78f3
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+PREREQ=""
+
+. /scripts/live-functions
+
+prereqs()
+{
+       echo "$PREREQ"
+}
+
+case $1 in
+# get pre-requisites
+prereqs)
+       prereqs
+       exit 0
+       ;;
+esac
+
+if [ -n "${NORESTRICTEDMANAGER}" ]
+then
+       exit 0
+fi
+
+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
+
+# 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
+
+log_end_msg
diff --git a/scripts/live-bottom/41apt_cdrom b/scripts/live-bottom/41apt_cdrom
new file mode 100755 (executable)
index 0000000..63da284
--- /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
+
+if [ -n "${NOAPTCDROM}" ]
+then
+       exit 0
+fi
+
+. /scripts/live-functions
+
+log_begin_msg "Adding APT-CDROM source..."
+
+# live-initramfs script
+
+chroot /root apt-cdrom -m add
+
+log_end_msg
diff --git a/scripts/live-bottom/42disable_apparmor b/scripts/live-bottom/42disable_apparmor
new file mode 100755 (executable)
index 0000000..d325ddb
--- /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
+
+if [ -n "${NOAPPARMOR}" ]
+then
+       exit 0
+fi
+
+. /scripts/live-functions
+
+log_begin_msg "Disabling AppArmor (does not work with stacked file systems)..."
+
+# live-initramfs script
+
+chroot /root update-rc.d -f apparmor remove
+
+log_end_msg
diff --git a/scripts/live-bottom/43disable_updateinitramfs b/scripts/live-bottom/43disable_updateinitramfs
new file mode 100755 (executable)
index 0000000..a973843
--- /dev/null
@@ -0,0 +1,41 @@
+#!/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 "Disabling update-initramfs (useless on a live CD)..."
+
+# live-initramfs script
+
+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 0755 /root/usr/sbin/update-initramfs
+
+log_end_msg
diff --git a/scripts/live-bottom/44pk_allow b/scripts/live-bottom/44pk_allow
new file mode 100755 (executable)
index 0000000..6ed8d96
--- /dev/null
@@ -0,0 +1,50 @@
+#!/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 "Grant administrative PolicyKit pivilieges to default user..."
+
+# live-initramfs script
+
+# configure PolicyKit in live session
+cat << EOF > /root/etc/PolicyKit/PolicyKit.conf
+<?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- -->
+
+<!DOCTYPE pkconfig PUBLIC "-//freedesktop//DTD PolicyKit Configuration 1.0//EN"
+"http://hal.freedesktop.org/releases/PolicyKit/1.0/config.dtd">
+
+<!-- See the manual page PolicyKit.conf(5) for file format -->
+
+<config version="0.1">
+       <match user="root">
+               <return result="yes"/>
+       </match>
+       <!-- don't ask password for user in live session -->
+       <match user="$USERNAME">
+               <return result="yes"/>
+       </match>
+       <define_admin_auth group="admin"/>
+</config>
+EOF
+
+log_end_msg
diff --git a/scripts/live-bottom/99hook b/scripts/live-bottom/99hook
new file mode 100755 (executable)
index 0000000..a27a96a
--- /dev/null
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+       echo "${PREREQ}"
+}
+
+case "${1}" in
+       prereqs)
+               prereqs
+               exit 0
+               ;;
+esac
+
+# live-initramfs header
+
+if [ -z "${HOOK}" ]
+then
+       exit 0
+fi
+
+. /scripts/live-functions
+
+log_begin_msg "Executing custom hook script..."
+
+# live-initramfs script
+
+cd /root
+chroot /root wget "${HOOK}"
+
+FILE="$(basename ${HOOK})"
+
+chmod 0755 "${FILE}"
+./"${FILE}"
+rm -f "${FILE}"
+
+log_end_msg
index 0684dc0..c5055a0 100644 (file)
@@ -1,48 +1,8 @@
+#!/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
@@ -52,7 +12,7 @@ log_wait_msg ()
                read nunya < /dev/.initramfs/usplash_outfifo
        fi
 
-       _log_msg "Waiting: ${@} ... \n"
+       _log_msg "Waiting: ${@} ..."
 }
 
 really_export ()
@@ -98,46 +58,3 @@ 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 bb5653c..b8b9cf1 100644 (file)
@@ -1,3 +1,4 @@
+#!/bin/sh
 # live-initramfs helper functions, used by live-initramfs on boot and by live-snapshot
 
 if [ ! -x "/bin/fstype" ]
@@ -30,37 +31,14 @@ subdevices ()
 
 is_supported_fs ()
 {
+       # FIXME: do something better like the scan of supported filesystems
        fstype="${1}"
 
-       # 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
+       case ${fstype} in
+               vfat|iso9660|udf|ext2|ext3|ntfs|jffs2)
                return 0
-       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
+               ;;
+       esac
 
        return 1
 }
@@ -189,15 +167,7 @@ setup_loop ()
        local readonly=${6}
 
        modprobe -q -b "${module}"
-
-       if [ -x /sbin/udevadm ]
-       then
-               # lenny
-               udevadm settle
-       else
-               # etch
-               udevsettle
-       fi
+       udevsettle
 
        for loopdev in ${pattern}
        do
@@ -208,7 +178,7 @@ setup_loop ()
 
                        if [ -n ${readonly} ]
                        then
-                               if losetup --help 2>&1 | grep -q -- "-r\b"
+                               if /sbin/losetup --help 2>&1 | grep -q -- "-r\b"
                                then
                                        options="${options} -r"
                                fi