install: test build
# Installing configuration
install -D -m 0644 conf/live.conf $(DESTDIR)/etc/live.conf
+ install -D -m 0644 conf/compcache $(DESTDIR)/usr/share/initramfs-tools/conf.d/compcache
# Installing executables
mkdir -p $(DESTDIR)/sbin
[ "${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}
--- /dev/null
+COMPCACHE_SIZE="25%"
* 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 ]
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
# begin copying (or uncompressing)
mkdir "${copyto}"
echo "mount -t ${fstype} ${mount_options} ${dev} ${copyto}"
- mount -t "${fstype}" ${mount_options} "${dev}" "${copyto}"
+ mount -n -t "${fstype}" ${mount_options} "${dev}" "${copyto}"
if [ "${extension}" = "tgz" ]
then
cd "${copyto}"
tar zxf "${copyfrom}/${LIVE_MEDIA_PATH}/$(basename ${FETCH})"
rm -f "${copyfrom}/${LIVE_MEDIA_PATH}/$(basename ${FETCH})"
- mount -r -o move "${copyto}" "${rootmnt}"
+ mount -n -r -o move "${copyto}" "${rootmnt}"
cd "${OLDPWD}"
else
if [ -n "${MODULETORAMFILE}" ]
livefs_root
umount ${copyfrom}
- mount -r -o move ${copyto} ${copyfrom}
+ mount -n -r -o move ${copyto} ${copyfrom}
fi
rmdir ${copyto}
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}
}
{
rc=1
dest="${mountpoint}/${LIVE_MEDIA_PATH}"
- mount -t ramfs ram "${mountpoint}"
+ mount -n -t ramfs ram "${mountpoint}"
mkdir -p "${dest}"
for webfile in HTTPFS FTPFS FETCH
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}"
if [ -n "${fstype}" ]
then
# Copying stuff...
- mount -t "${fstype}" -o ro,noatime "${fromdev}" "${tomount}"
+ mount -n -t "${fstype}" -o ro,noatime "${fromdev}" "${tomount}"
cp -a "${tomount}"/* ${todir}
umount "${tomount}"
else
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}\""
- 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_begin_msg "Mounting \"${image}\" on \"${croot}${imagename}\" via \"${backdev}\""
+ mount -n -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"
else
- # make sure cow_mountopt is set:
- [ -n "$cow_mountopt" ] || cow_mountopt="rw,noatime,mode=755"
- mount -t ${cow_fstype} -o ${cow_mountopt} ${cowdevice} /cow || \
+ mount -n -t ${cow_fstype} -o ${cow_mountopt} ${cowdevice} /cow || \
panic "Can not mount ${cowdevice} (o: ${cow_fstype}) on /cow"
fi
fi
exposedrootfs=${rofslist%% }
- mount --bind ${exposedrootfs} ${rootmnt} || \
+ mount -n --bind ${exposedrootfs} ${rootmnt} || \
panic "bind mount of ${exposedrootfs} failed"
cow_dirs='/var/tmp /var/lock /var/run /var/log /var/spool
for dir in ${cow_dirs}; do
mkdir -p /cow${dir}
- mount -t ${UNIONTYPE} \
+ mount -n -t ${UNIONTYPE} \
-o rw,noatime,dirs=/cow${dir}=rw:${exposedrootfs}${dir}=ro \
${UNIONTYPE} "${rootmnt}${dir}" || \
panic "mount ${UNIONTYPE} on ${rootmnt}${dir} failed with option \
rw,noatime,dirs=/cow${dir}=rw:${exposedrootfs}${dir}=ro"
done
else
- mount -t ${UNIONTYPE} -o noatime,dirs=/cow=rw:${rofsstring} \
+ mount -n -t ${UNIONTYPE} -o noatime,dirs=/cow=rw:${rofsstring} \
${UNIONTYPE} "${rootmnt}" || panic "mount ${UNIONTYPE} on \
${rootmnt} failed with option noatime,dirs=/cow=rw:${rofsstring}"
fi
# tmpfs file systems
+ touch /etc/fstab
mkdir -p "${rootmnt}/live"
- mount -t tmpfs tmpfs ${rootmnt}/live
+ mount -n -t tmpfs tmpfs ${rootmnt}/live
# Adding other custom mounts
if [ -n "${PERSISTENT}" ] && [ -z "${NOPERSISTENT}" ]
if [ -b "${homecow}" ]
then
- mount -t $(get_fstype "${homecow}") -o rw,noatime "${homecow}" "${rootmnt}/home"
+ mount -n -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
;;
*)
- mount -o move "${d}" "${rootmnt}/live/${d##*/}"
+ mount -n -o move "${d}" "${rootmnt}/live/${d##*/}"
;;
esac
done
# 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 -n -o move /cow "${rootmnt}/live/cow" >/dev/null 2>&1 || mount -n -o bind /cow "${rootmnt}/live/cow" || log_warning_msg "Unable to move or bind /cow to ${rootmnt}/live/cow"
}
check_dev ()
if [ -d "${devname}" ]
then
- mount -o bind "${devname}" $mountpoint || continue
+ mount -n -o bind "${devname}" $mountpoint || continue
if is_live_path $mountpoint
then
if is_supported_fs ${fstype}
then
- mount -t ${fstype} -o ro,noatime "${devname}" ${mountpoint} || continue
+ mount -n -t ${fstype} -o ro,noatime "${devname}" ${mountpoint} || continue
if is_live_path ${mountpoint} && \
([ "${skip_uuid_check}" ] || matches_uuid ${mountpoint})
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
# Arrange for shells on virtual consoles, rather than login prompts
-if [ -z "${NOAUTOLOGIN}" ]
+if [ -z "${NOAUTOLOGIN}" ] && [ -n "${USERNAME}" ]
then
- if [ -n "${USERNAME}" ]
+ if [ ! -z "${LIVE_GETTY}" ]
then
- if [ ! -z "${LIVE_GETTY}" ]
+ if echo "${DEFCONSOLE}" | grep -qs ttyS
then
- if echo "${DEFCONSOLE}" | grep -qs ttyS
+ # 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
- # 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}
+ 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
- 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
+ ID="${ID1}${ID2}"
- echo "${ID}:2345:respawn:/sbin/live-getty -L ${PORT} ${SPEED} vt100" >> /root/etc/inittab
- fi
- fi
+ if ! grep "^${ID}:" /etc/inittab
+ then
+ #make sure it is not already in use
+ break 2
+ fi
+ done
+ done
- 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
+ echo "${ID}:2345:respawn:/sbin/live-getty -L ${PORT} ${SPEED} vt100" >> /root/etc/inittab
fi
+ 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
+ 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
- # Since we use autologin, lastlog doesn't make sense on the console.
- sed -i '/^[^#].*pam_lastlog\.so/s/^/# /' /root/etc/pam.d/login
+ 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
# do not try to remove files if using file-rc
. /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
}
mountp="/mnt/tmp_fs_size"
mkdir -p "${mountp}"
- mount -t $(get_fstype "${dev}") -o ro "${dev}" "${mountp}"
+ mount -n -t $(get_fstype "${dev}") -o ro "${dev}" "${mountp}"
doumount=1
fi
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
if [ -n "${old_mountp}" ]
then
- mount -o remount,"${opts}" "${dev}" "${old_mountp}" || panic "Remounting ${dev} ${opts} on ${old_mountp} failed"
- mount -o bind "${old_mountp}" "${mountp}" || panic "Cannot bind-mount ${old_mountp} on ${mountp}"
+ mount -n -o remount,"${opts}" "${dev}" "${old_mountp}" || panic "Remounting ${dev} ${opts} on ${old_mountp} failed"
+ mount -n -o bind "${old_mountp}" "${mountp}" || panic "Cannot bind-mount ${old_mountp} on ${mountp}"
else
- mount -t $(get_fstype "${dev}") -o "${opts}" "${dev}" "${mountp}" || panic "Cannot mount ${dev} on ${mountp}"
+ mount -n -t $(get_fstype "${dev}") -o "${opts}" "${dev}" "${mountp}" || panic "Cannot mount ${dev} on ${mountp}"
fi
}