Adding casper 1.77+debian-1. 1.77+debian-1
authorDaniel Baumann <daniel@debian.org>
Sun, 23 Sep 2007 12:46:26 +0000 (14:46 +0200)
committerDaniel Baumann <daniel@debian.org>
Sun, 23 Sep 2007 12:46:26 +0000 (14:46 +0200)
17 files changed:
bin/casper-preseed
bin/casper-snapshot
debian/casper.init
debian/casper.postinst
debian/changelog
debian/changelog.upstream
debian/control
debian/control.debian
debian/manpage/casper.7
scripts/casper
scripts/casper-bottom/14locales
scripts/casper-bottom/19keyboard
scripts/casper-bottom/25configure_init
scripts/casper-bottom/30accessibility
scripts/casper-bottom/32disable_hibernation
scripts/casper-bottom/35fix_language_selector
ubiquity-hooks/30accessibility

index 6967fe2..c0c76eb 100755 (executable)
@@ -5,12 +5,14 @@ PATH=/usr/sbin:/usr/bin:/sbin:/bin
 root="$1"
 question="$2"
 value="$3"
+seen="$4"
+[ "$seen" ] || seen=true
 
-if ! (echo "SET $question $value"; echo "FSET $question seen true") | chroot "$1" debconf-communicate -fnoninteractive casper >/dev/null; then
+if ! (echo "SET $question $value"; echo "FSET $question seen $seen") | chroot "$1" debconf-communicate -fnoninteractive casper >/dev/null; then
        chroot "$1" debconf-communicate -fnoninteractive casper >/dev/null <<EOF
 REGISTER debian-installer/dummy $question
 SET $question $value
-FSET $question seen true
+FSET $question seen $seen
 EOF
 fi
 
index d49034c..f90e563 100644 (file)
@@ -24,7 +24,7 @@
 # On Debian systems, the complete text of the GNU General Public License
 # can be found in /usr/share/common-licenses/GPL file.
 
-PROGRAM="`basename ${1}`"
+PROGRAM="`basename ${0}`"
 VERSION=0.0.1
 
 # Source casper conf
@@ -101,10 +101,13 @@ Do_snapshot ()
 {
        case "${TYPE}" in
                squashfs)
-                       mksquashfs "${COW}" "${DEST}" || exit 1
+                       echo "./tmp/exclude_list" > /tmp/exclude_list
+                       ( cd "${COW}" && find . -name '*.wh.*' >> /tmp/exclude_list )
+                       mksquashfs "${COW}" "${DEST}" -ef /tmp/exclude_list || exit 1
+                       rm /tmp/exclude_list
                        ;;
                cpio)
-                       (cd "${COW}" && find . | cpio --quiet -o -H newc | gzip -9 > "${DEST}") || exit 1
+                       ( cd "${COW}" && find . -path '*.wh.*' -prune -o -print0 | cpio --quiet -o0 -H newc | gzip -9c > "${DEST}" ) || exit 1
                        ;;
                ext2)
                        DU_DIM="`du -ks ${COW} | cut -f1`"
@@ -157,7 +160,8 @@ Is_same_mount ()
 Parse_args ()
 {
        # Parse command line
-       ARGUMENTS="`getopt --longoptions cow:,destination:,output:,type:,help,usage,version --name=${PROGRAM} --options c:d:o:t:,h,u,v --shell sh -- ${@}`"
+       ARGS="${1}"
+       ARGUMENTS="`getopt --longoptions cow:,destination:,output:,type:,help,usage,version --name=${PROGRAM} --options c:d:o:t:,h,u,v --shell sh -- ${ARGS}`"
 
        if [ "${?}" != "0" ]; then
                echo "Terminating." >&2
@@ -201,7 +205,7 @@ Defaults ()
                COW="${SNAP_COW}"
        fi
        if [ ! -d "${COW}" ]; then
-               Usage "Error: ${COW} is not a directory\nMaybe you booted with \"hide-cow\" as kernel parameter?"
+               Usage "Error: ${COW} is not a directory"
        fi
 
        case "${SNAP_TYPE}" in
@@ -214,6 +218,10 @@ Defaults ()
                        Usage "Error: unrecognized snapshot type"
                        ;;
        esac
+       
+       #if [ -d 
+       #if Is_same_mount 
+
 }
 
 Main ()
index ae1a1a4..d6ec097 100644 (file)
@@ -50,45 +50,68 @@ cache_path() {
     fi
 }
 
+do_sync ()
+{
+    # copy the tmp media on the snapshot media
+    fromdir="${1}"
+    todev="${2}"
+    tmnt="/mnt/temp_snap"
+
+    mkdir "${tmnt}" && \
+    mount "${todev}" "${tmnt}" -o rw && \
+    cd "${fromdir}" && \
+    find . -print0 | cpio -pumd0 "${tmnt}" && \
+    umount "${tmnt}" && \
+    rmdir "${tmnt}"
+}
+
 do_stop ()
 {
-       # check for netboot
-       if [ ! -z "${NETBOOT}" ] || grep -qs netboot /proc/cmdline || grep -qsi root=/dev/nfs /proc/cmdline  || grep -qsi root=/dev/cifs /proc/cmdline ; then
-               return 0
-       fi
-
-       for path in $(which halt) $(which reboot) /etc/rc?.d /etc/default; do
-               cache_path "$path"
-       done
-
-       eject -p -m /live_media >/dev/null 2>&1
-
-       # XXX - i18n
-       echo "Please remove the disc and close the tray (if any) then press ENTER: "
-       if [ -x /sbin/usplash_write ]; then
-               /sbin/usplash_write "TIMEOUT 86400"
-               /sbin/usplash_write "TEXT-URGENT Please remove the disc, close the tray (if any)"
-               /sbin/usplash_write "TEXT-URGENT and press ENTER to continue"
-       fi
-
-       read x < /dev/console
+    # check for netboot
+    if [ ! -z "${NETBOOT}" ] || grep -qs netboot /proc/cmdline || grep -qsi root=/dev/nfs /proc/cmdline  || grep -qsi root=/dev/cifs /proc/cmdline ; then
+        return 0
+    fi
+
+    if [ ! -z "${ROOTSNAP}" ]; then
+        do_sync "/cow" "${ROOTSNAP}"
+    fi
+
+    if [ ! -z "${HOMESNAP}" ]; then
+        do_sync "/home" "${HOMESNAP}"
+    fi
+
+    for path in $(which halt) $(which reboot) /etc/rc?.d /etc/default; do
+        cache_path "$path"
+    done
+
+    eject -p -m /live_media >/dev/null 2>&1
+
+    # XXX - i18n
+    echo "Please remove the disc and close the tray (if any) then press ENTER: "
+    if [ -x /sbin/usplash_write ]; then
+           /sbin/usplash_write "TIMEOUT 86400"
+           /sbin/usplash_write "TEXT-URGENT Please remove the disc, close the tray (if any)"
+           /sbin/usplash_write "TEXT-URGENT and press ENTER to continue"
+    fi
+
+    read x < /dev/console
 }
 
 case "$1" in
-       start|restart|reload|force-reload|status)
-               [ "$VERBOSE" != no ] && log_end_msg 0
-               ;;
-       stop)
-               log_begin_msg "Caching reboot files..."
-               do_stop
-               case "$?" in
-                       0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
-                       2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
-               esac
-               ;;
-       *)
-               log_success_msg "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
-               exit 3
-               ;;
+    start|restart|reload|force-reload|status)
+        [ "$VERBOSE" != no ] && log_end_msg 0
+        ;;
+    stop)
+        log_begin_msg "Caching reboot files..."
+        do_stop
+        case "$?" in
+            0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+            2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+        esac
+        ;;
+    *)
+        log_success_msg "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
+        exit 3
+        ;;
 esac
 
index d7bc14d..532679b 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-update-initramfs -u
+update-initramfs -ut -kall
 
 #DEBHELPER#
index 888457b..6887ad3 100644 (file)
@@ -1,3 +1,26 @@
+casper (1.77+debian-1) unstable; urgency=low
+
+  * New upstream release.
+  * Added snapshot persistence feature (copy on boot, sync on reboot) via
+    different ways: squashfs, cpio.gz, and block device filesystems.
+  * Added boot parameter "live-media=<device>" to force trying to boot from
+    a specified device.
+  * Added support for "todisk=<device>" to copy the live media to a
+    device filesystem, subsequent boots could use "live-media=<device>".
+  * Slightly polished locales and keyboards handling.
+  * Extendend manpages.
+  * Readded a missing "sleep 1", reworked how live_media is detected,
+    thanks to Bas Wijnen <wijnen@debian.org> for the reports.
+    (Closes: #394308, #394554).
+  * Reworked casper-getty system, thanks to Alex Owen (Closes: #394686).
+  * Postint now rebuild all initramfs.
+  * Casper now Recommends also squashfs-tools and genext2fs, maybe
+    needed by casper-snapshot.
+  * Lowered usplash requirements, since usplash 0.4 is not in debian
+    yet.
+
+ -- Marco Amadori <marco.amadori@gmail.com>  Sun, 22 Oct 2006 20:25:38 +0200
+
 casper (1.71+debian-1) unstable; urgency=low
 
   * New upstream release.
index e9288e9..32e573d 100644 (file)
@@ -1,3 +1,66 @@
+casper (1.77) edgy; urgency=low
+
+  * Honour console-setup/modelcode preseeding. Needed for Malone #66719,
+    #66774.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Fri, 20 Oct 2006 19:59:39 +0100
+
+casper (1.76) edgy; urgency=low
+
+  [ Colin Watson ]
+  * Copy access=m2 accessibility changes into the corresponding ubiquity
+    hook.
+  * Remove spurious quoting from accessibility script.
+  * Clear console-setup/layoutcode and console-setup/variantcode if they
+    aren't supplied on the command line.
+
+  [ Michael Vogt ]
+  * scripts/casper-bottom/35fix_language_selector:
+    - run fontconfig-voodoo if available to make sure that we have
+      optimal fontconfig settings for the CJK languages (lp: #49334)
+
+  [ Henrik Nilsen Omma ]
+  * Fix a few accessibility items that were out of date, changing
+    gnopernicus -> orca and gok -> onboard (the gok entry was missing some
+    brackets as well; patch from Malone #58836, closes: Malone #65861).
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Mon, 16 Oct 2006 20:20:15 +0100
+
+casper (1.75) edgy; urgency=low
+
+  * Turn on accessibility in "Motor Difficulties - pointing devices" which
+    makes onboard start properly.  closes: Malone: #65861.
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Fri, 13 Oct 2006 14:12:10 +0200
+
+casper (1.74) edgy; urgency=low
+
+  [ Tollef Fog Heen ]
+  * Sync up ubiquity-hooks/30accessibility with
+    scripts/casper-bottom/30accessibility fixing spelling errors and
+    enabling accessibility in KDE.
+
+  [ Colin Watson ]
+  * Fix check for presence of gconf2 (closes: Malone #58836).
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Wed, 11 Oct 2006 11:18:00 +0100
+
+casper (1.73) edgy; urgency=low
+
+  * Never run install-keymap or preseed debian-installer/keymap if
+    console-setup is detected, even if console-setup wasn't explicitly
+    preseeded. Contributes to Malone #60067.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Sat,  7 Oct 2006 01:56:20 +0100
+
+casper (1.72) edgy; urgency=low
+
+  * Force suspend and hibernate both off, since reconfiguring
+    gnome-power-manager kills usplash here.  Fixes Malone: #61535
+    completely.
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Fri,  6 Oct 2006 14:22:23 +0200
+
 casper (1.71) edgy; urgency=low
 
   * Use TEXT-URGENT in shutdown script to make sure we display the "please
index 1999790..95a6edd 100644 (file)
@@ -9,9 +9,9 @@ Standards-Version: 3.7.2
 Package: casper
 Architecture: any
 Depends: initramfs-tools (>= 0.40), user-setup, sudo
-Conflicts: usplash (<< 0.4-27)
+Conflicts: usplash (<< 0.4-0)
 Recommends: live-package
-Suggests: dmsetup
+Suggests: dmsetup, squashft-tools, genext2fs
 Tag: admin::boot, admin::filesystem, implemented-in::shell, protocol::smb, role::plugin, scope::utility, special::completely-tagged, works-with-format::iso9660
 Description: Debian Live initramfs generator
  Casper provides an initramfs generator suited for booting a Debian Live systems
index 1999790..95a6edd 100644 (file)
@@ -9,9 +9,9 @@ Standards-Version: 3.7.2
 Package: casper
 Architecture: any
 Depends: initramfs-tools (>= 0.40), user-setup, sudo
-Conflicts: usplash (<< 0.4-27)
+Conflicts: usplash (<< 0.4-0)
 Recommends: live-package
-Suggests: dmsetup
+Suggests: dmsetup, squashft-tools, genext2fs
 Tag: admin::boot, admin::filesystem, implemented-in::shell, protocol::smb, role::plugin, scope::utility, special::completely-tagged, works-with-format::iso9660
 Description: Debian Live initramfs generator
  Casper provides an initramfs generator suited for booting a Debian Live systems
index 1bc0b22..89f1cf2 100644 (file)
@@ -18,24 +18,35 @@ This enable a special serial login shell (experimental).
 .BI "host=" HOSTNAME " , userfullname=" USERFULLNAME " , username=" USERNAME
 Those parameters lets you override values read from the config file.
 .TP
-.B "showmounts"
-Specifying this will make casper to show on "/" the ro filesystems (mostly compressed) on /casper. This is not enabled by default because could lead to problems by application like "mono" which store binary paths on installation.
+.BI "keyb=" KEYBOARD " | kbd-chooser/method=" KEYBOARD ";  console-setup/layoutcode=" LAYOUT ", console-setup/variantcode=" VARIANT
+Configure the running keyboard as specified, if this one misses casper behave as "keyb=us" was specified. (It will be interfered from "locale=" somewhere in the future). You could also specify layout and variant (no defaults).
 .TP
 .BI ip= IFACE,ADDRESS,NETMASK,GATEWAY [ :IFACE,ADDRESS,NETMASK,GATEWAY "]*"
 Let you specify the name(s) and the options of the interface(s) that should be configured at boot time. Do not specify it if you want to use dhcp (default).
 .TP
 .BR ip[= frommedia ]
 This way dhcp and static configuration is just skipped and the system will use the (must be) media-preconfigured /etc/network/interfaces instead.
-
+.TP
+.BI "locale=" LOCALE " | debian-installer/locale=" LOCALE
+Configure the running locale as specified, if not present the live-media rootfs configured locale will be used and if also this one misses casper behave as "locale=en_US.UTF-8" was specified.
+.TP
+.BI live-media= DEVICE " | bootfrom=" DEVICE
+If you specify one of this two equivalent forms, casper will try first to look on this device for the "/casper" directory where it should lie the read-only root filesystem, if it did not find it, the normal scan for block devices will be performed.
 .TP
 .BR "netboot[=" nfs "|" cifs ]
 This tells casper to look for a network mount, to be specified by parameter "nfsroot=" (with optional "nfsopts="), for the "/casper" dirs where root filesystem lies. With no args, will try cifs first, and if it fails nfs.
 .TP
 .B persistent
-Casper will look for persistent and snapshot partitions or files labeled "casper-rw", "home-rw", "casper-snap*", "home-snap*" and will try to, in order: mount as /cow the first, mount the second in /home, and just copy the contents of the latters in appropriate locations.
+Casper will look for persistent and snapshot partitions or files labeled "casper-rw", "home-rw", and files called "casper-sn*", "home-sn*" and will try to, in order: mount as /cow the first, mount the second in /home, and just copy the contents of the latters in appropriate locations (snapshots). Snapshots will be tried to be updated on reboot/shutdown. Look at casper-snapshot(1) for more informations.
+.TP
+.B "showmounts"
+Specifying this will make casper to show on "/" the ro filesystems (mostly compressed) on /casper. This is not enabled by default because could lead to problems by application like "mono" which store binary paths on installation.
+.TP
+.BI "todisk=" DEVICE 
+Adding this parameter, casper will try to copy to the specified device the whole read-only media before mounting the root filesystem, it could need a lot of free space, according to one used by the read-only media. Subsequent boots should then skip this step and just specify the "live-media=DEVICE" boot parameter with the same DEVICE used this time.
 .TP
 .B toram
-Adding this parameter, casper will try to copy to ram the whole read-only media before mounting the root filesystem(s), it could need a lot of ram, according to the space used by the read-only media.
+Adding this parameter, casper will try to copy to ram the whole read-only media before mounting the root filesystem, it could need a lot of ram, according to the space used by the read-only media.
 
 .SH FILES
 .B /etc/casper.conf
index 6f7bbb0..3a5e0ca 100644 (file)
@@ -8,6 +8,8 @@ mountpoint=/live_media
 
 root_persistence="casper-rw"
 home_persistence="home-rw"
+root_snapshot="casper-sn"
+home_snapshot="home-sn"
 
 USERNAME="casper"
 USERFULLNAME="Live session user"
@@ -26,50 +28,75 @@ else
     MP_QUIET="-q"
 fi
 
-# looking for casper specifics options as kernel parameters
-for x in $(cat /proc/cmdline); do
-    case $x in
-        userfullname*)
-            export USERFULLNAME=${x#userfullname=} 
-            export CASPERCONF="changed"
-            ;;
-        host*)
-            export HOST=${x#host=} 
-            export CASPERCONF="changed"
-            ;;
-        username*)
-            export USERNAME=${x#username=} 
-            export CASPERCONF="changed"
-            ;;
-        netboot*)
-            export NETBOOT=${x#netboot=} ;;
-        toram)
-            export TORAM=1 ;;
-        showmounts)
-            export SHOWMOUNTS=1 ;;
-        persistent)
-            export PERSISTENT=1 ;;
-        ip*)
-            STATICIP=${x#ip=}
-            if [ "${STATICIP}" == "" ]; then
-                STATICIP="frommedia"
-            fi
-            export STATICIP ;;
-        casper-getty)
-            export CASPERGETTY=1 ;;
-    esac
-done
+parse_cmdline ()
+{
+    # looking for casper specifics options as kernel parameters
+    for x in $(cat /proc/cmdline); do
+        case $x in
+            userfullname=*)
+                export USERFULLNAME=${x#userfullname=}
+                export CASPERCONF="changed"
+                ;;
+            host=*)
+                export HOST=${x#host=}
+                export CASPERCONF="changed"
+                ;;
+            username=*)
+                export USERNAME=${x#username=}
+                export CASPERCONF="changed"
+                ;;
+            netboot*)
+                export NETBOOT=${x#netboot=} ;;
+            toram)
+                export TORAM=1 ;;
+            todisk=)
+                export TODISK=${x#todisk=} ;;
+            showmounts)
+                export SHOWMOUNTS=1 ;;
+            persistent)
+                export PERSISTENT=1 ;;
+            ip*)
+                STATICIP=${x#ip=}
+                if [ "${STATICIP}" == "" ]; then
+                    STATICIP="frommedia"
+                fi
+                export STATICIP ;;
+            casper-getty)
+                export CASPERGETTY=1 ;;
+            console=*)
+                export DEFCONSOLE=$(sed -e 's%.*console=%console=%' /proc/cmdline) ;;
+            bootfrom=*)
+                export LIVEMEDIA=${x#bootfrom=} ;;
+            live-media=*)
+                export LIVEMEDIA=${x#live-media=} ;;
+            debian-installer/locale=*)
+                export LOCALE=${x#debian-installer/locale=} ;;
+            locale=*)
+                export LOCALE=${x#locale=} ;;
+            kbd-chooser/method=*)
+                export KBD=${x#kbd-chooser/method=} ;;
+            keyb=*)
+                export KBD=${x#kbd=} ;;
+            console-setup/layoutcode=*)
+                export CSLAYOUT=${x#console-setup/layoutcode=} ;;
+            console-setup/variantcode=*)
+                export CSVARIANT=${x#console-setup/variantcode=} ;;
+            console-setup/modelcode=*)
+                export CSMODEL=${x#console-setup/modelcode=} ;;
+        esac
+    done
 
-# sort of compatibility with netboot.h from linux docs
-if [ -z "${NETBOOT}" ]; then
-    if [ "${ROOT}" == "/dev/nfs" ]; then
-        NETBOOT="nfs"
-        export NETBOOT
-    elif [ "${ROOT}" == "/dev/cifs" ]; then
-        NETBOOT="cifs"
-        export NETBOOT
+    # sort of compatibility with netboot.h from linux docs
+    if [ -z "${NETBOOT}" ]; then
+        if [ "${ROOT}" == "/dev/nfs" ]; then
+            NETBOOT="nfs"
+            export NETBOOT
+        elif [ "${ROOT}" == "/dev/cifs" ]; then
+            NETBOOT="cifs"
+            export NETBOOT
+        fi
     fi
-fi
+}
 
 is_casper_path() {
     path=$1
@@ -202,6 +229,26 @@ setup_devmapper() {
     mount -t $(get_fstype "$backdev") /dev/mapper/casper-backing "$rootmnt/rofs"
 }
 
+is_nice_device() {
+    sysfs_path="${1#/sys}"
+    if /lib/udev/path_id "${sysfs_path}" | grep -E -q "ID_PATH=(usb|pci-[^-]*-[ide|scsi|usb])"; then
+        return 0
+    fi
+    return 1
+}
+
+is_supported_fs ()
+{
+    # FIXME: do something better like the scan of supported filesystems
+    fstype="${1}"
+    case ${fstype} in
+        vfat|iso9660|udf|ext2|ext3|ntfs)
+            return 0
+            ;;
+    esac
+    return 1
+}
+
 where_is_mounted() {
     device=$1
     if grep -q "^$device " /proc/mounts; then
@@ -212,38 +259,89 @@ where_is_mounted() {
     return 1
 }
 
-copy_to_ram() {
-    copyfrom="$1"
+used_fs_size ()
+{
+    # Returns used fs kbytes + 5% more
+    # You could pass a block device as $1 or the mount point as $2
 
-    if [ ! -z "${2}" ] ; then
-        # This will enable future rampersistence, todo yet
-        copyto="${2}"
-        moveit="False"
-    else
-        copyto="${copyfrom}_swap"
-        moveit="True"
+    dev="${1}"
+    mountp="${2}"
+
+    if [ -z "${mountp}" ]; then
+        mountp=$(where_is_mounted "${dev}")
+        if [ "$?" -gt 0 ]; then
+            mountp=/mnt/tmp_fs_size
+            mkdir -p "${mountp}"
+            mount -t $(get_fstype "${dev}") -o ro "${dev}" "${mountp}"
+            doumount=1
+        fi
     fi
 
-    size=$(du -ks ${copyfrom} | cut -f1)
-    size=$(expr ${size} + ${size}/20 ) # Fixme: 5% more to be sure
+    size=$(du -ks ${mountp} | cut -f1)
+    size=$(expr ${size} + ${size}/20 ) # FIXME: 5% more to be sure
     needed_space=$(expr ${size} * 1024)
-    freespace=$( expr $(awk '/MemFree/{print $2}' /proc/meminfo) + $( cat /proc/meminfo | grep Cached | head -n 1 | awk '/Cached/{print $2}' - ))
 
-    if [ ! ${freespace} -lt ${needed_space}  ] ; then
-        [ "$quiet" != "y" ] && log_begin_msg "Not enough free memory to copy to ram"
-        [ "$quiet" != "y" ] && log_end_msg
-        return
+    if [ ! -z "${doumount}" ]; then
+        umount "${mountp}"
+        rmdir "${mountp}"
+    fi
+    echo "${needed_space}"
+}
+
+copy_live_to() {
+    copyfrom="${1}"
+    copytodev="${2}"
+    copyto="${copyfrom}_swap"
+
+    size=$(used_fs_size "null" "${copyfrom}")
+
+    if [ "${copytodev}" = "ram" ]; then
+        # copying to ram:
+        freespace=$( expr $(awk '/MemFree/{print $2}' /proc/meminfo) + $( cat /proc/meminfo | grep Cached | head -n 1 | awk '/Cached/{print $2}' - ) )
+        mount_options="-o size=${size}k"
+        free_string="memory"
+        fstype="tmpfs"
+        dev="/dev/shm"
     else
-        [ "$quiet" != "y" ] && log_begin_msg "Copying live media to ram..."
-        mkdir "${copyto}"
-        mount -t tmpfs -o size=${size}k /dev/shm ${copyto}
-        cp -a ${copyfrom}/* ${copyto} # "cp -a" from busybox also copies hidden files
-        umount ${copyfrom}
-        if [ "${moveit}" == "True" ]; then
-            mount -r -o move ${copyto} ${copyfrom}
-            rmdir ${copyto}
+        # it should be a writable block device
+        if [ -b "${copytodev}" ]; then
+            free_string="space"
+            freespace="$(df -k ${copytodev} | grep -s ${copytodev} | awk '{print $4}')"
+            fstype="$(get_fstype ${devname})"
+            dev="${copytodev}"
+        else
+            return 1
         fi
+    fi
+    if [ ! ${freespace} -lt ${size}  ] ; then
+        [ "$quiet" != "y" ] && log_begin_msg "Not enough free ${free_string} to copy live media in ${copytodev}."
         [ "$quiet" != "y" ] && log_end_msg
+        return 1
+    fi
+
+    # begin copying..
+    [ "$quiet" != "y" ] && log_begin_msg "Copying live media to ${copytodev}..." 
+    mkdir "${copyto}"
+    mount -t "${fstype}" ${mount_options} "${dev}" "${copyto}"
+    cp -a ${copyfrom}/* ${copyto} # "cp -a" from busybox also copies hidden files
+    umount ${copyfrom}
+    mount -r -o move ${copyto} ${copyfrom}
+    rmdir ${copyto}
+    [ "$quiet" != "y" ] && log_end_msg
+    return 0
+}
+
+try_mount ()
+{
+    dev="${1}"
+    mountp="${2}"
+    opts="${3}"
+
+    if where_is_mounted ${dev} > /dev/null; then
+        mount -o remount,"${opts}" ${dev} $(where_is_mounted ${dev}) || panic "Remounting failed"
+        mount -o bind $(where_is_mounted ${dev}) ${mountp} || panic "Cannot bind-mount"
+    else
+        mount -t $(get_fstype "${dev}") -o "${opts}" "${dev}" "${mountp}" || panic "Cannot mount ${dev} on ${mountp}"
     fi
 }
 
@@ -256,15 +354,9 @@ find_cow_device() {
             if [ "$(/lib/udev/vol_id -l $devname 2>/dev/null)" = "${pers_label}" ]; then
                 echo "$devname"
                 return
-            elif [ "$(get_fstype ${devname})" = "vfat" ]; then
+            elif [ "$(get_fstype ${devname})" = "vfat" ]; then # FIXME: all supported block devices should be scanned
                 mkdir -p "${cow_backing}"
-                if where_is_mounted ${devname} > /dev/null; then
-                    mount -o remount,rw ${devname} $(where_is_mounted ${devname}) || panic "Remounting failed"
-                    mount -o bind $(where_is_mounted ${devname}) ${cow_backing} || panic "Cannot bind-mount"
-                else
-                    mount -t $(get_fstype "${devname}") -o rw "${devname}" ${cow_backing} || panic "Cannot mount $devname on /cow-backing"
-                fi
-
+                try_mount "${devname}" "${cow_backing}" "rw"
                 if [ -e "${cow_backing}/${pers_label}" ]; then
                     echo $(setup_loop "${cow_backing}/${pers_label}" "loop" "/sys/block/loop*")
                     return 0
@@ -276,6 +368,31 @@ find_cow_device() {
     done
 }
 
+find_files()
+# return the first of $filenames found on vfat and ext2 devices
+# FIXME: merge with above function
+{
+    filenames="${1}"
+    snap_backing="/snap-backing"
+    for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop); do
+        for dev in $(subdevices "${sysblock}"); do
+            devname=$(sys2dev "${dev}")
+            devfstype="$(get_fstype ${devname})"
+            if [ "${devfstype}" = "vfat" ] ||  [ "${devfstype}" = "ext2" ] ; then # FIXME: all supported block devices should be scanned
+                mkdir -p "${snap_backing}"
+                try_mount "${devname}" "${snap_backing}" "ro"
+                for filename in ${filenames}; do
+                    if [ -e "${snap_backing}/${filename}" ]; then
+                        echo "${devname} ${snap_backing} ${filename}"
+                        return 0
+                    fi
+                done
+                umount ${snap_backing}
+            fi
+        done
+    done
+}
+
 do_netmount() {
     rc=1
 
@@ -336,6 +453,90 @@ do_cifsmount() {
     return ${rc}
 }
 
+do_snap_copy ()
+{
+    fromdev="${1}"
+    todir="${2}"
+    snap_type="${3}"
+
+    size=$(used_fs_size "${fromdev}")
+
+    if [ -b "${fromdev}" ]; then
+        # look for free mem
+        if [ ! -z "${HOMEMOUNTED}" ] && [ "${snap_type}" = "HOME" ]; then
+            freespace="$(df -k ${copytodev} | grep -s ${copytodev} | awk '{print $4}')"
+        else
+            freespace=$( expr $(awk '/MemFree/{print $2}' /proc/meminfo) + $( cat /proc/meminfo | grep Cached | head -n 1 | awk '/Cached/{print $2}' - ))
+        fi
+        tomount="/mnt/tmpsnap"
+        mkdir -p "${tomount}"
+        mount -t $(get_fstype "${fromdev}") -o ro "${fromdev}" "${tomount}"
+        cp -a "${tomount}"/* ${todir}
+        umount "${tomount}"
+
+        if echo ${fromdev} | grep -qs loop; then
+            losetup -d "${fromdev}"
+        fi
+
+        return 0
+    else
+        return 1
+        [ "$quiet" != "y" ] && log_warning_msg "Unable to find the snapshot ${snap_type} medium"
+    fi
+}
+
+try_snap ()
+{
+    snap_label="${1}"
+    snap_mount="${2}"
+    snap_type="${3}"
+
+    snapdata=$(find_files "${snap_label}.squashfs ${snap_label}.cpio.gz ${snap_label}.cpz ${snap_label}.gz")
+    if [ ! -z "${snapdata}" ]; then
+        snapdev=$(echo ${snapdata} | cut -f1 -d ' ')
+        snapback=$(echo ${snapdata} | cut -f2 -d ' ')
+        snapfile=$(echo ${snapdata} | cut -f3 -d ' ')
+        if echo "${snapfile}" | grep -qs "squashfs" ; then
+            # squashfs snapshot
+            if ! do_snap_copy $( get_backing_device "${snapback}/${snapfile}" ) "${snap_mount}" "${snap_type}"; then
+                 log_warning_msg "Impossible to include the ${snapfile} Snapshot"
+                 return 1
+            fi
+        else
+            # cpio.gz snapshot
+            if ! (cd "${snap_mount}" && zcat "${snapback}/${snapfile}" | cpio -i -u -d ) ; then
+                log_warning_msg "Impossible to include the ${snapfile} Snapshot"
+                return 1
+            fi
+        fi
+        umount "${snapback}"
+    else # try pure snapshot device better elif.. rework all that routine
+        if ! do_snap_copy $(find_cow_device "${snap_label}") "${snap_mount}" "${snap_type}"; then
+            log_warning_msg "Impossible to include the ${snap_label} Snapshot"
+            return 1
+        fi
+    fi
+    echo "export ${snap_type}SNAP=${snapdev}:${snapfile}" >> /etc/casper.conf # for resync on reboot/halt
+    return 0
+}
+
+do_others_persistences ()
+{
+    # directly mount /home
+    # FIXME: add a custom mounts configurable system
+    homecow=$(find_cow_device "${home_persistence}" )
+    if [ -b "${homecow}" ]; then
+        mount ${homecow} -t $(get_fstype "${homecow}") -o rw "${rootmnt}/home"
+        export HOMEMOUNTED=1
+    else
+        [ "$quiet" != "y" ] && log_warning_msg "Unable to find the persistent home medium"
+    fi
+
+    # Look for snapshots to copy in
+    try_snap "${root_snapshot}" "${rootmnt}" "ROOT"
+    try_snap "${home_snapshot}" "${rootmnt}/home" "HOME"
+}
+
 setup_unionfs() {
     image_directory="$1"
     rootmnt="$2"
@@ -390,7 +591,7 @@ setup_unionfs() {
             cowdevice=${cowprobe}
             cow_fstype=$(get_fstype "${cowprobe}")
         else
-            [ "$quiet" != "y" ] && log_begin_msg "Unable to find the persistent medium"
+            [ "$quiet" != "y" ] && log_warning_msg "Unable to find the persistent medium"
         fi
     fi
 
@@ -398,16 +599,9 @@ setup_unionfs() {
 
     mount -t unionfs -o dirs=/cow=rw:$rofsstring unionfs "$rootmnt" || panic "Unionfs mount failed"
 
-    # Look for a snapshot to copy
-
     # Adding other custom mounts
     if [ ! -z "${PERSISTENT}" ]; then
-        homecow=$(find_cow_device "${home_persistence}" )
-        if [ -b "${homecow}" ]; then
-            mount ${homecow} -t $(get_fstype "${homecow}") -o rw "${rootmnt}/home"
-        else 
-            [ "$quiet" != "y" ] &&  log_begin_msg "Unable to find the persistent home medium"
-        fi
+        do_others_persistences
     fi
 
     if [ ! -z "${SHOWMOUNTS}" ]; then
@@ -427,55 +621,59 @@ setup_unionfs() {
     mount -o bind /cow "$rootmnt/cow"
 }
 
-is_usb_device() {
-    sysfs_path="${1#/sys}"
-    if /lib/udev/path_id "${sysfs_path}" | grep -E -q "ID_PATH=(usb|pci-[^-]*-usb)"; then
-        return 0
+check_dev ()
+{
+    sysdev="${1}"
+    devname="${2}"
+    if [ -z "${devname}" ]; then
+        devname=$(sys2dev "${sysdev}")
+    fi
+    fstype=$(get_fstype "${devname}")
+    if is_supported_fs ${fstype}; then
+        mount -t ${fstype} -o ro "${devname}" $mountpoint || continue
+        if is_casper_path $mountpoint; then
+            echo $mountpoint
+            return 0
+        else
+            umount $mountpoint
+        fi
     fi
     return 1
 }
 
 find_livefs() {
-    mounted=
+    # first look at the one specified in the command line
+    if [ ! -z "${LIVEMEDIA}" ]; then
+        if check_dev "null" "${LIVEMEDIA}"; then
+            return 0
+        fi
+    fi
+    # or do the scan of block devices
     for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v ram); do
         devname=$(sys2dev "${sysblock}")
         fstype=$(get_fstype "${devname}")
         if /lib/udev/cdrom_id ${devname} > /dev/null; then
-            mount -t ${fstype} -o ro "$devname" $mountpoint || continue
-            if is_casper_path $mountpoint; then
-                echo $mountpoint
-                return
-            else
-                umount $mountpoint
+            if check_dev "null" "${devname}" ; then
+                return 0
             fi
-        elif is_usb_device "$sysblock"; then
+        elif is_nice_device "${sysblock}" ; then
             for dev in $(subdevices "${sysblock}"); do
-                devname=$(sys2dev "${dev}")
-                fstype=$(get_fstype "${devname}")
-                case ${fstype} in
-                    vfat|iso9660|udf)
-                        mount -t ${fstype} -o ro "${devname}" $mountpoint || continue
-                        if is_casper_path $mountpoint; then
-                            echo $mountpoint
-                            return
-                        else
-                            umount $mountpoint
-                        fi
-                        ;;
-                esac
+                if check_dev "${dev}" ; then
+                    return 0
+                fi
             done
-        elif [ "${fstype}" = "squashfs" ||  \
+        elif [ "${fstype}" = "squashfs" -o \
+                "${fstype}" = "ext3" ] -o \
                 "${fstype}" = "ext2" ]; then
-
             # This is an ugly hack situation, the block device has
             # an image directly on it.  It's hopefully
             # casper, so take it and run with it.
-
             ln -s "${devname}" "${devname}.${fstype}"
             echo "${devname}.${fstype}"
-            return
+            return 0
         fi
     done
+    return 1
 }
 
 pulsate() {
@@ -496,6 +694,8 @@ mountroot() {
     exec > casper.log
     exec 2>&1
 
+    parse_cmdline
+
     set_usplash_timeout
     [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/casper-premount"
     pulsate
@@ -517,22 +717,24 @@ mountroot() {
         # Scan local devices for the image
         for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13; do
             livefs_root=$(find_livefs)
-            if [ "${livefs_root}" ]; then
+            if [ ! -z "${livefs_root}" ]; then
                 break
             fi
+            sleep 1
         done
+    fi
 
-        if [ "$?" -gt 0 ]; then
-            panic "Unable to find a medium containing a live file system"
-        fi
+    if [ -z "${livefs_root}" ]; then
+        panic "Unable to find a medium containing a live file system"
+    fi
 
-        if [ ! -z "${TORAM}" ]; then
-            copy_to_ram "${livefs_root}"
-        fi
+    if [ ! -z "${TORAM}" ]; then
+        copy_live_to "${livefs_root}" "ram"
+    elif [ ! -z "${TODISK}" ]; then
+        copy_live_to "${livefs_root}" "${TODISK}"
     fi
-    sleep 1
 
-    mount_images_in_directory "$livefs_root" "$rootmnt"
+    mount_images_in_directory "${livefs_root}" "${rootmnt}"
 
     log_end_msg
 
index 4297a58..5080df6 100755 (executable)
@@ -21,44 +21,37 @@ esac
 log_begin_msg "$DESCRIPTION"
 
 if [ -e /root/etc/default/locale ]; then
-       grep_file=/root/etc/default/locale
-       locale=$(grep 'LANG=' ${grep_file} | sed s/'LANG='// | tr -d '"' ) 
+    grep_file=/root/etc/default/locale
 elif [ -e /root/etc/environment ]; then # Old locales policy
-       grep_file=/root/etc/environment
+    grep_file=/root/etc/environment
 fi
 
-if [ -z "${grep_file}" ]; then 
-       grep_file=/root/etc/default/locale
+if [ ! -z "${grep_file}" ]; then
+    locale=$(grep -s 'LANG=' ${grep_file} | sed s/'LANG='// | tr -d '"' )
+else
+    grep_file=/root/etc/default/locale
 fi
 
 # commandline
-for x in $(cat /proc/cmdline); do
-       case $x in
-               debian-installer/locale=*)
-                       locale=${x#debian-installer/locale=}
-                       set_locale="true"
-                       ;;
-               locale=*)
-                       locale=${x#locale=}
-                       set_locale="true"
-                       ;;
-       esac
-done
+if [ ! -z "${LOCALE}" ]; then
+    locale="${LOCALE}"
+    set_locale="true"
+fi
 
 if [ -z "${locale}" ]; then
-       # Set a default one
-       locale=en_US.UTF-8
-       set_locale="true"
+    # Set a default one
+    locale=en_US.UTF-8
+    set_locale="true"
 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}"
-       if [ "${BUILD_SYSTEM}" == "Debian" ]; then
-               chroot /root /usr/sbin/locale-gen
-       else
-               chroot /root /usr/sbin/locale-gen "${LANG}"
-       fi
+    LANG=$(grep "^${locale}" /root/usr/share/i18n/SUPPORTED | grep UTF-8 |sed -e 's, .*,,' -e q)
+    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 1d833ad..7acc4e4 100755 (executable)
@@ -23,28 +23,42 @@ log_begin_msg "$DESCRIPTION"
 kbd=us
 cslayout=
 csvariant=
+csmodel=
 
-for x in $(cat /proc/cmdline); do
-        case $x in
-                kbd-chooser/method=*)
-                        kbd=${x#kbd-chooser/method=}
-                        ;;
-                console-setup/layoutcode=*)
-                        cslayout=${x#console-setup/layoutcode=}
-                        ;;
-                console-setup/variantcode=*)
-                        csvariant=${x#console-setup/variantcode=}
-                        ;;
-        esac
-done
-
-if [ "$cslayout" ] && [ -x /root/bin/setupcon ] && \
-   [ -f /root/etc/default/console-setup ]; then
-        chroot /root sed -i "s/^XKBLAYOUT=.*/XKBLAYOUT=\"$cslayout\"/" \
-                /etc/default/console-setup
-        if [ "$csvariant" ]; then
-                chroot /root sed -i "s/^XKBVARIANT=.*/XKBVARIANT=\"$csvariant\"/" \
+# commandline
+if [ ! -z "${KBD}" ]; then
+    kbd="${KBD}"
+fi
+if [ ! -z "${CSLAYOUT}" ]; then
+    cslayout="${CSLAYOUT}"
+fi
+if [ ! -z "${CSVARIANT}" ]; then
+    csvariant="${CSVARIANT}"
+fi
+if [ ! -z "${CSMODEL}" ]; then
+    csmodel="${CSMODEL}"
+fi
+
+if [ -x /root/bin/setupcon ] && [ -f /root/etc/default/console-setup ]; then
+        if [ "$cslayout" ]; then
+                chroot /root sed -i "s/^XKBLAYOUT=.*/XKBLAYOUT=\"$cslayout\"/" \
                         /etc/default/console-setup
+                if [ "$csvariant" ]; then
+                        chroot /root sed -i "s/^XKBVARIANT=.*/XKBVARIANT=\"$csvariant\"/" \
+                                /etc/default/console-setup
+                else
+                        casper-preseed /root console-setup/variantcode '' false
+                fi
+                if [ "$csmodel" ]; then
+                        chroot /root sed -i "s/^XKBMODEL=.*/XKBMODEL=\"$csmodel\"/" \
+                                /etc/default/console-setup
+                else
+                        casper-preseed /root console-setup/modelcode '' false
+                fi
+        else
+                casper-preseed /root console-setup/layoutcode '' false
+                casper-preseed /root console-setup/variantcode '' false
+                casper-preseed /root console-setup/modelcode '' false
         fi
 else
         chroot /root /usr/sbin/install-keymap $kbd
index 573b2a6..60baa76 100755 (executable)
@@ -24,20 +24,19 @@ log_begin_msg "$DESCRIPTION"
 
 if [ -n "$USERNAME" ]; then
     if [ ! -z "${CASPERGETTY}" ]; then
-        # AUTOMATIC SERIAL CONSOLE #
-        defconsole=$(sed -e 's%.*console=%console=%' /proc/cmdline)
-        if echo "${defconsole}" | grep -qs console=ttyS; then
-            PORT=$(echo "${defconsole}" | \
-                sed -e's%^console=%%' -e's%,.*%%')
-            SPEED=$(echo "${defconsole}" | \
-                    sed -e 's%^console=ttyS[0-9]\+,%%' \
+       if echo "${DEFCONSOLE}" | grep -qs ttyS; 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; do
                     for ID2 in $IDs; do
                         ID="${ID1}${ID2}"
-                           if ! grep "^${ID}:" /etc/inittab ; then
+                        if ! grep "^${ID}:" /etc/inittab ; then
                             #make sure it is not already in use
                             break 2
                         fi
@@ -47,6 +46,9 @@ if [ -n "$USERNAME" ]; then
                 >>/root/etc/inittab
             fi
         fi
+        if [ -f /root/etc/inittab ]; then
+             sed -i -e'/^[^#]/s%respawn:/sbin/getty%respawn:/sbin/casper-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
index cc64832..8cd633b 100755 (executable)
@@ -20,7 +20,7 @@ esac
 
 log_begin_msg "$DESCRIPTION"
 
-gconf_version=$(chroot /root /usr/bin/dpkg-query -W --showformat='${Version}' gconf-2 2>/dev/null) || gconf_version=""
+gconf_version=$(chroot /root /usr/bin/dpkg-query -W --showformat='${Version}' gconf2 2>/dev/null) || gconf_version=""
 
 gct() {
     if [ "$gconf_version" ]; then
@@ -45,8 +45,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
@@ -56,9 +56,9 @@ for x in $(cat /proc/cmdline); do
                         # Moderate Visual Impairment
                         access=v2)
                         gct -s -t bool /desktop/gnome/interface/accessibility true
-                        gct -s -t list --list-type=string /desktop/gnome/accessibility/startup/exec_ats [gnopernicus]
-                        gct -s -t bool /apps/gnopernicus/srcore/mag_active true
-                        gct -s -t bool /apps/gnopernicus/srcore/sp_active false
+                        gct -s -t list --list-type=string /desktop/gnome/accessibility/startup/exec_ats [orca]
+                        #gct -s -t bool /apps/gnopernicus/srcore/mag_active true
+                        #gct -s -t bool /apps/gnopernicus/srcore/sp_active false
 
                         kderc_addtoprefixes /usr/share/kubuntu-default-settings/kde-profile/lesser-visual-impairment/,/usr/share/kubuntu-default-settings/kde-profile/moderate-visual-impairment/
                         ;;
@@ -66,9 +66,9 @@ for x in $(cat /proc/cmdline); do
                         access=v3)
                         gct -s -t bool /desktop/gnome/sound/enable_esd false
                         gct -s -t bool /desktop/gnome/interface/accessibility true
-                        gct -s -t list --list-type=string /desktop/gnome/accessibility/startup/exec_ats [gnopernicus]
-                        gct -s -t bool /apps/gnopernicus/srcore/sp_active true
-                        gct -s -t bool /apps/gnopernicus/srcore/mag_active false
+                        gct -s -t list --list-type=string /desktop/gnome/accessibility/startup/exec_ats [orca]
+                        #gct -s -t bool /apps/gnopernicus/srcore/sp_active true
+                        #gct -s -t bool /apps/gnopernicus/srcore/mag_active false
                         ;;
                         # Minor Motor Difficulties
                         access=m1)
@@ -86,11 +86,11 @@ for x in $(cat /proc/cmdline); do
                         # Motor Difficulties - pointing devices
                         access=m2)
                         gct -s -t bool /desktop/gnome/accessibility/keyboard/enable true
+                       gct -s -t bool /desktop/gnome/interface/accessibility true
                         gct -s -t bool /desktop/gnome/accessibility/keyboard/stickykeys_enable true
                         gct -s -t bool /desktop/gnome/accessibility/keyboard/stickykeys_modifier_beep false
                         gct -s -t bool /desktop/accessibility/gnome/keyboard/stickykeys_two_key_off false
-                        gct -s -t bool /desktop/gnome/interface/accessibility true
-                        gct -s -t list --list-type=string /desktop/gnome/accessibility/startup/exec_ats gok
+                        gct -s -t list --list-type=string /desktop/gnome/accessibility/startup/exec_ats [onboard]
 
                         kderc_addtoprefixes /usr/share/kubuntu-default-settings/kde-profile/minor-motor-difficulties/,/usr/share/kubuntu-default-settings/kde-profile/motor-difficulties-pointing-devices/
                         ;;
index 47344fa..e27e2c4 100755 (executable)
@@ -23,8 +23,9 @@ 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
+#    casper-reconfigure /root gnome-power-manager
     chroot /root sudo -u "$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_suspend false
 fi
 
 if [ -f /root/usr/share/kubuntu-default-settings/kde-profile/default/share/config/kcmlaptoprc ]; then
index 96a1d6c..3a22602 100755 (executable)
@@ -25,4 +25,8 @@ if [ -e /root/usr/share/applications/language-selector.desktop ]; then
 
 fi
 
+if [ -x /root/usr/bin/fontconfig-voodoo ]; then
+    chroot /root fontconfig-voodoo --auto --quiet || true
+fi
+
 log_end_msg
index 967c30c..80daccd 100755 (executable)
@@ -11,6 +11,12 @@ gct() {
     chroot /target sudo -u "$USERNAME" gconftool-2 "$@"
 }
 
+kderc_addtoprefixes() {
+    if [ -e "/root/etc/kderc" ]; then
+        sed -i "s|\\(prefixes=/usr/share/kubuntu-default-settings/kde-profile/default/\\)|\\1,$1|" /root/etc/kderc
+    fi
+}
+
 for x in $(cat /proc/cmdline); do
                 case $x in
                         # Lesser Visual Impairment
@@ -27,23 +33,24 @@ for x in $(cat /proc/cmdline); do
                         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
-                        sed -i s.prefixes=/usr/share/kubuntu-default-settings/kde-profile/default/.prefixes=/usr/share/kubuntu-default-settings/kde-profile/default/,/usr/share/kubuntu-default-settings/kde-profile/lesser-visual-imparement/. /etc/kderc
+                        kderc_addtoprefixes /usr/share/kubuntu-default-settings/kde-profile/lesser-visual-impairment/
                         ;;
                         # Moderate Visual Impairment
                         access=v2)
                         gct -s -t bool /desktop/gnome/interface/accessibility true
-                        gct -s -t list --list-type=string /desktop/gnome/accessibility/startup/exec_ats [gnopernicus]
-                        gct -s -t bool /apps/gnopernicus/srcore/mag_active true
-                        gct -s -t bool /apps/gnopernicus/srcore/sp_active false
-                        sed -i s.prefixes=/usr/share/kubuntu-default-settings/kde-profile/default/.prefixes=/usr/share/kubuntu-default-settings/kde-profile/default/,/usr/share/kubuntu-default-settings/kde-profile/lesser-visual-imparement/,/usr/share/kubuntu-default-settings/kde-profile/moderate-visual-imparement/. /etc/kderc
+                        gct -s -t list --list-type=string /desktop/gnome/accessibility/startup/exec_ats [orca]
+                        #gct -s -t bool /apps/gnopernicus/srcore/mag_active true
+                        #gct -s -t bool /apps/gnopernicus/srcore/sp_active false
+                        kderc_addtoprefixes /usr/share/kubuntu-default-settings/kde-profile/lesser-visual-impairment/,/usr/share/kubuntu-default-settings/kde-profile/moderate-visual-impairment/
+
                         ;;
                         # Blindness
                         access=v3)
                         gct -s -t bool /desktop/gnome/sound/enable_esd false
                         gct -s -t bool /desktop/gnome/interface/accessibility true
-                        gct -s -t list --list-type=string /desktop/gnome/accessibility/startup/exec_ats [gnopernicus]
-                        gct -s -t bool /apps/gnopernicus/srcore/sp_active true
-                        gct -s -t bool /apps/gnopernicus/srcore/mag_active false
+                        gct -s -t list --list-type=string /desktop/gnome/accessibility/startup/exec_ats [orca]
+                        #gct -s -t bool /apps/gnopernicus/srcore/sp_active true
+                        #gct -s -t bool /apps/gnopernicus/srcore/mag_active false
                         ;;
                         # Minor Motor Difficulties
                         access=m1)
@@ -55,17 +62,17 @@ for x in $(cat /proc/cmdline); do
                         gct -s -t bool /desktop/gnome/peripherals/keyboard/repeat true
                         gct -s -t int /desktop/gnome/peripherals/keyboard/delay 700
                         gct -s -t int /desktop/gnome/peripherals/keyboard/rate 10
-                        sed -i s.prefixes=/usr/share/kubuntu-default-settings/kde-profile/default/.prefixes=/usr/share/kubuntu-default-settings/kde-profile/default/,/usr/share/kubuntu-default-settings/kde-profile/minor-motor-difficulties/. /etc/kderc
+                        kderc_addtoprefixes /usr/share/kubuntu-default-settings/kde-profile/minor-motor-difficulties/
                         ;;
                         # Motor Difficulties - pointing devices
                         access=m2)
                         gct -s -t bool /desktop/gnome/accessibility/keyboard/enable true
+                       gct -s -t bool /desktop/gnome/interface/accessibility true
                         gct -s -t bool /desktop/gnome/accessibility/keyboard/stickykeys_enable true
                         gct -s -t bool /desktop/gnome/accessibility/keyboard/stickykeys_modifier_beep false
                         gct -s -t bool /desktop/accessibility/gnome/keyboard/stickykeys_two_key_off false
-                        gct -s -t bool /desktop/gnome/interface/accessibility true
-                        gct -s -t list --list-type=string /desktop/gnome/accessibility/startup/exec_ats gok
-                        sed -i s.prefixes=/usr/share/kubuntu-default-settings/kde-profile/default/.prefixes=/usr/share/kubuntu-default-settings/kde-profile/default/,/usr/share/kubuntu-default-settings/kde-profile/minor-motor-difficulties/,/usr/share/kubuntu-default-settings/kde-profile/motor-difficulties-pointing-devices/. /etc/kderc                        
+                        gct -s -t list --list-type=string /desktop/gnome/accessibility/startup/exec_ats [onboard]
+                        kderc_addtoprefixes /usr/share/kubuntu-default-settings/kde-profile/minor-motor-difficulties/,/usr/share/kubuntu-default-settings/kde-profile/motor-difficulties-pointing-devices/
                         ;;
                esac
 done