Adding casper 1.66+debian-1. 1.66+debian-1
authorDaniel Baumann <daniel@debian.org>
Sun, 23 Sep 2007 12:46:24 +0000 (14:46 +0200)
committerDaniel Baumann <daniel@debian.org>
Sun, 23 Sep 2007 12:46:24 +0000 (14:46 +0200)
22 files changed:
bin/casper-reconfigure
casper.conf
debian/casper.dirs [moved from debian/dirs with 100% similarity]
debian/casper.init [moved from debian/init.d with 93% similarity]
debian/casper.install [moved from debian/install with 100% similarity]
debian/casper.postinst [moved from debian/postinst with 100% similarity]
debian/changelog
debian/changelog.upstream
debian/control
debian/control.debian [new file with mode: 0644]
debian/control.ubuntu [new file with mode: 0644]
debian/rules
hooks/casper
scripts/casper
scripts/casper-bottom/10adduser
scripts/casper-bottom/14locales
scripts/casper-bottom/15autologin
scripts/casper-bottom/22gnome_panel_data
scripts/casper-bottom/22screensaver
scripts/casper-bottom/30accessibility
scripts/casper-bottom/32disable_hibernation
ubiquity-hooks/30accessibility

index 628bff3..7855210 100755 (executable)
@@ -47,6 +47,10 @@ if [ -z "$version" ]; then
     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
index 1596dff..ba5101c 100644 (file)
@@ -1,8 +1,8 @@
 # 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"
similarity index 100%
rename from debian/dirs
rename to debian/casper.dirs
similarity index 93%
rename from debian/init.d
rename to debian/casper.init
index 424c024..e0522e0 100644 (file)
@@ -33,7 +33,7 @@ done
 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)"
similarity index 100%
rename from debian/install
rename to debian/casper.install
similarity index 100%
rename from debian/postinst
rename to debian/casper.postinst
index 9da2e97..33da0a9 100644 (file)
@@ -1,3 +1,10 @@
+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.
index 8e20a26..6eb6873 100644 (file)
@@ -1,3 +1,13 @@
+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
index 4445546..cd9eee6 100644 (file)
@@ -1,9 +1,9 @@
 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
diff --git a/debian/control.debian b/debian/control.debian
new file mode 100644 (file)
index 0000000..cd9eee6
--- /dev/null
@@ -0,0 +1,17 @@
+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.
diff --git a/debian/control.ubuntu b/debian/control.ubuntu
new file mode 100644 (file)
index 0000000..a8ab8de
--- /dev/null
@@ -0,0 +1,25 @@
+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.
index bd01663..d1d44a5 100755 (executable)
@@ -3,25 +3,42 @@
 # 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
@@ -37,23 +54,45 @@ install: build
        # 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
index 191f2f5..f7fee12 100755 (executable)
@@ -18,15 +18,21 @@ esac
 
 . /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
@@ -37,24 +43,24 @@ mkdir -p ${DESTDIR}/lib/casper
 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
index 61e579c..3e4ed06 100644 (file)
@@ -23,12 +23,19 @@ home_persistence="home-rw"
 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
@@ -133,7 +140,7 @@ setup_loop() {
     local module=$2
     local pattern=$3
 
-    modprobe -qb "$module"
+    modprobe "${MP_QUIET}" -b "$module"
     udevsettle
 
     for loopdev in $pattern; do
@@ -164,7 +171,7 @@ setup_devmapper() {
     backdev="$1"
     rootmnt="$2"
 
-    modprobe -qb dm-mod
+    modprobe "${MP_QUIET}" -b dm-mod
     COW_DEVICE=/dev/ram1
     COW_NAME="casper-cow"
 
@@ -267,7 +274,7 @@ find_cow_device() {
 do_netmount() {
     rc=1
 
-    modprobe -q af_packet # For DHCP
+    modprobe "${MP_QUIET}" af_packet # For DHCP
 
     ipconfig ${DEVICE} /tmp/net-${DEVICE}.conf
 
@@ -291,7 +298,7 @@ do_netmount() {
 
 do_nfsmount() {
     rc=1
-    modprobe -q nfs
+    modprobe "${MP_QUIET}" nfs
     if [ -z "${NFSOPTS}" ]; then
         NFSOPTS=""
     fi
@@ -315,7 +322,7 @@ do_cifsmount() {
         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
@@ -328,7 +335,7 @@ setup_unionfs() {
     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.
index 700f8c3..e85f947 100755 (executable)
@@ -20,18 +20,28 @@ esac
 
 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
@@ -43,17 +53,16 @@ set passwd/user-uid
 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
index ebe7616..f69fa0f 100755 (executable)
@@ -27,6 +27,10 @@ elif [ -e /root/etc/environment ]; then # Old locales policy
        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
@@ -49,8 +53,12 @@ fi
 
 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
index 745e6ce..ff88721 100755 (executable)
@@ -27,8 +27,11 @@ else
 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/" \
index e87c94f..5509ce1 100755 (executable)
@@ -28,7 +28,7 @@ fi
 
 panel_version=$(chroot /root /usr/bin/dpkg-query -W --showformat='${Version}' gnome-panel-data 2>/dev/null) || panel_version=""
 if [ -n "$panel_version" ]; then
-    chroot /root 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
index 2a98b1a..6719f5f 100755 (executable)
@@ -22,7 +22,7 @@ log_begin_msg "$DESCRIPTION"
 
 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
index c6015e1..8352fb6 100755 (executable)
@@ -21,7 +21,7 @@ esac
 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
index 7b7d976..badcef6 100755 (executable)
@@ -24,7 +24,7 @@ log_begin_msg "$DESCRIPTION"
 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
index ab1c2e9..9fcfc26 100755 (executable)
@@ -4,10 +4,11 @@
 
 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
@@ -21,8 +22,8 @@ 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