[ "${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}
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
# 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
* 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/>.
* 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>
* 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>
+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;
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 ]
--- /dev/null
+#!/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
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
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
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
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
rc=0
fi
- [ "${quiet}" != "y" ] && log_end_msg
+ log_end_msg
return ${rc}
}
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"
;;
*)
- [ "${quiet}" != "y" ] && log_begin_msg "Unrecognized archive extension for ${url}"
+ log_begin_msg "Unrecognized archive extension for ${url}"
;;
esac
fi
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
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}"
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
}
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
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
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"
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"
fi
# tmpfs file systems
+ touch /etc/fstab
mkdir -p "${rootmnt}/live"
mount -t tmpfs tmpfs ${rootmnt}/live
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
# 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 ()
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
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>&-
. /scripts/live-functions
-log_begin_msg "Copying config on real root fs..."
+log_begin_msg "Copying config on real root fs"
# live-initramfs script
. /scripts/live-functions
-log_begin_msg "Setting timezone..."
+log_begin_msg "Setting timezone"
# live-initramfs script
. /scripts/live-functions
-log_begin_msg "Moving mount points..."
+log_begin_msg "Moving mount points"
# live-initramfs script
. /scripts/live-functions
-log_begin_msg "Setting hostname..."
+log_begin_msg "Setting hostname"
# live-initramfs script
. /scripts/live-functions
-log_begin_msg "Adding live session user..."
+log_begin_msg "Adding live session user"
# live-initramfs script
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
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]
exit 0
fi
-log_begin_msg "Configuring fstab..."
+log_begin_msg "Configuring fstab"
# live-initramfs script
. /scripts/live-functions
-log_begin_msg "Setting up swap..."
+log_begin_msg "Setting up swap"
# live-initramfs script
. /scripts/live-functions
-log_begin_msg "Setting up locales..."
+log_begin_msg "Setting up locales"
# live-initramfs script
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
# 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
-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
. /scripts/live-functions
-log_begin_msg "Setting up console keyboard..."
+log_begin_msg "Setting up console keyboard"
# live-initramfs script
. /scripts/live-functions
-log_begin_msg "Configuring X..."
-
# live-initramfs script
if [ "${TERM_TYPE}" = "serial" ]
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
${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
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
umount /root/dev
fi
+log_end_msg
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
. /scripts/live-functions
-log_begin_msg "Configuring gnome-panel-data..."
+log_begin_msg "Configuring gnome-panel-data"
# live-initramfs script
. /scripts/live-functions
-log_begin_msg "Configuring screensaver..."
+log_begin_msg "Configuring screensaver"
# live-initramfs script
. /scripts/live-functions
-log_begin_msg "Preconfiguring /etc/modules..."
+log_begin_msg "Preconfiguring /etc/modules"
# live-initramfs script
. /scripts/live-functions
-log_begin_msg "Preconfiguring networking..."
+log_begin_msg "Preconfiguring networking"
# live-initramfs script
. /scripts/live-functions
-log_begin_msg "Loading preseed file..."
+log_begin_msg "Loading preseed file"
# live-initramfs script
. /scripts/live-functions
-log_begin_msg "Setting up init..."
+log_begin_msg "Setting up init"
# live-initramfs script
. /scripts/live-functions
-log_begin_msg "Configuring accessibility options..."
+log_begin_msg "Configuring accessibility options"
# live-initramfs script
. /scripts/live-functions
-log_begin_msg "Disabling update-notifier..."
+log_begin_msg "Disabling update-notifier"
# live-initramfs script
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.
. /scripts/live-functions
-log_begin_msg "Configuring power management..."
+log_begin_msg "Configuring power management"
# live-initramfs script
. /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
. /scripts/live-functions
-log_begin_msg "Disabling kpersonalizer..."
+log_begin_msg "Disabling kpersonalizer"
# live-initramfs script
. /scripts/live-functions
-log_begin_msg "Fixing language selector..."
+log_begin_msg "Fixing language selector"
# live-initramfs script
. /scripts/live-functions
-log_begin_msg "Disabling trackerd..."
+log_begin_msg "Disabling trackerd"
# live-initramfs script
PREREQ=""
-. /scripts/live-functions
-
prereqs()
{
echo "$PREREQ"
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
# 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
. /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
. /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
. /scripts/live-functions
-log_begin_msg "Disabling update-initramfs (useless on a live CD)..."
+log_begin_msg "Disabling update-initramfs"
# live-initramfs script
. /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 -*- -->
. /scripts/live-functions
-log_begin_msg "Executing custom hook script..."
+log_begin_msg "Executing custom hook script"
# live-initramfs script
-#!/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
read nunya < /dev/.initramfs/usplash_outfifo
fi
- _log_msg "Waiting: ${@} ..."
+ _log_msg "Waiting: ${@} ... \n"
}
really_export ()
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 "$@"
+}
-#!/bin/sh
# live-initramfs helper functions, used by live-initramfs on boot and by live-snapshot
if [ ! -x "/bin/fstype" ]
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
}
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
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