Adding casper 1.68+debian-1. debian/1.68+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)
15 files changed:
casper-md5check/casper-md5check.c
debian/changelog
debian/changelog.upstream
debian/control
debian/control.debian
debian/control.ubuntu
scripts/casper
scripts/casper-bottom/02etc_casper_conf
scripts/casper-bottom/19keyboard
scripts/casper-bottom/22screensaver
scripts/casper-bottom/23networking
scripts/casper-bottom/25configure_init
scripts/casper-bottom/30accessibility
ubiquity-hooks/20xconfig
ubiquity-hooks/30accessibility

index 0571e49..1e9d1bb 100644 (file)
@@ -100,6 +100,23 @@ void usplash_text(int fd, char *format, ...) {
   free(s1);
 }
 
+void usplash_urgent(int fd, char *format, ...) {
+  char *s, *s1;
+  va_list argp;
+
+  va_start(argp, format);
+  vasprintf(&s, format, argp);
+  va_end(argp);
+
+  asprintf(&s1, "TEXT-URGENT %s", s);
+
+  write_and_retry(fd, s1);
+
+  free(s);
+  free(s1);
+}
+
+
 void usplash_success(int fd, char *format, ...) {
   char *s, *s1;
   va_list argp;
@@ -173,10 +190,13 @@ int main(int argc, char **argv) {
   
   if (pipe_fd == -1) {
     /* We can't really do anything useful here */
+    perror("Opening pipe");
     exit(1);
   }
   
+
   usplash_progress(pipe_fd, 0);
+  usplash_urgent(pipe_fd, "Checking integrity, this may take some time");
   md5_file = fopen(argv[2], "r");
   if (!md5_file) {
           perror("fopen md5_file");
@@ -214,7 +234,7 @@ int main(int argc, char **argv) {
 
     while (rsize > 0) {
       csize += rsize;
-      usplash_progress(pipe_fd, floorl(100*csize/tsize));
+      usplash_progress(pipe_fd, floorl(100*((long double)csize)/tsize));
 
       md5_append(&state, (const md5_byte_t *)buf, rsize);
       rsize = read(check_fd, buf, sizeof(buf));
@@ -235,9 +255,9 @@ int main(int argc, char **argv) {
     free(checksum);
     free(checkfile);
   }
-  usplash_text(pipe_fd, "Check finished, %d checksums failed", failed);
-  usplash_text(pipe_fd, "Press any key to reboot your system");
-  usplash_timeout(pipe_fd, 0);
+  usplash_urgent(pipe_fd, "Check finished, %d checksums failed", failed);
+  usplash_urgent(pipe_fd, "Press any key to reboot your system");
+  usplash_timeout(pipe_fd, 86400);
   set_nocanonical_tty(0);
   getchar();
   reboot(LINUX_REBOOT_CMD_RESTART);
index 33da0a9..125ea94 100644 (file)
@@ -1,3 +1,13 @@
+casper (1.68+debian-1) unstable; urgency=low
+
+  * New upstream release.
+  * Added static network configuration support.
+  * Fixed gnome-screensaver-lock differences between ubuntu.
+  * username, host, and userfullname are now also settable
+    via kernel parameters.
+
+ -- Marco Amadori <marco.amadori@gmail.com>  Fri,  8 Sep 2006 11:26:02 +0200
+
 casper (1.66+debian-1) unstable; urgency=low
 
   * Added "magic" to make it work seamlessy also on ubuntu systems.
index 6eb6873..bcf6f11 100644 (file)
@@ -1,3 +1,21 @@
+casper (1.68) edgy; urgency=low
+
+  * Honour console-setup/layoutcode and console-setup/variantcode preseeding
+    (closes: Malone #61573).
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Fri, 22 Sep 2006 16:09:53 +0100
+
+casper (1.67) edgy; urgency=low
+
+  * Make sure to write xorg.conf md5sum to the installed system, not the
+    live system in ubiquity-hooks/20xconfig
+  * Implement support for setting KDE's accessibility options too, thanks
+    to Jonathan Riddell for the patch.
+  * Use usplash's TEXT-URGENT for important messages when doing md5 checks
+  * Fix flashing of progress bar on 32 bit arches
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Wed, 23 Aug 2006 14:34:57 +0200
+
 casper (1.66) edgy; urgency=low
 
   * Fix use of db_get in ubiquity accessibility hook.
index cd9eee6..34be909 100644 (file)
@@ -8,8 +8,8 @@ Standards-Version: 3.7.2
 
 Package: casper
 Architecture: any
-Depends: initramfs-tools (>= 0.40), user-setup
-Conflicts: usplash (<< 0.1-30)
+Depends: initramfs-tools (>= 0.40), user-setup, sudo
+Conflicts: usplash (<< 0.4-27)
 Recommends: live-package
 Suggests: dmsetup
 Description: Debian Live initramfs generator
index cd9eee6..34be909 100644 (file)
@@ -8,8 +8,8 @@ Standards-Version: 3.7.2
 
 Package: casper
 Architecture: any
-Depends: initramfs-tools (>= 0.40), user-setup
-Conflicts: usplash (<< 0.1-30)
+Depends: initramfs-tools (>= 0.40), user-setup, sudo
+Conflicts: usplash (<< 0.4-27)
 Recommends: live-package
 Suggests: dmsetup
 Description: Debian Live initramfs generator
index a8ab8de..6767acc 100644 (file)
@@ -10,7 +10,7 @@ Architecture: any
 Section: misc
 Priority: extra
 Depends: initramfs-tools (>= 0.40ubuntu11), dmsetup, user-setup, sudo
-Conflicts: usplash (<< 0.1-30)
+Conflicts: usplash (<< 0.4-27)
 Description: Run a "live" preinstalled system from read-only media
 
 Package: ubiquity-casper
index 3e4ed06..c019e3b 100644 (file)
@@ -6,20 +6,9 @@ export PATH=/root/usr/bin:/root/usr/sbin:/root/bin:/root/sbin:/usr/bin:/usr/sbin
 
 mountpoint=/live_media
 
-# Will be mounted if found as copy on write instead of tmpfs
 root_persistence="casper-rw"
-
-# TODO
-## Each file found with this pattern will be mounted directly in the 
-## mountpoint extracted from file name "${other_mounts_pattern}<mountpoint>"
-#other_mounts_pattern="casper-mount-"
 home_persistence="home-rw"
 
-#overlay_method=unionfs
-#if [ "${DPKG_ARCH}" = "ia64" ] || [ "${DPKG_ARCH}" = "hppa" ] || [ "${DPKG_ARCH}" = "sparc" ]; then
-#    overlay_method=devmapper
-#fi
-
 USERNAME="casper"
 USERFULLNAME="Live session user"
 HOST="live"
@@ -40,14 +29,32 @@ 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 ;;
-        show-cow)
-            export SHOWCOW=1 ;;
+        hide-cow)
+            export HIDECOW=1 ;;
         persistent)
             export PERSISTENT=1 ;;
+        staticip*)
+            STATICIP=${x#staticip=} 
+            if [ "${STATICIP}" == "" ]; then
+                STATICIP="frommedia"
+            fi
+            export STATICIP ;;
         casper-getty)
             export CASPERGETTY=1 ;;
     esac
@@ -155,8 +162,6 @@ setup_loop() {
 }
 
 get_fstype() {
-    #FIXME# one use of this function expects "unknown" another does not!
-    # which is it???
     local FSTYPE
     local FSSIZE
     eval $(fstype < $1)
@@ -374,7 +379,7 @@ setup_unionfs() {
     mkdir -p /cow
     cowdevice="tmpfs"
     cow_fstype="tmpfs"
-    
+
     # Looking for "${root_persistence}" device or file
     if [ ! -z "${PERSISTENT}" ]; then
         cowprobe=$(find_cow_device "${root_persistence}")
@@ -382,19 +387,24 @@ setup_unionfs() {
             cowdevice=${cowprobe}
             cow_fstype=$(get_fstype "${cowprobe}")
         else
-            [ "$quiet" != "y" ] &&    log_begin_msg "Unable to find the persistent medium"
+            [ "$quiet" != "y" ] && log_begin_msg "Unable to find the persistent medium"
         fi
     fi
 
     mount ${cowdevice} -t ${cow_fstype} -o rw /cow || panic "Can not mount $cowdevice on /cow"
+
+    # Look for a snapshot to copy
     
+
     mount -t unionfs -o dirs=/cow=rw:$rofsstring unionfs "$rootmnt" || panic "Unionfs mount failed"
-    
+
     for d in ${rofslist}; do
         mkdir -p "${rootmnt}/casper/${d##*/}"
         case d in
-            *.dir) mount -o bind "${d}" "${rootmnt}/casper/${d##*/}" ;;
-            *) mount -o move "${d}" "${rootmnt}/casper/${d##*/}" ;;
+            *.dir) # do nothing # mount -o bind "${d}" "${rootmnt}/casper/${d##*/}"
+                ;;
+            *) mount -o move "${d}" "${rootmnt}/casper/${d##*/}"
+                ;;
         esac
     done
 
@@ -408,7 +418,7 @@ setup_unionfs() {
         fi
     fi
 
-    if [ ! -z "${SHOWCOW}" ]; then
+    if [ -z "${HIDECOW}" ]; then
         mkdir -p "$rootmnt/cow"
         mount -o bind /cow "$rootmnt/cow"
     fi
@@ -416,7 +426,7 @@ setup_unionfs() {
 
 is_usb_device() {
     sysfs_path="${1#/sys}"
-    if /lib/udev/path_id "${sysfs_path}" | grep -Eq "ID_PATH=(usb|pci-[^-]*-usb)"; then
+    if /lib/udev/path_id "${sysfs_path}" | grep -E -q "ID_PATH=(usb|pci-[^-]*-usb)"; then
         return 0
     fi
     return 1
index fd19ac9..7c4d08d 100644 (file)
@@ -17,7 +17,14 @@ esac
 
  
 if [ -f /etc/casper.conf ] ; then 
+       if [ ! -z "${CASPERCONF}" ]; then
+               # Updating casper.conf
+               sed -i -e 's/\(USERNAME="\).*"/\1'"${USERNAME}"'"/g' \
+                   -e 's/\(USERFULLNAME="\).*"/\1'"${USERFULLNAME}"'"/g' \
+                   -e 's/\(HOST="\).*"/\1'"${HOST}"'"/g' /etc/casper.conf
+       fi
        cp -p /etc/casper.conf /root/etc/casper.conf
+
 else
        cat <<EOF >/root/etc/casper.conf
 export USERNAME="$USERNAME"
index 895a698..d738faf 100755 (executable)
@@ -21,15 +21,33 @@ esac
 log_begin_msg "$DESCRIPTION"
 
 kbd=us
+cslayout=
+csvariant=
 
 for x in $(cat /proc/cmdline); do
-                case $x in
-                        kbd-chooser/method=*)
-                                kbd=${x#kbd-chooser/method=}
-                                ;;
-                esac
+        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
 
-chroot /root /usr/sbin/install-keymap $kbd
-casper-preseed /root debian-installer/keymap "$kbd"
+if [ "$cslayout" ] && [ -x /root/bin/setupcon ] && \
+   [ -f /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\"/" \
+                        /etc/default/console-setup
+        fi
+else
+        chroot /root /usr/sbin/install-keymap $kbd
+        casper-preseed /root debian-installer/keymap "$kbd"
+fi
 log_end_msg
index 6719f5f..ff3ec81 100755 (executable)
@@ -20,9 +20,17 @@ esac
 
 log_begin_msg "$DESCRIPTION"
 
+
 gnome_screensaver_version=$(chroot /root dpkg-query -W --showformat='${Version}' gnome-screensaver 2>/dev/null) || gnome_screensaver_version=""
+
+if [ "${BUILD_SYSTEM}" == "Ubuntu" ]; then
+       gnome_screensaver_lock="/apps/gnome-screensaver/lock"
+else
+       gnome_screensaver_lock="/apps/gnome-screensaver/lock_enabled"
+fi
+       
 if [ -n "$gnome_screensaver_version" ]; then
-    chroot /root sudo -u "$USERNAME" gconftool-2 -t bool -s /apps/gnome-screensaver/lock false
+    chroot /root sudo -u "$USERNAME" gconftool-2 -t bool -s "${gnome_screensaver_lock}" false
 fi
 
 log_end_msg
index 10d4ab2..8f4b698 100755 (executable)
@@ -21,34 +21,48 @@ esac
 
 log_begin_msg "$DESCRIPTION"
 
+if [ "${STATICIP}" == "frommedia" ] && [ -e  "$IFFILE" ] ; then
+       # will use existent /etc/network/interfaces
+       log_end_msg
+       exit 0
+fi
+
 cat > "$IFFILE" <<EOF
 auto lo
 iface lo inet loopback
 
 EOF
 
-udevtrigger  
+udevtrigger
 
 if [ -z "${NETBOOT}" ] ; then
-       for interface in /sys/class/net/eth* /sys/class/net/ath* /sys/class/net/wlan*; do
-               [ -e $interface ] || continue
-               i="$(basename $interface)"
-               cat >> "$IFFILE" <<EOF
-auto $i
-iface $i inet dhcp
+       if [ ! -z "${STATICIP}" ] && [ "${STATICIP}" != "frommedia" ]; then
+               parsed=$(echo "${STATICIP}" | sed -e 's/:/ /g')
+               for ifline in ${parsed}; do
+                       ifname="$(echo ${ifline} | cut -f1 -d ',')"
+                       ifaddress="$(echo ${ifline} | cut -f2 -d ',')"
+                       ifnetmask="$(echo ${ifline} | cut -f3 -d ',')"
+                       ifgateway="$(echo ${ifline} | cut -f4 -d ',')"
+                       cat >> "$IFFILE" <<EOF
+auto ${ifname}
+iface ${ifname} inet static
+    address ${ifaddress}
+    netmask ${ifnetmask}
+    gateway ${ifgateway}
 
 EOF
-
-       done
-fi
-
-for i in eth0 eth1 eth2 ath0 wlan0; do
-    [ ! -e /sys/class/net/$i ] || continue
-    cat >> "$IFFILE" <<EOF
+               done
+       else
+               for interface in /sys/class/net/eth* /sys/class/net/ath* /sys/class/net/wlan*; do
+                       [ -e $interface ] || continue
+                       i="$(basename $interface)"
+                       cat >> "$IFFILE" <<EOF
 auto $i
 iface $i inet dhcp
 
 EOF
-done
+               done
+       fi
+fi
 
 log_end_msg
index 010e2eb..84fa741 100755 (executable)
@@ -23,10 +23,7 @@ log_begin_msg "$DESCRIPTION"
 # Arrange for shells on virtual consoles, rather than login prompts
 
 if [ -n "$USERNAME" ]; then
-    if [ -z "${CASPERGETTY}" ]; then
-        sed -i -e "s|^\([^:]*:[^:]*:[^:]*\):.*getty.*\<\(tty[0-9].*\).*$|\1:/bin/login -f $USERNAME </dev/\2 >/dev/\2 2>\&1|" /root/etc/inittab
-    else
-        sed -i -e'/^[^#]/s%respawn:/sbin/getty%respawn:/sbin/casper-getty%' /root/etc/inittab
+    if [ ! -z "${CASPERGETTY}" ]; then
         # AUTOMATIC SERIAL CONSOLE #
         defconsole=$(sed -e 's%.*console=%console=%' /proc/cmdline)
         if echo "${defconsole}" | grep -qs console=ttyS; then
@@ -50,6 +47,15 @@ if [ -n "$USERNAME" ]; then
                 >>/root/etc/inittab
             fi
         fi
+    else
+        if [ -f /root/etc/inittab ]; then
+            sed -i -e "s|^\([^:]*:[^:]*:[^:]*\):.*getty.*\<\(tty[0-9]*\).*$|\1:/bin/login -f $USERNAME </dev/\2 >/dev/\2 2>\&1|" /root/etc/inittab
+       fi
+        if [ "/root/etc/event.d/tty*" != "$(echo /root/etc/event.d/tty*)" ]; then
+            for f in /root/etc/event.d/tty*; do
+                sed -i -e "s|^respawn.*|respawn /bin/login -f $USERNAME </dev/$(basename $f) > /dev/$(basename $f) 2>\&1|" $f
+            done
+        fi
     fi
 fi
 
index 8352fb6..b0c049b 100755 (executable)
@@ -20,8 +20,18 @@ esac
 
 log_begin_msg "$DESCRIPTION"
 
+gconf_version=$(chroot /root /usr/bin/dpkg-query -W --showformat='${Version}' gconf-2 2>/dev/null) || gconf_version=""
+
 gct() {
-    chroot /root sudo -u "$USERNAME" gconftool-2 "$@"
+    if [ "$gconf_version" ]; then
+        chroot /root sudo -u "$USERNAME" gconftool-2 "$@"
+    fi
+}
+
+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
@@ -40,6 +50,9 @@ 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
+
+                        kderc_addtoprefixes /usr/share/kubuntu-default-settings/kde-profile/lesser-visual-impairment/
+                        fi
                         ;;
                         # Moderate Visual Impairment
                         access=v2)
@@ -47,6 +60,8 @@ for x in $(cat /proc/cmdline); do
                         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
+
+                        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)
@@ -66,6 +81,8 @@ 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
+
+                        kderc_addtoprefixes /usr/share/kubuntu-default-settings/kde-profile/minor-motor-difficulties/
                         ;;
                         # Motor Difficulties - pointing devices
                         access=m2)
@@ -75,6 +92,8 @@ for x in $(cat /proc/cmdline); do
                         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
+
+                        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
index 6f8becd..92d7097 100755 (executable)
@@ -5,7 +5,7 @@ if [ -f /etc/X11/xorg.conf ]; then
     cp -a /etc/X11/xorg.conf /target/etc/X11/xorg.conf
     # requires x11-common (>= 7.0.0-0ubuntu1)
     mkdir -p /target/var/lib/x11
-    chroot /target md5sum /etc/X11/xorg.conf > /var/lib/x11/xorg.conf.md5sum
+    chroot /target sh -c 'md5sum /etc/X11/xorg.conf > /var/lib/x11/xorg.conf.md5sum'
 fi
 
 exit 0
index 9fcfc26..967c30c 100755 (executable)
@@ -27,6 +27,7 @@ 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
                         ;;
                         # Moderate Visual Impairment
                         access=v2)
@@ -34,6 +35,7 @@ for x in $(cat /proc/cmdline); do
                         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
                         ;;
                         # Blindness
                         access=v3)
@@ -53,6 +55,7 @@ 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
                         ;;
                         # Motor Difficulties - pointing devices
                         access=m2)
@@ -62,6 +65,7 @@ for x in $(cat /proc/cmdline); do
                         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                        
                         ;;
                esac
 done