exit 0
fi
-runcommandinroot "$root" dpkg-reconfigure -fnoninteractive --no-reload -phigh "$package"
+if [ "${BUILD_SYSTEM}" == "Debian" ]; then
+ runcommandinroot "$root" dpkg-reconfigure -fnoninteractive --no-reload -phigh "$package"
+else
+ runcommandinroot "$root" dpkg-reconfigure -fnoninteractive --no-reload "$package"
+fi
exit 0
# This file should go in /etc/casper.conf
# Supported variables are:
-# USERNAME, USERFULLNAME, HOST
+# USERNAME, USERFULLNAME, HOST, BUILD_SYSTEM
export USERNAME="casper"
export USERFULLNAME="Live session user"
export HOST="live"
-
+export BUILD_SYSTEM="Debian"
eject -p -m /live_media >/dev/null 2>&1
# XXX - i18n
-echo -n "Please remove the disc (if any), close the tray (if any) and press ENTER: "
+echo -n "Please remove the disc and close the tray (if any) then press ENTER: "
if [ -x /sbin/usplash_write ]; then
/sbin/usplash_write "TIMEOUT 0"
/sbin/usplash_write "TEXT Please remove the disc, close the tray (if any)"
+casper (1.66+debian-1) unstable; urgency=low
+
+ * Added "magic" to make it work seamlessy also on ubuntu systems.
+ * Default user password now "live".
+
+ -- Marco Amadori <marco.amadori@gmail.com> Fri, 1 Sep 2006 17:18:07 +0200
+
casper (1.65+debian-1) unstable; urgency=low
* New upstream release.
+casper (1.66) edgy; urgency=low
+
+ * Fix use of db_get in ubiquity accessibility hook.
+ * Use sudo instead of su to get to the live session user from the
+ initramfs or to the newly-installed user from ubiquity. su's argument
+ handling has changed so that the previous code no longer worked, and su
+ was never all that good for arguments containing spaces anyway.
+
+ -- Colin Watson <cjwatson@ubuntu.com> Mon, 4 Sep 2006 15:46:55 +0100
+
casper (1.65) edgy; urgency=low
* Update to call udevsettle/udevtrigger instead of udevplug
Source: casper
Section: misc
-Priority: optional
+Priority: extra
Maintainer: Debian Live <debian-live-devel@lists.alioth.debian.org>
Uploaders: Marco Amadori <marco.amadori@gmail.com>, Daniel Baumann <daniel@debian.org>
-Build-Depends: debhelper (>= 4)
+Build-Depends: debhelper (>= 4), lsb-release
Standards-Version: 3.7.2
Package: casper
--- /dev/null
+Source: casper
+Section: misc
+Priority: extra
+Maintainer: Debian Live <debian-live-devel@lists.alioth.debian.org>
+Uploaders: Marco Amadori <marco.amadori@gmail.com>, Daniel Baumann <daniel@debian.org>
+Build-Depends: debhelper (>= 4), lsb-release
+Standards-Version: 3.7.2
+
+Package: casper
+Architecture: any
+Depends: initramfs-tools (>= 0.40), user-setup
+Conflicts: usplash (<< 0.1-30)
+Recommends: live-package
+Suggests: dmsetup
+Description: Debian Live initramfs generator
+ Casper provides an initramfs generator suited for booting a Debian Live systems
+ from read only media. Useful to build live CDs.
--- /dev/null
+Source: casper
+Section: misc
+Priority: optional
+Maintainer: Tollef Fog Heen <tfheen@ubuntu.com>
+Build-Depends: debhelper (>> 4.2.0), lsb-release
+Standards-Version: 3.6.1
+
+Package: casper
+Architecture: any
+Section: misc
+Priority: extra
+Depends: initramfs-tools (>= 0.40ubuntu11), dmsetup, user-setup, sudo
+Conflicts: usplash (<< 0.1-30)
+Description: Run a "live" preinstalled system from read-only media
+
+Package: ubiquity-casper
+Architecture: all
+Depends: laptop-detect, sudo
+Conflicts: espresso-casper
+Replaces: espresso-casper
+Enhances: ubiquity
+Description: Configuration hooks for live installer
+ This package provides hook scripts for the Ubiquity live installer that
+ repeat some pieces of configuration done by the live system boot process in
+ the system installed by Ubiquity.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
+# Looking in which build system we are
+BUILD_SYSTEM := $(shell lsb_release --short --id)
+
build: build-stamp
build-stamp:
dh_testdir
-
+ # Setting BUILD_SYSTEM in the binary package
+ sed -i -e 's/\(BUILD_SYSTEM="\).*"/\1'$(BUILD_SYSTEM)'"/g' casper.conf
+ifeq ($(BUILD_SYSTEM),Debian)
+ cp debian/control.debian debian/control
+else
+ cp debian/control.ubuntu debian/control
+endif
+
# Building package
$(MAKE) -C casper-md5check
touch build-stamp
clean:
+
dh_testdir
rm -f build-stamp
# Cleaning package
-$(MAKE) -C casper-md5check clean
+ # Putting back default files
+ cp -f debian/control.debian debian/control
+ sed -i -e 's/\(BUILD_SYSTEM="\).*"/\1'Debian'"/g' casper.conf
+
dh_clean
+
install: build
+
dh_testdir
dh_testroot
dh_clean -k
# Installing lintian override
install -D -m 0644 debian/lintian debian/casper/usr/share/lintian/overrides/casper
+ # Install casper.conf
+ install -m 0644 casper.conf debian/casper/etc/casper.conf
+
binary-indep: build install
+ifneq ($(BUILD_SYSTEM),Debian)
+ # Conditionally build Ubiquity
+ dh_testdir
+ dh_testroot
+ dh_installexamples -i
+ dh_installdocs -i
+ dh_installchangelogs -i
+ dh_compress -i
+ dh_fixperms -i
+ dh_installdeb -i
+ dh_gencontrol -i
+ dh_md5sums -i
+ dh_builddeb -i
+endif
binary-arch: build install
+
dh_testdir
dh_testroot
- dh_installchangelogs debian/changelog.upstream
- dh_installdocs
- dh_installexamples
- dh_installinit -r --no-start -- start 89 0 6 .
- dh_link
- dh_strip
- dh_compress
- dh_fixperms
- dh_installdeb
- dh_gencontrol
- dh_md5sums
- dh_builddeb
+ifeq ($(BUILD_SYSTEM),Debian)
+ dh_installchangelogs -a debian/changelog.upstream
+else
+ dh_installchangelogs -a
+endif
+ dh_installdocs -a
+ dh_installexamples -a
+ dh_installinit -a -r --no-start -- start 89 0 6 .
+ dh_link -a
+ dh_strip -a
+ dh_compress -a
+ dh_fixperms -a
+ dh_installdeb -a
+ dh_gencontrol -a
+ dh_md5sums -a
+ dh_builddeb -a
binary: binary-arch binary-indep
.PHONY: build clean binary-indep binary-arch binary install
. /usr/share/initramfs-tools/hook-functions
-
manual_add_modules unionfs
+# Copy in casper.conf
+if [ -e /etc/casper.conf ]; then
+ . /etc/casper.conf
+ mkdir -p ${DESTDIR}/etc
+ cp /etc/casper.conf ${DESTDIR}/etc
+fi
+
# Needed for devmapper
if [ -e /sbin/dmsetup ]; then
- manual_add_modules cloop
- copy_exec /sbin/blockdev /sbin
- copy_exec /sbin/dmsetup /sbin
- manual_add_modules dm-snapshot
+ manual_add_modules cloop
+ copy_exec /sbin/blockdev /sbin
+ copy_exec /sbin/dmsetup /sbin
+ manual_add_modules dm-snapshot
fi
# We need losetup
copy_exec /usr/share/casper/casper-reconfigure /bin
copy_exec /usr/share/casper/casper-preseed /bin
-# Ubuntu or Debian test
-# mkdir -p ${DESTDIR}/lib/udev
-# copy_exec /lib/udev/cdrom_id /lib/udev
-# copy_exec /lib/udev/vol_id /lib/udev
-# copy_exec /lib/udev/path_id /lib/udev
-# FIXME: add lsb check for ubuntu
+if [ "${BUILD_SYSTEM}" == "Ubuntu" ]; then
+ mkdir -p ${DESTDIR}/lib/udev
+ copy_exec /lib/udev/cdrom_id /lib/udev
+ copy_exec /lib/udev/vol_id /lib/udev
+ copy_exec /lib/udev/path_id /lib/udev
+fi
+
copy_exec /sbin/udevtrigger /sbin
copy_exec /sbin/udevsettle /sbin
-
copy_exec /usr/bin/udevinfo /bin
-# cifs boot
+# cifs boot
if [ -x /sbin/mount.cifs ]; then
- copy_exec /sbin/mount.cifs /sbin
- for x in cifs; do
- manual_add_modules ${x}
- done
+ copy_exec /sbin/mount.cifs /sbin
+ for x in cifs; do
+ manual_add_modules ${x}
+ done
fi
# squashfs
USERNAME="casper"
USERFULLNAME="Live session user"
HOST="live"
+BUILD_SYSTEM="Debian"
mkdir -p $mountpoint
[ -f /etc/casper.conf ] && . /etc/casper.conf
-export USERNAME USERFULLNAME HOST
+export USERNAME USERFULLNAME HOST BUILD_SYSTEM
+
+if [ "${BUILD_SYSTEM}" == "Ubuntu" ]; then
+ MP_QUIET="-Q"
+else
+ MP_QUIET="-q"
+fi
# looking for casper specifics options as kernel parameters
for x in $(cat /proc/cmdline); do
local module=$2
local pattern=$3
- modprobe -qb "$module"
+ modprobe "${MP_QUIET}" -b "$module"
udevsettle
for loopdev in $pattern; do
backdev="$1"
rootmnt="$2"
- modprobe -qb dm-mod
+ modprobe "${MP_QUIET}" -b dm-mod
COW_DEVICE=/dev/ram1
COW_NAME="casper-cow"
do_netmount() {
rc=1
- modprobe -q af_packet # For DHCP
+ modprobe "${MP_QUIET}" af_packet # For DHCP
ipconfig ${DEVICE} /tmp/net-${DEVICE}.conf
do_nfsmount() {
rc=1
- modprobe -q nfs
+ modprobe "${MP_QUIET}" nfs
if [ -z "${NFSOPTS}" ]; then
NFSOPTS=""
fi
fi
[ "$quiet" != "y" ] && log_begin_msg "Trying mount.cifs ${NFSROOT} ${mountpoint} ${CIFSOPTS}"
- modprobe -q cifs
+ modprobe "${MP_QUIET}" cifs
if mount.cifs "${NFSROOT}" "${mountpoint}" "${CIFSOPTS}" ; then
rc=0
image_directory="$1"
rootmnt="$2"
- modprobe -qb unionfs
+ modprobe "${MP_QUIET}" -b unionfs
# run-init can't deal with this, but we're going to move all of these
# away before it runs anyway.
log_begin_msg "$DESCRIPTION"
+if [ "${BUILD_SYSTEM}" == "Debian" ]; then
+ user_crypted="8Ab05sVQ4LLps" # as in `echo "live" | mkpasswd -s`
+else
+ user_crypted="U6aMy0wojraho" # "ubuntu"
+fi
+
# U6aMy0wojraho is just a blank password
chroot /root debconf-communicate -fnoninteractive casper > /dev/null <<EOF
set passwd/root-password-crypted *
-set passwd/user-password-crypted UMxWpqk1F1hww
-set passwd/user-fullname $USERFULLNAME
+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
+if [ "${BUILD_SYSTEM}" == "Debian" ]; then
+ 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
+else
+ chroot /root /usr/lib/user-setup/user-setup-apply > /dev/null
+fi
# Clear out debconf database again to avoid confusing ubiquity later.
chroot /root debconf-communicate -fnoninteractive casper > /dev/null <<EOF
EOF
if [ -f /root/etc/sudoers ]; then
- if [ -x /sbin/udevplug ]; then
- # FIXME: ugly hack, admin is not present in debian so we do here ubuntu stuff
- # XXX - awful hack to stop xscreensaver locking the screen (#7150)
- echo 'RUNNING_UNDER_GDM="yes"' >> /root/etc/environment
+ if [ "${BUILD_SYSTEM}" == "Ubuntu" ]; then
+ # XXX - awful hack to stop xscreensaver locking the screen (#7150)
+ echo 'RUNNING_UNDER_GDM="yes"' >> /root/etc/environment
grep -q '^%admin' /root/etc/sudoers && sed -i -e '/^%admin/s/ALL$/NOPASSWD: ALL/' /root/etc/sudoers || echo '%admin ALL=(ALL) NOPASSWD: ALL' >> /root/etc/sudoers
- for file in /usr/share/applications/ubiquity-gtkui.desktop /usr/share/applications/kde/ubiquity-kdeui.desktop; do
- if [ -f "/root/$file" ]; then
- chroot /root install -D -o $USERNAME -g $USERNAME $file /home/$USERNAME/Desktop/$(basename "$file")
- break
- fi
- done
+ for file in /usr/share/applications/ubiquity-gtkui.desktop /usr/share/applications/kde/ubiquity-kdeui.desktop; do
+ if [ -f "/root/$file" ]; then
+ chroot /root install -D -o $USERNAME -g $USERNAME $file /home/$USERNAME/Desktop/$(basename "$file")
+ break
+ fi
+ done
else # We are in debian :-)
echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" >> /root/etc/sudoers
fi
grep_file=/root/etc/environment
fi
+if [ -z "${grep_file}" ]; then
+ grep_file=/root/etc/default/locale
+fi
+
# commandline
for x in $(cat /proc/cmdline); do
case $x in
if [ "${set_locale}" ]; then
LANG=$(grep "^${locale}" /root/usr/share/i18n/SUPPORTED | grep UTF-8 |sed -e 's, .*,,' -e q)
- printf 'LANG="%s"\n' "${LANG}" >> "${grep_file}"
- chroot /root /usr/sbin/locale-gen "${LANG}"
+ printf 'LANG="%s"\n' "${LANG}" >> "${grep_file}"
+ if [ "${BUILD_SYSTEM}" == "Debian" ]; then
+ chroot /root /usr/sbin/locale-gen
+ else
+ chroot /root /usr/sbin/locale-gen "${LANG}"
+ fi
fi
log_end_msg
fi
if chroot /root [ -f ${GDMCONF} ]; then
- # true hack ! -- nohar
- chroot /root cp /usr/share/gdm/defaults.conf /etc/gdm/gdm.conf
+ if [ "${BUILD_SYSTEM}" == "Debian" ]; then
+ # true hack ! -- nohar
+ chroot /root cp /usr/share/gdm/defaults.conf /etc/gdm/gdm.conf
+ fi
+
# Configure GDM autologin
chroot /root sed -i \
-e "s/^AutomaticLoginEnable=.*\$/AutomaticLoginEnable=true/" \
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 su $USERNAME -- gconftool-2 -s -t bool /apps/panel/global/disable_lock_screen true
+ chroot /root sudo -u "$USERNAME" gconftool-2 -s -t bool /apps/panel/global/disable_lock_screen true
fi
log_end_msg
gnome_screensaver_version=$(chroot /root dpkg-query -W --showformat='${Version}' gnome-screensaver 2>/dev/null) || gnome_screensaver_version=""
if [ -n "$gnome_screensaver_version" ]; then
- chroot /root su $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 false
fi
log_end_msg
log_begin_msg "$DESCRIPTION"
gct() {
- chroot /root su $USERNAME -- gconftool-2 "$@"
+ chroot /root sudo -u "$USERNAME" gconftool-2 "$@"
}
for x in $(cat /proc/cmdline); do
gpm_version=$(chroot /root /usr/bin/dpkg-query -W --showformat='${Version}' gnome-power-manager 2>/dev/null) || panel_version=""
if [ -n "$gpm_version" ]; then
casper-reconfigure /root gnome-power-manager
- chroot /root su $USERNAME -- gconftool-2 -s -t bool /apps/gnome-power-manager/can_hibernate false
+ chroot /root sudo -u "$USERNAME" gconftool-2 -s -t bool /apps/gnome-power-manager/can_hibernate false
fi
if [ -f /root/usr/share/kubuntu-default-settings/kde-profile/default/share/config/kcmlaptoprc ]; then
PREREQ=""
DESCRIPTION="Configuring accessibility options..."
-USERNAME=$(db_get passwd/username)
+db_get passwd/username
+USERNAME="$RET"
gct() {
- chroot /target su $USERNAME -- gconftool-2 "$@"
+ chroot /target sudo -u "$USERNAME" gconftool-2 "$@"
}
for x in $(cat /proc/cmdline); do
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/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