help() {
echo
- echo "USAGE: $0 initrd.gz <path-to-new-initrd.gz> <path-to-new-live-uuid> "
+ echo "USAGE: $0 initrd.{l,g}z <path-to-new-initrd> <path-to-new-live-uuid> "
echo
- echo "initrd.gz is the absolute path to the original gzipped initramfs"
- echo "<path-to-new-initrd.gz> is the destination directory for the new gzipped initramfs"
+ echo "initrd.{l,g}z is the absolute path to the original gzipped or lzmaed initramfs"
+ echo "<path-to-new-initrd> is the destination directory for the new compressed initramfs"
echo "<path-to-new-live-uuid> is the destination directory for the new live-uuid-TYPE "
echo
echo "if either path is absent, they will end up in the current directory "
TEMPDIR=`mktemp -d /tmp/uuid-XXXXXX`
TYPE=`uname -r | cut -d '-' -f 3`
+if echo "$1" | grep ".lz$" >/dev/null; then
+ COMPRESSOR="lzma"
+ SUFFIX=".lz"
+elif echo "$1" | grep ".gz$" >/dev/null; then
+ COMPRESSOR="gzip"
+ SUFFIX=".gz"
+else
+ echo "Unsupported archive type."
+ exit 2
+fi
+
if [ -z "$2" ] || [ ! -d "$2" ] || [ "$2" = "." ]; then
- GZIPDIR="$CWD"
+ COMPRESS_DIR="$CWD"
else
- GZIPDIR="$2"
+ COMPRESS_DIR="$2"
fi
if [ -z "$3" ] || [ ! -d "$3" ] || [ "$3" = "." ]; then
fi
cd "$TEMPDIR"
-zcat "$1" | cpio -id
+$COMPRESSOR -cd "$1" -S "$SUFFIX" | cpio -id
uuidgen -r > conf/uuid.conf
-find . | cpio --quiet --dereference -o -H newc | gzip > "$GZIPDIR/initrd.gz"
+find . | cpio --quiet --dereference -o -H newc | $COMPRESSOR -9c > "$COMPRESS_DIR/initrd$SUFFIX"
if [ "$(ls "$LIVEDIR/live-uuid"-* >/dev/null 2>&1 | wc -l)" = 1 ]; then
- cp conf/uuid.conf "$LIVEDIR/live-uuid"-*
+ cp conf/uuid.conf "$LIVEDIR/live-uuid"-*
else
- cp conf/uuid.conf "$LIVEDIR/live-uuid-$TYPE"
+ cp conf/uuid.conf "$LIVEDIR/live-uuid-$TYPE"
fi
cd "$CWD"
rm -rf "$TEMPDIR"
+casper (1.215) lucid; urgency=low
+
+ [ Mario Limonciello ]
+ * Support multiple preseed file/urlarguments on the kernel commandline
+ rather than just selecting the last one and going with that.
+ * debian/control: Set Vcs-Bzr.
+
+ [ Jonathan Riddell ]
+ * Add scripts/casper-bottom/48enable_kubuntu_netbook and ubiquity-
+ hooks/48enable_kubuntu_netbook to enable Plasma Netbook workspace
+ for Kubuntu Netbook Remix
+
+ -- Jonathan Riddell <jriddell@ubuntu.com> Wed, 27 Jan 2010 13:55:42 +0000
+
+casper (1.214) lucid; urgency=low
+
+ * 15autologin: simplify the code with escape character evaluation
+ (LP: #505140)
+
+ -- Didier Roche <didrocks@ubuntu.com> Tue, 12 Jan 2010 08:57:05 +0100
+
+casper (1.213) lucid; urgency=low
+
+ * printf does not evaluate escape characters in the argument string.
+
+ -- Evan Dandrea <evand@ubuntu.com> Mon, 11 Jan 2010 11:02:12 +0000
+
+casper (1.212) lucid; urgency=low
+
+ [ Martin Pitt ]
+ * debian/control: Add ${misc:Depends}.
+ * debian/control: Bump Standards-Version to 3.8.3 (no changes necessary).
+
+ [ Colin Watson ]
+ * 15autologin: Use printf rather than echo -e, since its behaviour is
+ portable across shells.
+
+ [ Evan Dandrea ]
+ * Remove scripts/casper-bottom/42disable_apparmor. Apparmor
+ 2.3.1+bzr1312-0ubuntu3 and ifupdown 0.6.8ubuntu26 now no-op when
+ they detect the live CD environment.
+
+ -- Evan Dandrea <evand@ubuntu.com> Fri, 08 Jan 2010 19:56:27 +0000
+
+casper (1.211) lucid; urgency=low
+
+ * Readd scripts/casper-bottom/15autologin changes: derivatives have
+ now a custom.conf file and still need autologin in live version.
+ Merge with my previous fix proposed for sponsoring one week ago:
+ use echo -e to enable \n interpretation (/bin/sh is busybox ash
+ which behavior differs from vanilla ash interpretor) (LP: #500786)·
+
+ -- Didier Roche <didrocks@ubuntu.com> Tue, 05 Jan 2010 20:05:26 +0100
+
+casper (1.210) lucid; urgency=low
+
+ [ Scott James Remnant ]
+ * Dropped Vcs-Bzr headers, pushed to lp:ubuntu/casper
+ * conf-hooks.d/casper: Changed to FRAMEBUFFER=y
+
+ [ Colin Watson ]
+ * Source /scripts/casper-functions and /scripts/casper-helpers only after
+ processing 'prereqs' argument, to avoid lots of warnings with new
+ initramfs-tools.
+
+ -- Colin Watson <cjwatson@ubuntu.com> Tue, 05 Jan 2010 16:54:54 +0000
+
+casper (1.209) lucid; urgency=low
+
+ * Revert the previous change to 15autologin and instead just make sure
+ custom.conf does not exist.
+
+ -- Evan Dandrea <evand@ubuntu.com> Mon, 04 Jan 2010 11:18:47 +0000
+
+casper (1.208) lucid; urgency=low
+
+ [ Martin Pitt ]
+ * scripts/casper-bottom/25configure_init: sreadahead is no more, disable
+ ureadahead instead.
+
+ [ Didier Roche ]
+ * scripts/casper-bottom/15autologin: Don't erase /etc/gdm/custom.conf but
+ only append autologin on casper startup if needed. This avoids removing
+ default session set in this file for ubuntu derivatives which use GDM.
+ The script also check if the modification is already there for
+ persistent usb keys. (LP: #498971)
+
+ -- Martin Pitt <martin.pitt@ubuntu.com> Mon, 21 Dec 2009 15:54:36 +0100
+
+casper (1.207) lucid; urgency=low
+
+ * Drop 46_disable_services. It didn't need to be running on "all" systems
+ with casper installed. Mythbuntu systems will pull this in via a package
+ that is administerable via ~mythbuntu-dev.
+
+ -- Mario Limonciello <superm1@ubuntu.com> Tue, 24 Nov 2009 22:28:29 -0600
+
+casper (1.206) karmic; urgency=low
+
+ * Fix broken /cdrom writable test in 43disable_initramfs
+ (LP: #450259).
+
+ -- Evan Dandrea <evand@ubuntu.com> Thu, 22 Oct 2009 11:49:15 +0100
+
+casper (1.205) karmic; urgency=low
+
+ * scripts/casper-bottom/25configure_init: Disable sreadahead on live CD
+ boot. Not only does it profile the live CD boot to no benefit, but it
+ also looks as if it may be responsible for breaking Wubi installs by
+ reading from partman's synchronisation FIFOs (LP: #439279).
+
+ -- Colin Watson <cjwatson@ubuntu.com> Tue, 20 Oct 2009 17:32:02 +0100
+
+casper (1.204) karmic; urgency=low
+
+ * scripts/casper-bottom/30accessibility && ubiquity-hooks/30accessibility:
+ - .pulse_a11y_nostart -> pulse_a11y_nostart due to being in a system
+ directory, to completely match the change in pulseaudio, which I missed
+ earlier.
+
+ -- Luke Yelavich <themuso@ubuntu.com> Wed, 14 Oct 2009 08:29:07 +1100
+
+casper (1.203) karmic; urgency=low
+
+ * scripts/casper-bottom/30accessibility && ubiquity-hooks/30accessibility:
+ - Change .pulse_a11y_nostart location to /var/lib/pulseaudio, as per
+ the change in pulseaudio itself, to solve a race condition with volume
+ settings restore.
+
+ -- Luke Yelavich <themuso@ubuntu.com> Mon, 12 Oct 2009 08:31:51 +1100
+
+casper (1.202) karmic; urgency=low
+
+ * scripts/casper-bottom/46_disable_services:
+ - MythTV backend is now an upstart service, so rename it's conf file
+ in /etc/init, rather than using update-rc.d.
+
+ -- Mario Limonciello <superm1@ubuntu.com> Sun, 11 Oct 2009 13:47:00 -0500
+
+casper (1.201) karmic; urgency=low
+
+ [ Colin Watson ]
+ * Don't prompt to eject the SD card on Babbage boards, since for now it's
+ reused as a quasi-boot-floppy (LP: #364273).
+
+ [ James Westby ]
+ * scripts/casper-bottom/44pk_allow_ubuntu: update to work for polkit-1
+ as well. Allow the live cd user to perform any action when at the
+ active console. (LP: #447141)
+
+ -- Colin Watson <cjwatson@ubuntu.com> Fri, 09 Oct 2009 16:06:53 +0100
+
+casper (1.200) karmic; urgency=low
+
+ * scripts/casper-bottom/20xconfig:
+ - Fix xforcevesa to generate a good failsafe xorg.conf (LP: #423969)
+
+ -- Mario Limonciello <superm1@ubuntu.com> Thu, 08 Oct 2009 22:26:42 -0500
+
+casper (1.199) karmic; urgency=low
+
+ [ Tormod Volden ]
+ * Scan device-mapper (RAID) devices for live filesystem (LP: #385305).
+
+ -- Colin Watson <cjwatson@ubuntu.com> Tue, 06 Oct 2009 23:39:57 +0100
+
+casper (1.198) karmic; urgency=low
+
+ * scripts/casper: Send PULSELOGO usplash command at startup. (LP: #438762)
+
+ -- Martin Pitt <martin.pitt@ubuntu.com> Fri, 02 Oct 2009 13:51:07 +0200
+
+casper (1.197) karmic; urgency=low
+
+ [ Colin Watson ]
+ * Fix tty device name construction to work with new upstart (LP: #438678).
+
+ [ Loïc Minier ]
+ * scripts/casper-bottom/22serialtty: pass -L to getty and set term to vt100.
+ * scripts/casper-bottom/22serialtty: set +x...
+
+ -- Colin Watson <cjwatson@ubuntu.com> Thu, 01 Oct 2009 23:27:45 +0100
+
+casper (1.196) karmic; urgency=low
+
+ * Extend our hack that arranges to run setupcon after usplash exits to
+ cover the new Upstartified usplash as well.
+
+ -- Colin Watson <cjwatson@ubuntu.com> Tue, 29 Sep 2009 01:36:55 +0100
+
+casper (1.195) karmic; urgency=low
+
+ [ Oliver Grawert ]
+ * add support for serialtty= cmdline option for debugging purposes in live
+ sessions
+
+ [ Colin Watson ]
+ * Upstart moved /etc/event.d/ to /etc/init/; adjust shell provision on VTs
+ to match (LP: #434769).
+
+ -- Colin Watson <cjwatson@ubuntu.com> Mon, 28 Sep 2009 10:52:32 +0100
+
+casper (1.194) karmic; urgency=low
+
+ * Fix 47unr_ubiquity shell code to make slightly more sense.
+ * Tell mkinitramfs that casper needs usplash (LP: #434980).
+
+ -- Colin Watson <cjwatson@ubuntu.com> Thu, 24 Sep 2009 01:29:21 +0100
+
+casper (1.193) karmic; urgency=low
+
+ * Sync LSB headers in init script with desired behaviour: don't start
+ casper at boot, and stop after umountroot but before halt/reboot.
+
+ -- Colin Watson <cjwatson@ubuntu.com> Mon, 14 Sep 2009 13:08:23 +0100
+
+casper (1.192) karmic; urgency=low
+
+ [ Colin Watson ]
+ * Upgrade to debhelper v7.
+
+ [ Jonathan Riddell ]
+ * Add 37kubuntu_netbook_installer_link to show ubiquity launcher
+
+ -- Jonathan Riddell <jriddell@ubuntu.com> Sat, 12 Sep 2009 00:10:03 +0100
+
+casper (1.191) karmic; urgency=low
+
+ * Slightly re-work 47unr_ubiquity, so that ubiquity doesn't keep getting
+ added to the favourites if persistence is used.·
+
+ -- Steve Kowalik <stevenk@ubuntu.com> Tue, 08 Sep 2009 20:35:00 +1000
+
+casper (1.190) karmic; urgency=low
+
+ [ Colin Watson ]
+ * Don't produce an invalid sed program when trying to remove an applet
+ which isn't in the panel (LP: #406188).
+
+ [ Tormod Volden ]
+ * do not remount filesystems that already have been probed when
+ searching for the livefs (LP: #424464)
+ * Fix quoting in try_snap (LP: #424742).
+ * Silence error messages for non-existent device nodes (LP: #425159).
+
+ -- Colin Watson <cjwatson@ubuntu.com> Mon, 07 Sep 2009 13:10:53 +0100
+
+casper (1.189) karmic; urgency=low
+
+ * In 10adduser fix path to ubiquity-kde.desktop file
+
+ -- Jonathan Riddell <jriddell@ubuntu.com> Wed, 02 Sep 2009 14:54:41 +0100
+
+casper (1.188) karmic; urgency=low
+
+ * Allow for platform-orion-ehci in ID_PATH to qualify as a "nice_device"
+ i.e. one which can host a livefs. This is the name of the USB device
+ driver on Marvell Dove boards.
+
+ -- Loïc Minier <loic.minier@ubuntu.com> Mon, 31 Aug 2009 14:16:21 +0200
+
+casper (1.187) karmic; urgency=low
+
+ * Stop recommending unionfs-fuse, as we're using aufs again in Karmic.
+
+ -- Colin Watson <cjwatson@ubuntu.com> Fri, 28 Aug 2009 12:07:14 +0100
+
+casper (1.186) karmic; urgency=low
+
+ [ Loïc Minier ]
+ * Allow for platform-mxsdhci in ID_PATH to qualify as a "nice_device" i.e.
+ one which can host a livefs. This is the new name of this device in
+ 2.6.31 kernels on Babbage i.MX51.
+
+ [ Steve Kowalik ]
+ * Rename 47unr-ubiquity as 47unr_ubiquity, as scripts with dashes don't
+ get installed into the initramfs. (LP: #411616)
+
+ -- Steve Kowalik <stevenk@ubuntu.com> Fri, 14 Aug 2009 17:39:34 +1000
+
+casper (1.185) karmic; urgency=low
+
+ * Actually set 47unr-ubiquity as executable.·
+
+ -- Steve Kowalik <stevenk@ubuntu.com> Wed, 12 Aug 2009 10:41:35 +1000
+
+casper (1.184) karmic; urgency=low
+
+ [ Evan Dandrea ]
+ * Apply the Ubuntu release version to the installer menu entries as well
+ (LP: #406187).
+
+ [ Colin Watson ]
+ * Fix disabling of apt-check (LP: #406191).
+
+ [ Steve Kowalik ]
+ * Remove the UNR ubiquity .desktop hack in 10adduser.
+ * Set ubiquity as a UNR Favourite in 47unr-ubiquity.
+
+ -- Steve Kowalik <stevenk@ubuntu.com> Fri, 07 Aug 2009 23:11:58 +0100
+
+casper (1.183) karmic; urgency=low
+
+ * Remove erroneous /root prefix on the ubiquity desktop files in
+ 10adduser.
+
+ -- Evan Dandrea <evand@ubuntu.com> Tue, 21 Jul 2009 14:02:34 +0100
+
+casper (1.182) karmic; urgency=low
+
+ [ Evan Dandrea ]
+ * Busybox sed does not preserve ownership, so chown after using it.
+
+ [ Colin Watson ]
+ * Set AutomaticLogin=$USERNAME, not =ubuntu (thanks, arky; LP: #401321).
+
+ [ Mario Limonciello ]
+ * Add support for lzma type archives to casper-new-uuid.
+
+ -- Mario Limonciello <mario_limonciello@dell.com> Mon, 20 Jul 2009 17:36:55 -0500
+
+casper (1.181) karmic; urgency=low
+
+ * Insert a version number in the name field for ubiquity's desktop file
+ (LP: #154506).
+
+ -- Evan Dandrea <evand@ubuntu.com> Wed, 15 Jul 2009 10:11:40 +0100
+
+casper (1.180) karmic; urgency=low
+
+ [ Colin Watson ]
+ * scripts/casper-bottom/15autologin: Minor consistency fixes.
+
+ [ Martin Pitt ]
+ * scripts/casper-bottom/15autologin: Update for new gdm custom configuration
+ file (/etc/gdm/custom.conf). (LP: #395861)
+
+ -- Martin Pitt <martin.pitt@ubuntu.com> Mon, 06 Jul 2009 16:40:00 +0200
+
+casper (1.179) karmic; urgency=low
+
+ [ Colin Watson ]
+ * If LIVE_MEDIA_PATH is set on the command line, record it in
+ /etc/casper.conf for the benefit of ubiquity.
+
+ [ Martin Pitt ]
+ * scripts/casper-bottom/15autologin: Update to work with new gdm.
+
+ -- Martin Pitt <martin.pitt@ubuntu.com> Fri, 03 Jul 2009 14:51:57 +0200
+
+casper (1.178) karmic; urgency=low
+
+ * Ensure that unionfs-fuse isn't killed by /etc/init.d/sendsigs on
+ shutdown (LP: #386010).
+ * Patches from "phl" (https://launchpad.net/~ubuntu-leledy), adjusted by
+ me, to fix snapshot resync:
+ - Avoid using cpio -u -d options if klibc cpio is in use (LP: #384059).
+ - Copy /etc/casper.conf into /root, otherwise we forget snapshot resync
+ settings (LP: #384061).
+ - Adjust the first field of *SNAP entries in casper.conf to be relative
+ to /cow, not /root (LP: #384066).
+ - Prefix $DEST with $MOUNTP in casper-snapshot (LP: #384068).
+ - /etc/init.d/casper is usually called with 'start', so handle that as
+ well as 'stop' to do snapshot resyncing and CD ejecting (LP: #384076).
+ * Fix casper-snapshot(1) syntax to avoid missing spaces between options
+ and their values.
+ * Fix showmounts when used in conjunction with unionfs-fuse; read-only
+ filesystems need to be bind-mounted rather than move-mounted.
+
+ -- Colin Watson <cjwatson@ubuntu.com> Fri, 12 Jun 2009 13:24:28 +0100
+
casper (1.177) karmic; urgency=low
* Port from Debian (thanks, Daniel Baumann):
HOSTNAME="host"
mkdir -p "${mountpoint}"
+tried="/tmp/tried"
# Create /etc/mtab for debug purpose and future syncs
if [ ! -d /etc ]
Arguments ()
{
PRESEEDS=""
+ LOCATIONS=""
for ARGUMENT in $(cat /proc/cmdline)
do
export DEVICE
;;
+ ethdevice=*)
+ ETHDEVICE="${ARGUMENT#ethdevice=}"
+ export ETHDEVICE
+ ;;
+
+ ethdevice-timeout=*)
+ ETHDEV_TIMEOUT="${ARGUMENT#ethdevice-timeout=}"
+ export ETHDEV_TIMEOUT
+ ;;
+
fetch=*)
FETCH="${ARGUMENT#fetch=}"
export FETCH
;;
preseed/file=*|file=*)
- LOCATION="${ARGUMENT#*=}"
- export LOCATION
+ LOCATIONS="${ARGUMENT#*=} ${LOCATIONS}"
+ export LOCATIONS
;;
nopreseed)
;;
url=*)
- location="${ARGUMENT#url=}"
+ URL_LOCATION="${ARGUMENT#url=}"
mount -o bind /sys /root/sys
mount -o bind /proc /root/proc
mkdir -p /root/var/run/network
[ "${NETBOOT}" ] || chroot /root dhclient eth0
- chroot /root wget -P /tmp "${location}"
+ chroot /root wget -P /tmp "${URL_LOCATION}"
[ "${NETBOOT}" ] || chroot /root ifconfig eth0 down
umount /root/sys
umount /root/proc
umount /root/dev
- LOCATION="/tmp/$(basename "${location}")"
+ LOCATIONS="/tmp/$(basename ${URL_LOCATION}) ${LOCATIONS}"
;;
*/*=*)
{
sysfs_path="${1#/sys}"
- if /lib/udev/path_id "${sysfs_path}" | grep -E -q "ID_PATH=(usb|pci-|platform-mmc)"
+ if /lib/udev/path_id "${sysfs_path}" | grep -E -q "ID_PATH=(usb|pci-|platform-orion-ehci|platform-mmc|platform-mxsdhci|)"
then
return 0
elif echo "${sysfs_path}" | grep -q '^/block/vd[a-z]$'
then
return 0
+ elif echo ${sysfs_path} | grep -q "^/block/dm-"
+ then
+ return 0
fi
return 1
udevadm trigger
udevadm settle
+ if [ -z "${NETBOOT}" ] && [ -z "${FETCH}" ] && \
+ [ -z "${HTTPFS}" ] && [ -z "${FTPFS}" ]
+ then
+
+ # if ethdevice was not specified on the kernel command line
+ # make sure we try to get a working network configuration
+ # for *every* present network device (except for loopback of course)
+ if [ -z "$ETHDEVICE" ] ; then
+ echo "If you want to boot from a specific device use bootoption ethdevice=..."
+ for device in /sys/class/net/*; do
+ dev=${device##*/} ;
+ if [ "$dev" != "lo" ] ; then
+ ETHDEVICE="$ETHDEVICE $dev"
+ fi
+ done
+ fi
+
+ # split args of ethdevice=eth0,eth1 into "eth0 eth1"
+ for device in $(echo $ETHDEVICE | sed 's/,/ /g') ; do
+ devlist="$devlist $device"
+ done
+
+ [ -n "$ETHDEV_TIMEOUT" ] || ETHDEV_TIMEOUT=15
+ echo "Using timeout of $ETHDEV_TIMEOUT seconds for network configuration."
+
+ # this is tricky (and ugly) because ipconfig sometimes just hangs/runs into
+ # an endless loop; iff execution fails give it two further tries, that's
+ # why we use '$devlist $devlist $devlist' for the other for loop
+ for dev in $devlist $devlist $devlist ; do
+ echo "Executing ipconfig -t $ETHDEV_TIMEOUT $dev"
+ ipconfig -t "$ETHDEV_TIMEOUT" $dev | tee -a /netboot.config &
+ jobid=$!
+ sleep "$ETHDEV_TIMEOUT" ; sleep 1
+ if [ -r /proc/"$jobid"/status ] ; then
+ echo "Killing job $jobid for device $dev as ipconfig ran into recursion..."
+ kill -9 $jobid
+ fi
+
+ # if configuration of device worked we should have an assigned
+ # IP address, iff so let's use the according as $DEVICE for later usage
+ # simple and primitive approach which seems to work fine
+ if ifconfig $dev | grep -q 'inet.*addr:' ; then
+ export DEVICE="$dev"
+ break
+ fi
+ done
+
+ else
ipconfig ${DEVICE} | tee /netboot.config
+ fi
# source relevant ipconfig output
OLDHOSTNAME=${HOSTNAME}
export HOSTNAME
# Check if we have a network device at all
- if ! ls /sys/class/net/eth0 > /dev/null 2>&1 && \
+ if ! ls /sys/class/net/"$DEVICE" > /dev/null 2>&1 && \
+ ! ls /sys/class/net/eth0 > /dev/null 2>&1 && \
! ls /sys/class/net/wlan0 > /dev/null 2>&1 && \
! ls /sys/class/net/ath0 > /dev/null 2>&1 && \
! ls /sys/class/net/ra0 > /dev/null 2>&1
RES=$?
else
# cpio.gz snapshot
- cd "${snap_mount}"
- zcat "${snapback}/${snapfile}" | /bin/cpio --extract --preserve-modification-time --no-absolute-filenames --sparse --unconditional --make-directories > /dev/null 2>&1
- RES=$?
- if [ "${RES}" != "0" ]
+
+ # Unfortunately klibc's cpio is incompatible with the
+ # rest of the world; everything else requires -u -d,
+ # while klibc doesn't implement them. Try to detect
+ # whether it's in use.
+ cpiopath="$(which cpio)" || true
+ if [ "$cpiopath" ] && grep -aq /lib/klibc "$cpiopath"
then
- log_warning_msg "failure to \"zcat ${snapback}/${snapfile} | /bin/cpio --extract --preserve-modification-time --no-absolute-filenames --sparse --unconditional --make-directories\""
+ cpioargs=
+ else
+ cpioargs='--unconditional --make-directories'
+ fi
+
+ if ! (cd "${snap_mount}" && zcat "${snapback}/${snapfile}" | cpio $cpioargs --extract --preserve-modification-time --no-absolute-filenames --sparse 2>/dev/null)
+ then
+ log_warning_msg "failure to \"zcat ${snapback}/${snapfile} | cpio $cpioargs --extract --preserve-modification-time --no-absolute-filenames --sparse\""
fi
- cd "${OLDPWD}"
fi
umount "${snapback}" || log_warning_msg "failure to \"umount ${snapback}\""
return 1
fi
- echo "export ${snap_type}SNAP="${snap_mount}":${snapdev}:${snapfile}" >> /etc/live.conf # for resync on reboot/halt
+ echo "export ${snap_type}SNAP="/cow${snap_mount#$rootmnt}":${snapdev}:${snapfile}" >> /etc/live.conf # for resync on reboot/halt
return 0
}
case "${UNIONTYPE}" in
unionfs-fuse)
(ulimit -n 16384; unionfs-fuse -o cow -o noinitgroups -o default_permissions -o allow_other -o use_ino -o suid /cow=RW:${exposedrootfs}${dir} "${rootmnt}${dir}" || panic "mount ${UNIONTYPE} on ${rootmnt}${dir} failed with option cow,noinitgroups,default_permissions,allow_other,use_ino,suid=/cow=RW:${exposedrootfs}${dir}")
+ mkdir -p /dev/.initramfs/varrun
+ pidof unionfs-fuse >> /dev/.initramfs/varrun/sendsigs.omit || true
;;
*)
case "${UNIONTYPE}" in
unionfs-fuse)
(ulimit -n 16384; unionfs-fuse -o cow -o noinitgroups -o default_permissions -o allow_other -o use_ino -o suid /cow=RW:${rofsstring} "${rootmnt}" || panic "mount ${UNIONTYPE} on ${rootmnt} failed with option cow,noinitgroups,default_permissions,allow_other,use_ino,suid=/cow:RW:${rofsstring}")
+ mkdir -p /dev/.initramfs/varrun
+ pidof unionfs-fuse >> /dev/.initramfs/varrun/sendsigs.omit || true
;;
*)
# support for fromiso=.../isofrom=....
if [ -n "$FROMISO" ]
then
- mkdir /isofrom
- ISO_DEVICE="$(echo $FROMISO | sed 's|\(/dev/[a-z]*[0-9]*\).*|\1|')"
- mount "$ISO_DEVICE" /isofrom
- ISO_NAME="$(echo $FROMISO | sed 's|/dev/[a-z]*[0-9]*/||')"
- loopdevname=$(setup_loop "/isofrom/${ISO_NAME}" "loop" "/sys/block/loop*" "" '')
- devname="${loopdevname}"
+ ISO_DEVICE=$(dirname $FROMISO)
+ if ! [ -b $ISO_DEVICE ]
+ then
+ # to support unusual device names like /dev/cciss/c0d0p1
+ # as well we have to identify the block device name, let's
+ # do that for up to 15 levels
+ i=15
+ while [ -n "$ISO_DEVICE" ] && [ "$i" -gt 0 ]
+ do
+ ISO_DEVICE=$(dirname ${ISO_DEVICE})
+ [ -b "$ISO_DEVICE" ] && break
+ i=$(($i -1))
+ done
+ fi
+
+ if [ "$ISO_DEVICE" = "/" ]
+ then
+ echo "Warning: device for bootoption isofrom= ($FROMISO) not found.">>/live.log
+ else
+ mkdir /isofrom
+ mount "$ISO_DEVICE" /isofrom
+ ISO_NAME="$(echo $FROMISO | sed "s|$ISO_DEVICE||")"
+ loopdevname=$(setup_loop "/isofrom/${ISO_NAME}" "loop" "/sys/block/loop*" "" '')
+ devname="${loopdevname}"
+ fi
fi
if [ -z "${devname}" ]
umount $mountpoint
fi
fi
+ [ -e "$devname" ] || continue
if [ -n "${LIVE_MEDIA_OFFSET}" ]
then
if is_supported_fs ${fstype}
then
+ devuid=$(blkid -o value -s UUID "$devname")
+ [ -n "$devuid" ] && grep -qs "\<$devuid\>" $tried && continue
mount -t ${fstype} -o ro,noatime "${devname}" ${mountpoint} || continue
+ [ -n "$devuid" ] && echo "$devuid" >> $tried
if is_live_path ${mountpoint} && \
([ "${skip_uuid_check}" ] || matches_uuid ${mountpoint})
esac
# or do the scan of block devices
+ # prefer removable devices over non-removable devices, so scan them first
for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -vE "/(loop|ram|dm-|fd)")
do
+ if [ "$(cat ${sysblock}/removable)" = "1" ]
+ then
+ removable_devices_to_scan="$removable_devices_to_scan $sysblock"
+ else
+ nonremovable_devices_to_scan="$nonremovable_devices_to_scan $sysblock"
+ fi
+ done
+ devices_to_scan="$removable_devices_to_scan $nonremovable_devices_to_scan"
+
+ for sysblock in $devices_to_scan
+ do
devname=$(sys2dev "${sysblock}")
+ [ -e "$devname" ] || continue
fstype=$(get_fstype "${devname}")
if /lib/udev/cdrom_id ${devname} > /dev/null
fi
}
+start_usplash_pulse ()
+{
+ if [ -x /sbin/usplash_write ]
+ then
+ /sbin/usplash_write "PULSELOGO"
+ fi
+}
+
mountroot ()
{
if [ -x /scripts/local-top/cryptroot ]; then
Arguments
set_usplash_timeout
+ start_usplash_pulse
maybe_break live-premount
log_begin_msg "Running /scripts/live-premount"
exec 2>&7 7>&-
kill ${tailpid}
[ -w "${rootmnt}/var/log/" ] && cp live.log "${rootmnt}/var/log/" 2>/dev/null
+ if [ -f /etc/live.conf ]
+ then
+ cp /etc/live.conf "${rootmnt}/etc/"
+ fi
}
-e "s/^TimedLogin=.*\$/TimedLogin=${USERNAME}/" \
-e "s/^TimedLoginDelay=.*\$/TimedLoginDelay=10/" \
${GDMCONF}
+elif [ -d /root/etc/gdm3 ]
+then
+ GDMCustomFile=/root/etc/gdm3/custom.conf
+ AutologinParameters="AutomaticLoginEnable=true\n\
+AutomaticLogin=$USERNAME\n\
+TimedLoginEnable=true\n\
+TimedLogin=$USERNAME\n\
+TimedLoginDelay=10"
+
+ # Prevent from updating if parameters already present (persistent usb
+ # key)
+ if ! $(grep -qs '\[daemon\]' $GDMCustomFile)
+ then
+ echo '[daemon]' >> $GDMCustomFile
+ fi
+
+ sed -i "s/\[daemon\]/\[daemon\]\n$AutologinParameters/" $GDMCustomFile
fi
if [ -d /root/etc/default/kdm.d/ ]
if [ -f /root/etc/init.d/usplash ]
then
sed -i 's/CONSOLE_SCREEN=$/CONSOLE_SCREEN=setupcon/; t END; b; : END; n; b END' /root/etc/init.d/usplash
+ elif [ -f /root/etc/init/usplash.conf ]
+ then
+ sed -i '/^post-stop script/a\
+ setupcon' /root/etc/init/usplash.conf
fi
fi
elif [ -e /root/usr/sbin/install-keymap ]
# 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
log_begin_msg "Configuring X"
-locale=en_US.UTF-8
+if ! grep -q xforcevesa /proc/cmdline 2>&1 >/dev/null
+then
+ 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
-mount -o bind /sys /root/sys
-mount -o bind /proc /root/proc
-mount -o bind /dev /root/dev
+ locale=en_US.UTF-8
-if [ -n "${XDEBCONF}" -a -x /root/usr/sbin/xdebconfigurator ]
-then
- # xdebconfigurator
- chroot /root /usr/sbin/xdebconfigurator
-fi
+ mount -o bind /sys /root/sys
+ mount -o bind /proc /root/proc
+ mount -o bind /dev /root/dev
-if [ -n "${KOPTIONS}" ]
-then
- setoptions="set xserver-xorg/config/inputdevice/keyboard/options ${KOPTIONS}"
-fi
+ if [ -n "${XDEBCONF}" -a -x /root/usr/sbin/xdebconfigurator ]
+ then
+ # xdebconfigurator
+ chroot /root /usr/sbin/xdebconfigurator
+ fi
-if [ -n "${KVARIANT}" ]
-then
- setvariant="set xserver-xorg/config/inputdevice/keyboard/variant ${KVARIANT}"
-fi
+ if [ -n "${KOPTIONS}" ]
+ then
+ setoptions="set xserver-xorg/config/inputdevice/keyboard/options ${KOPTIONS}"
+ fi
-if [ -n "${KMODEL}" ]
-then
- setmodel="set xserver-xorg/config/inputdevice/keyboard/model ${KMODEL}"
-fi
+ if [ -n "${KVARIANT}" ]
+ then
+ setvariant="set xserver-xorg/config/inputdevice/keyboard/variant ${KVARIANT}"
+ fi
-if [ -n "${KLAYOUT}" ]
-then
- setlayout="set xserver-xorg/config/inputdevice/keyboard/layout ${KLAYOUT}"
-fi
+ if [ -n "${KMODEL}" ]
+ then
+ setmodel="set xserver-xorg/config/inputdevice/keyboard/model ${KMODEL}"
+ fi
+
+ if [ -n "${KLAYOUT}" ]
+ then
+ setlayout="set xserver-xorg/config/inputdevice/keyboard/layout ${KLAYOUT}"
+ fi
chroot /root debconf-communicate -fnoninteractive live-initramfs > /dev/null << EOF
${setlayout}
${setoptions}
EOF
-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
+ 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
+else
+
+cat > /root/etc/X11/xorg.conf << EOF
+Section "Device"
+ Identifier "Configured Video Device"
+ Driver "vesa"
+EndSection
+
+Section "Monitor"
+ Identifier "Configured Monitor"
+EndSection
+
+Section "Screen"
+ Identifier "Default Screen"
+ Monitor "Configured Monitor"
+ Device "Configured Video Device"
+EndSection
+EOF
+
+fi
log_end_msg
--- /dev/null
+#!/bin/sh
+
+#set -e
+
+# initramfs-tools header
+
+PREREQ=""
+
+prereqs()
+{
+ echo "${PREREQ}"
+}
+
+case "${1}" in
+ prereqs)
+ prereqs
+ exit 0
+ ;;
+esac
+
+# live-initramfs header
+
+# this bottom script currently only works with upstart
+if [ ! -d /root/etc/init ]
+then
+ exit 0
+fi
+
+. /scripts/live-functions
+
+# live-initramfs script
+
+for ARGUMENT in $(cat /proc/cmdline)
+do
+ case ${ARGUMENT} in
+ serialtty=*)
+ tty="${ARGUMENT#serialtty=}"
+
+ log_begin_msg "Setting up a serial tty..."
+
+cat > /root/etc/init/${tty}.conf <<EOF
+start on stopped rc RUNLEVEL=[2345]
+stop on runlevel [!2345]
+
+respawn
+exec /sbin/getty -L 115200 ${tty} vt100
+EOF
+
+ log_end_msg
+ ;;
+ esac
+done
chroot /root debconf-set-selections < /preseed.cfg
fi
-if [ -f "/root/${LOCATION}" ]
+if [ -n "${LOCATIONS}" ]
then
- chroot /root debconf-set-selections < "/root/${LOCATION}"
+ for item in ${LOCATIONS}
+ do
+ chroot /root debconf-set-selections < "/root${ITEM}"
+ done
fi
if [ -n "${PRESEEDS}" ]
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*)" ]
+ if [ "/root/etc/init/tty*" != "$(echo /root/etc/init/tty*)" ]
then
- for f in /root/etc/event.d/tty*
+ for f in /root/etc/init/tty*
do
- sed -i -e "/^respawn$/!s|^respawn.*|respawn /bin/login -f ${USERNAME} </dev/$(basename ${f}) > /dev/$(basename ${f}) 2>\&1|" ${f}
- sed -i -e "s|^exec.*|exec /bin/login -f ${USERNAME} </dev/$(basename ${f}) > /dev/$(basename ${f}) 2>\&1|" ${f}
+ sed -i -e "s|^exec.*|exec /bin/login -f $USERNAME </dev/$(basename $f .conf) > /dev/$(basename $f .conf) 2>\&1|" $f
done
fi
fi
chmod -x /root/sbin/readahead-list
fi
+# Disable ureadahead too since we don't ship a pack file for it anyway, so
+# all we'll end up doing is profiling the live CD boot. ureadahead also
+# breaks partman occasionally by reading from its synchronisation FIFOs.
+rm -f /root/etc/init/ureadahead.conf
+
log_end_msg
exit 0
local line_no prior_line next_line
line_no="$(grep -n "<string>$1</string>" /root/usr/share/gconf/defaults/05_panel-default-setup.entries | cut -f 1 -d :)"
+ [ "$line_no" ] || return
prior_line="$((line_no-1))"
next_line="$((line_no+1))"
remove_applet fast_user_switch
if [ -x /root/usr/bin/pulse-session ]
then
- touch /root/home/$USERNAME/.pulse_a11y_nostart
- chroot /root chown $USERNAME.$USERNAME /home/$USERNAME/.pulse_a11y_nostart
+ mkdir -p /root/var/lib/pulseaudio
+ touch /root/var/lib/pulseaudio/pulse_a11y_nostart
+ chroot /root chown root.root /var/lib/pulseaudio/pulse_a11y_nostart
mkdir -p /root/home/$USERNAME/.pulse
echo "autospawn = no" > /root/home/$USERNAME/.pulse/client.conf
chroot /root chown -R $USERNAME.$USERNAME /home/$USERNAME/.pulse
if [ -x /root/usr/bin/pulse-session ]
then
- touch /root/home/$USERNAME/.pulse_a11y_nostart
- chroot /root chown $USERNAME.$USERNAME /home/$USERNAME/.pulse_a11y_nostart
+ mkdir -p /root/var/lib/pulseaudio
+ touch /root/var/lib/pulseaudio/pulse_a11y_nostart
+ chroot /root chown root.root /var/lib/pulseaudio/pulse_a11y_nostart
mkdir -p /root/home/$USERNAME/.pulse
echo "autospawn = no" > /root/home/$USERNAME/.pulse/client.conf
chroot /root chown -R $USERNAME.$USERNAME /home/$USERNAME/.pulse
if [ -e /root/usr/lib/update-notifier/apt-check ]
then
- ln -s /bin/true /root/usr/lib/update-notifier/apt-check
+ ln -sf /bin/true /root/usr/lib/update-notifier/apt-check
fi
# For KDE, adept_notifier's only useful function at the moment is an
+++ /dev/null
-#!/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
-
-if [ -x /root/etc/init.d/apparmor ]
-then
- chroot /root update-rc.d -f apparmor remove
-fi
-
-log_end_msg
# Running off a USB disk or other writable media.
if [ -w /root/cdrom ] && \
- ! grep -q '^[^ ]* /root/cdrom [^ ]* [^ ]*\<ro\>' /proc/mounts
+ # rw is guaranteed to be first.
+ grep -q ' /root/cdrom rw[, ]' /proc/self/mountinfo
then
cat > /root/usr/sbin/update-initramfs << 'EOF'
</config>
EOF
+mkdir -p /root/var/lib/polkit-1/localauthority/10-vendor.d
+cat << EOF > /root/var/lib/polkit-1/localauthority/10-vendor.d/10-live-cd.pkla
+# Policy to allow the livecd user to bypass policykit
+[Live CD user permissions]
+Identity=unix-user:$USERNAME
+Action=*
+ResultAny=no
+ResultInactive=no
+ResultActive=yes
+EOF
+
log_end_msg
local encryption=${5}
local readonly=${6}
- modprobe -q -b "${module}"
+ # the output of setup_loop is evaluated in other functions,
+ # modprobe leaks kernel options like "libata.dma=0"
+ # as "options libata dma=0" on stdout, causing serious
+ # problems therefor, so instead always avoid output to stdout
+ modprobe -q -b "${module}" 1>/dev/null
udevadm settle