Adding casper 1.59+debian-1. debian/1.59+debian-1
authorDaniel Baumann <daniel@debian.org>
Sun, 23 Sep 2007 12:46:22 +0000 (14:46 +0200)
committerDaniel Baumann <daniel@debian.org>
Sun, 23 Sep 2007 12:46:22 +0000 (14:46 +0200)
48 files changed:
bin/casper-preseed [new file with mode: 0755]
bin/casper-reconfigure [new file with mode: 0755]
casper-md5check/Makefile [new file with mode: 0644]
casper-md5check/casper-md5check.c [new file with mode: 0644]
casper-md5check/md5.c [new file with mode: 0644]
casper-md5check/md5.h [new file with mode: 0644]
casper.conf [new file with mode: 0644]
caspermon/GNOME_PythonAppletCasper.server [new file with mode: 0644]
caspermon/caspermon-applet [new file with mode: 0755]
caspermon/caspermond [new file with mode: 0644]
debian/casper.dirs [new file with mode: 0644]
debian/casper.init [new file with mode: 0755]
debian/casper.install [new file with mode: 0644]
debian/casper.lintian [new file with mode: 0644]
debian/casper.postinst [new file with mode: 0644]
debian/changelog [new file with mode: 0644]
debian/changelog.upstream [new file with mode: 0644]
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/rules [new file with mode: 0755]
debian/ubiquity-casper.install [new file with mode: 0644]
hooks/casper [new file with mode: 0755]
scripts/casper [new file with mode: 0644]
scripts/casper-bottom/01integrity_check [new file with mode: 0755]
scripts/casper-bottom/05mountpoints [new file with mode: 0755]
scripts/casper-bottom/10adduser [new file with mode: 0755]
scripts/casper-bottom/12fstab [new file with mode: 0755]
scripts/casper-bottom/13swap [new file with mode: 0755]
scripts/casper-bottom/14locales [new file with mode: 0755]
scripts/casper-bottom/15autologin [new file with mode: 0755]
scripts/casper-bottom/18hostname [new file with mode: 0755]
scripts/casper-bottom/19keyboard [new file with mode: 0755]
scripts/casper-bottom/20xconfig [new file with mode: 0755]
scripts/casper-bottom/22gnome_panel_data [new file with mode: 0755]
scripts/casper-bottom/22screensaver [new file with mode: 0755]
scripts/casper-bottom/23etc_modules [new file with mode: 0755]
scripts/casper-bottom/23networking [new file with mode: 0755]
scripts/casper-bottom/24preseed [new file with mode: 0755]
scripts/casper-bottom/25configure_init [new file with mode: 0755]
scripts/casper-bottom/30accessibility [new file with mode: 0755]
scripts/casper-bottom/31disable_update_notifier [new file with mode: 0755]
scripts/casper-bottom/32disable_hibernation [new file with mode: 0755]
scripts/casper-bottom/33disable_binary_drivers [new file with mode: 0755]
ubiquity-hooks/20xconfig [new file with mode: 0755]
ubiquity-hooks/22gnome_panel_data [new file with mode: 0755]
ubiquity-hooks/25modules [new file with mode: 0755]
ubiquity-hooks/32gnome_power_manager [new file with mode: 0755]

diff --git a/bin/casper-preseed b/bin/casper-preseed
new file mode 100755 (executable)
index 0000000..6967fe2
--- /dev/null
@@ -0,0 +1,17 @@
+#! /bin/sh
+set -e
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
+
+root="$1"
+question="$2"
+value="$3"
+
+if ! (echo "SET $question $value"; echo "FSET $question seen true") | 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
+EOF
+fi
+
+exit 0
diff --git a/bin/casper-reconfigure b/bin/casper-reconfigure
new file mode 100755 (executable)
index 0000000..628bff3
--- /dev/null
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+set -e
+export PATH=/usr/bin:/usr/sbin:/sbin:/bin
+
+frontend=noninteractive
+
+findcommandinroot() {
+    ROOT="$1/"
+    shift
+    while [ "$#" -ge 1 ]; do
+        P="$PATH"
+        while [ "$P" ]; do
+            D=${P%%:*}
+            P=${P#*:}
+            if [ "$D" = "$P" ]; then
+                P=
+            fi
+            if [ -z "$D" ]; then
+                D=.
+            fi
+            if [ -x "$ROOT$D/$1" ]; then
+                echo "$D/$1"
+                return 0
+            fi
+        done
+        shift
+    done
+    return 1
+}
+
+runcommandinroot() {
+    C=$(findcommandinroot "$1" "$2")
+    ROOT="$1"
+    shift
+    shift
+    [ -n "$C" ] && chroot "$ROOT" "$C" "$@"
+}
+
+root="$1"
+package="$2"
+
+version=$(runcommandinroot "$root" dpkg-query -W --showformat='${Version}' "$package" 2>/dev/null) || version=""
+
+if [ -z "$version" ]; then
+    echo "$0: package '$package' is not installed"
+    exit 0
+fi
+
+runcommandinroot "$root" dpkg-reconfigure -fnoninteractive --no-reload -phigh "$package"
+
+exit 0
diff --git a/casper-md5check/Makefile b/casper-md5check/Makefile
new file mode 100644 (file)
index 0000000..193ac69
--- /dev/null
@@ -0,0 +1,9 @@
+
+CC=gcc
+LDFLAGS=-lm
+CFLAGS=$(getconf LFS_CFLAGS) -Wall -O2
+
+casper-md5check: casper-md5check.c md5.c
+
+clean:
+       rm *.o casper-md5check
diff --git a/casper-md5check/casper-md5check.c b/casper-md5check/casper-md5check.c
new file mode 100644 (file)
index 0000000..0571e49
--- /dev/null
@@ -0,0 +1,246 @@
+/* casper-md5check - a tool to check md5sums and talk to usplash
+   (C) Canonical Ltd 2006
+   Written by Tollef Fog Heen <tfheen@ubuntu.com>
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+   USA. */
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/reboot.h>
+#include <linux/reboot.h>
+#include <string.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <math.h>
+#include <termios.h>
+
+#define USPLASH_FIFO "/dev/.initramfs/usplash_fifo"
+#define MAXTRIES 5
+#include "md5.h"
+#define DEBUG
+
+int write_and_retry(int fd, char *s) {
+  int try = 0, ret = 0;
+  char *end;
+
+#ifdef DEBUG
+  fprintf(stderr, "-> %s\n", s);
+#endif
+
+  end = s + strlen(s)+1;
+
+  ret = write(fd, s, end - s);
+  while (s + ret < end && try < MAXTRIES) {
+    sleep(1);
+    s += ret;
+    ret = write(fd, s, strlen(s)+1);
+    try++;
+  }
+  return (s+ret == end ? 0 : 1);
+}
+
+void usplash_timeout(int fd, int timeout) {
+  char *s;
+
+  asprintf(&s, "TIMEOUT %d", timeout);
+
+  write_and_retry(fd, s);
+
+  free(s);
+
+}
+
+void usplash_failure(int fd, char *format, ...) {
+  char *s, *s1;
+  va_list argp;
+
+  va_start(argp, format);
+  vasprintf(&s, format, argp);
+  va_end(argp);
+
+  asprintf(&s1, "FAILURE %s", s);
+
+  write_and_retry(fd, s1);
+
+  free(s);
+  free(s1);
+}
+
+void usplash_text(int fd, char *format, ...) {
+  char *s, *s1;
+  va_list argp;
+
+  va_start(argp, format);
+  vasprintf(&s, format, argp);
+  va_end(argp);
+
+  asprintf(&s1, "TEXT %s", s);
+
+  write_and_retry(fd, s1);
+
+  free(s);
+  free(s1);
+}
+
+void usplash_success(int fd, char *format, ...) {
+  char *s, *s1;
+  va_list argp;
+
+  va_start(argp, format);
+  vasprintf(&s, format, argp);
+  va_end(argp);
+
+  asprintf(&s1, "SUCCESS %s", s);
+
+  write_and_retry(fd, s1);
+  
+  free(s);
+  free(s1);
+}
+
+void usplash_progress(int fd, int progress) {
+  static int prevprogress = -1;
+  char *s;
+
+  if (progress == prevprogress)
+    return;
+  prevprogress = progress;
+
+  asprintf(&s, "PROGRESS %d", progress);
+
+  write_and_retry(fd, s);
+
+  free(s);
+}
+
+int set_nocanonical_tty(int fd) {
+  struct termios t;
+
+  if (tcgetattr(fd, &t) == -1) {
+    perror("tcgetattr");
+  }
+  t.c_lflag &= ~ICANON;
+  t.c_cc[VMIN] = 1;
+  t.c_cc[VTIME] = 0;
+  return tcsetattr(fd, TCSANOW, &t);
+}
+
+int main(int argc, char **argv) {
+  
+  int pipe_fd, check_fd;
+  int failed = 0;
+  
+  FILE *md5_file;
+  md5_state_t state;
+  md5_byte_t digest[16];
+  char hex_output[16*2 + 1];
+  char *checksum, *checkfile;
+  ssize_t tsize, csize;
+
+  tsize = 0;
+  csize = 0;
+
+  if (argc != 3) {
+    fprintf(stderr,"Wrong number of arguments\n");
+    fprintf(stderr,"%s <root directory> <md5sum file>\n", argv[0]);
+    exit(1);
+  }
+  
+  if (chdir(argv[1]) != 0) {
+    perror("chdir");
+    exit(1);
+  }
+  
+  pipe_fd = open(USPLASH_FIFO, O_WRONLY|O_NONBLOCK);
+  
+  if (pipe_fd == -1) {
+    /* We can't really do anything useful here */
+    exit(1);
+  }
+  
+  usplash_progress(pipe_fd, 0);
+  md5_file = fopen(argv[2], "r");
+  if (!md5_file) {
+          perror("fopen md5_file");
+          exit(1);
+  }
+  while (fscanf(md5_file, "%as %as", &checksum, &checkfile) == 2) {
+    struct stat statbuf;
+
+    if (stat(checkfile, &statbuf) == 0) {
+      tsize += statbuf.st_size;
+    }
+
+    free(checksum);
+    free(checkfile);
+  }
+
+  rewind(md5_file);
+  while (fscanf(md5_file, "%as %as", &checksum, &checkfile) == 2) {
+    char buf[BUFSIZ];
+    ssize_t rsize;
+    int i;
+    
+    md5_init(&state);
+    
+    usplash_text(pipe_fd, "Checking %s", checkfile);
+    
+    check_fd = open(checkfile, O_RDONLY);
+    if (check_fd < 0) {
+      usplash_timeout(pipe_fd, 300);
+      usplash_failure(pipe_fd, "%s", strerror(errno));
+      sleep(10);
+    }
+    
+    rsize = read(check_fd, buf, sizeof(buf));
+
+    while (rsize > 0) {
+      csize += rsize;
+      usplash_progress(pipe_fd, floorl(100*csize/tsize));
+
+      md5_append(&state, (const md5_byte_t *)buf, rsize);
+      rsize = read(check_fd, buf, sizeof(buf));
+    }
+    
+    close(check_fd);
+    md5_finish(&state, digest);
+    
+    for (i = 0; i < 16; i++)
+      sprintf(hex_output + i * 2, "%02x", digest[i]);
+    
+    if (strncmp(hex_output, checksum, strlen(hex_output)) == 0) {
+      usplash_success(pipe_fd, "OK");
+    } else {
+      usplash_failure(pipe_fd, "mismatch");
+      failed++;
+    }
+    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);
+  set_nocanonical_tty(0);
+  getchar();
+  reboot(LINUX_REBOOT_CMD_RESTART);
+  return 0;
+  
+}
diff --git a/casper-md5check/md5.c b/casper-md5check/md5.c
new file mode 100644 (file)
index 0000000..c35d96c
--- /dev/null
@@ -0,0 +1,381 @@
+/*
+  Copyright (C) 1999, 2000, 2002 Aladdin Enterprises.  All rights reserved.
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+
+  L. Peter Deutsch
+  ghost@aladdin.com
+
+ */
+/* $Id: md5.c,v 1.6 2002/04/13 19:20:28 lpd Exp $ */
+/*
+  Independent implementation of MD5 (RFC 1321).
+
+  This code implements the MD5 Algorithm defined in RFC 1321, whose
+  text is available at
+       http://www.ietf.org/rfc/rfc1321.txt
+  The code is derived from the text of the RFC, including the test suite
+  (section A.5) but excluding the rest of Appendix A.  It does not include
+  any code or documentation that is identified in the RFC as being
+  copyrighted.
+
+  The original and principal author of md5.c is L. Peter Deutsch
+  <ghost@aladdin.com>.  Other authors are noted in the change history
+  that follows (in reverse chronological order):
+
+  2002-04-13 lpd Clarified derivation from RFC 1321; now handles byte order
+       either statically or dynamically; added missing #include <string.h>
+       in library.
+  2002-03-11 lpd Corrected argument list for main(), and added int return
+       type, in test program and T value program.
+  2002-02-21 lpd Added missing #include <stdio.h> in test program.
+  2000-07-03 lpd Patched to eliminate warnings about "constant is
+       unsigned in ANSI C, signed in traditional"; made test program
+       self-checking.
+  1999-11-04 lpd Edited comments slightly for automatic TOC extraction.
+  1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5).
+  1999-05-03 lpd Original version.
+ */
+
+#include "md5.h"
+#include <string.h>
+
+#undef BYTE_ORDER      /* 1 = big-endian, -1 = little-endian, 0 = unknown */
+#ifdef ARCH_IS_BIG_ENDIAN
+#  define BYTE_ORDER (ARCH_IS_BIG_ENDIAN ? 1 : -1)
+#else
+#  define BYTE_ORDER 0
+#endif
+
+#define T_MASK ((md5_word_t)~0)
+#define T1 /* 0xd76aa478 */ (T_MASK ^ 0x28955b87)
+#define T2 /* 0xe8c7b756 */ (T_MASK ^ 0x173848a9)
+#define T3    0x242070db
+#define T4 /* 0xc1bdceee */ (T_MASK ^ 0x3e423111)
+#define T5 /* 0xf57c0faf */ (T_MASK ^ 0x0a83f050)
+#define T6    0x4787c62a
+#define T7 /* 0xa8304613 */ (T_MASK ^ 0x57cfb9ec)
+#define T8 /* 0xfd469501 */ (T_MASK ^ 0x02b96afe)
+#define T9    0x698098d8
+#define T10 /* 0x8b44f7af */ (T_MASK ^ 0x74bb0850)
+#define T11 /* 0xffff5bb1 */ (T_MASK ^ 0x0000a44e)
+#define T12 /* 0x895cd7be */ (T_MASK ^ 0x76a32841)
+#define T13    0x6b901122
+#define T14 /* 0xfd987193 */ (T_MASK ^ 0x02678e6c)
+#define T15 /* 0xa679438e */ (T_MASK ^ 0x5986bc71)
+#define T16    0x49b40821
+#define T17 /* 0xf61e2562 */ (T_MASK ^ 0x09e1da9d)
+#define T18 /* 0xc040b340 */ (T_MASK ^ 0x3fbf4cbf)
+#define T19    0x265e5a51
+#define T20 /* 0xe9b6c7aa */ (T_MASK ^ 0x16493855)
+#define T21 /* 0xd62f105d */ (T_MASK ^ 0x29d0efa2)
+#define T22    0x02441453
+#define T23 /* 0xd8a1e681 */ (T_MASK ^ 0x275e197e)
+#define T24 /* 0xe7d3fbc8 */ (T_MASK ^ 0x182c0437)
+#define T25    0x21e1cde6
+#define T26 /* 0xc33707d6 */ (T_MASK ^ 0x3cc8f829)
+#define T27 /* 0xf4d50d87 */ (T_MASK ^ 0x0b2af278)
+#define T28    0x455a14ed
+#define T29 /* 0xa9e3e905 */ (T_MASK ^ 0x561c16fa)
+#define T30 /* 0xfcefa3f8 */ (T_MASK ^ 0x03105c07)
+#define T31    0x676f02d9
+#define T32 /* 0x8d2a4c8a */ (T_MASK ^ 0x72d5b375)
+#define T33 /* 0xfffa3942 */ (T_MASK ^ 0x0005c6bd)
+#define T34 /* 0x8771f681 */ (T_MASK ^ 0x788e097e)
+#define T35    0x6d9d6122
+#define T36 /* 0xfde5380c */ (T_MASK ^ 0x021ac7f3)
+#define T37 /* 0xa4beea44 */ (T_MASK ^ 0x5b4115bb)
+#define T38    0x4bdecfa9
+#define T39 /* 0xf6bb4b60 */ (T_MASK ^ 0x0944b49f)
+#define T40 /* 0xbebfbc70 */ (T_MASK ^ 0x4140438f)
+#define T41    0x289b7ec6
+#define T42 /* 0xeaa127fa */ (T_MASK ^ 0x155ed805)
+#define T43 /* 0xd4ef3085 */ (T_MASK ^ 0x2b10cf7a)
+#define T44    0x04881d05
+#define T45 /* 0xd9d4d039 */ (T_MASK ^ 0x262b2fc6)
+#define T46 /* 0xe6db99e5 */ (T_MASK ^ 0x1924661a)
+#define T47    0x1fa27cf8
+#define T48 /* 0xc4ac5665 */ (T_MASK ^ 0x3b53a99a)
+#define T49 /* 0xf4292244 */ (T_MASK ^ 0x0bd6ddbb)
+#define T50    0x432aff97
+#define T51 /* 0xab9423a7 */ (T_MASK ^ 0x546bdc58)
+#define T52 /* 0xfc93a039 */ (T_MASK ^ 0x036c5fc6)
+#define T53    0x655b59c3
+#define T54 /* 0x8f0ccc92 */ (T_MASK ^ 0x70f3336d)
+#define T55 /* 0xffeff47d */ (T_MASK ^ 0x00100b82)
+#define T56 /* 0x85845dd1 */ (T_MASK ^ 0x7a7ba22e)
+#define T57    0x6fa87e4f
+#define T58 /* 0xfe2ce6e0 */ (T_MASK ^ 0x01d3191f)
+#define T59 /* 0xa3014314 */ (T_MASK ^ 0x5cfebceb)
+#define T60    0x4e0811a1
+#define T61 /* 0xf7537e82 */ (T_MASK ^ 0x08ac817d)
+#define T62 /* 0xbd3af235 */ (T_MASK ^ 0x42c50dca)
+#define T63    0x2ad7d2bb
+#define T64 /* 0xeb86d391 */ (T_MASK ^ 0x14792c6e)
+
+
+static void
+md5_process(md5_state_t *pms, const md5_byte_t *data /*[64]*/)
+{
+    md5_word_t
+       a = pms->abcd[0], b = pms->abcd[1],
+       c = pms->abcd[2], d = pms->abcd[3];
+    md5_word_t t;
+#if BYTE_ORDER > 0
+    /* Define storage only for big-endian CPUs. */
+    md5_word_t X[16];
+#else
+    /* Define storage for little-endian or both types of CPUs. */
+    md5_word_t xbuf[16];
+    const md5_word_t *X;
+#endif
+
+    {
+#if BYTE_ORDER == 0
+       /*
+        * Determine dynamically whether this is a big-endian or
+        * little-endian machine, since we can use a more efficient
+        * algorithm on the latter.
+        */
+       static const int w = 1;
+
+       if (*((const md5_byte_t *)&w)) /* dynamic little-endian */
+#endif
+#if BYTE_ORDER <= 0            /* little-endian */
+       {
+           /*
+            * On little-endian machines, we can process properly aligned
+            * data without copying it.
+            */
+           if (!((data - (const md5_byte_t *)0) & 3)) {
+               /* data are properly aligned */
+               X = (const md5_word_t *)data;
+           } else {
+               /* not aligned */
+               memcpy(xbuf, data, 64);
+               X = xbuf;
+           }
+       }
+#endif
+#if BYTE_ORDER == 0
+       else                    /* dynamic big-endian */
+#endif
+#if BYTE_ORDER >= 0            /* big-endian */
+       {
+           /*
+            * On big-endian machines, we must arrange the bytes in the
+            * right order.
+            */
+           const md5_byte_t *xp = data;
+           int i;
+
+#  if BYTE_ORDER == 0
+           X = xbuf;           /* (dynamic only) */
+#  else
+#    define xbuf X             /* (static only) */
+#  endif
+           for (i = 0; i < 16; ++i, xp += 4)
+               xbuf[i] = xp[0] + (xp[1] << 8) + (xp[2] << 16) + (xp[3] << 24);
+       }
+#endif
+    }
+
+#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32 - (n))))
+
+    /* Round 1. */
+    /* Let [abcd k s i] denote the operation
+       a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s). */
+#define F(x, y, z) (((x) & (y)) | (~(x) & (z)))
+#define SET(a, b, c, d, k, s, Ti)\
+  t = a + F(b,c,d) + X[k] + Ti;\
+  a = ROTATE_LEFT(t, s) + b
+    /* Do the following 16 operations. */
+    SET(a, b, c, d,  0,  7,  T1);
+    SET(d, a, b, c,  1, 12,  T2);
+    SET(c, d, a, b,  2, 17,  T3);
+    SET(b, c, d, a,  3, 22,  T4);
+    SET(a, b, c, d,  4,  7,  T5);
+    SET(d, a, b, c,  5, 12,  T6);
+    SET(c, d, a, b,  6, 17,  T7);
+    SET(b, c, d, a,  7, 22,  T8);
+    SET(a, b, c, d,  8,  7,  T9);
+    SET(d, a, b, c,  9, 12, T10);
+    SET(c, d, a, b, 10, 17, T11);
+    SET(b, c, d, a, 11, 22, T12);
+    SET(a, b, c, d, 12,  7, T13);
+    SET(d, a, b, c, 13, 12, T14);
+    SET(c, d, a, b, 14, 17, T15);
+    SET(b, c, d, a, 15, 22, T16);
+#undef SET
+
+     /* Round 2. */
+     /* Let [abcd k s i] denote the operation
+          a = b + ((a + G(b,c,d) + X[k] + T[i]) <<< s). */
+#define G(x, y, z) (((x) & (z)) | ((y) & ~(z)))
+#define SET(a, b, c, d, k, s, Ti)\
+  t = a + G(b,c,d) + X[k] + Ti;\
+  a = ROTATE_LEFT(t, s) + b
+     /* Do the following 16 operations. */
+    SET(a, b, c, d,  1,  5, T17);
+    SET(d, a, b, c,  6,  9, T18);
+    SET(c, d, a, b, 11, 14, T19);
+    SET(b, c, d, a,  0, 20, T20);
+    SET(a, b, c, d,  5,  5, T21);
+    SET(d, a, b, c, 10,  9, T22);
+    SET(c, d, a, b, 15, 14, T23);
+    SET(b, c, d, a,  4, 20, T24);
+    SET(a, b, c, d,  9,  5, T25);
+    SET(d, a, b, c, 14,  9, T26);
+    SET(c, d, a, b,  3, 14, T27);
+    SET(b, c, d, a,  8, 20, T28);
+    SET(a, b, c, d, 13,  5, T29);
+    SET(d, a, b, c,  2,  9, T30);
+    SET(c, d, a, b,  7, 14, T31);
+    SET(b, c, d, a, 12, 20, T32);
+#undef SET
+
+     /* Round 3. */
+     /* Let [abcd k s t] denote the operation
+          a = b + ((a + H(b,c,d) + X[k] + T[i]) <<< s). */
+#define H(x, y, z) ((x) ^ (y) ^ (z))
+#define SET(a, b, c, d, k, s, Ti)\
+  t = a + H(b,c,d) + X[k] + Ti;\
+  a = ROTATE_LEFT(t, s) + b
+     /* Do the following 16 operations. */
+    SET(a, b, c, d,  5,  4, T33);
+    SET(d, a, b, c,  8, 11, T34);
+    SET(c, d, a, b, 11, 16, T35);
+    SET(b, c, d, a, 14, 23, T36);
+    SET(a, b, c, d,  1,  4, T37);
+    SET(d, a, b, c,  4, 11, T38);
+    SET(c, d, a, b,  7, 16, T39);
+    SET(b, c, d, a, 10, 23, T40);
+    SET(a, b, c, d, 13,  4, T41);
+    SET(d, a, b, c,  0, 11, T42);
+    SET(c, d, a, b,  3, 16, T43);
+    SET(b, c, d, a,  6, 23, T44);
+    SET(a, b, c, d,  9,  4, T45);
+    SET(d, a, b, c, 12, 11, T46);
+    SET(c, d, a, b, 15, 16, T47);
+    SET(b, c, d, a,  2, 23, T48);
+#undef SET
+
+     /* Round 4. */
+     /* Let [abcd k s t] denote the operation
+          a = b + ((a + I(b,c,d) + X[k] + T[i]) <<< s). */
+#define I(x, y, z) ((y) ^ ((x) | ~(z)))
+#define SET(a, b, c, d, k, s, Ti)\
+  t = a + I(b,c,d) + X[k] + Ti;\
+  a = ROTATE_LEFT(t, s) + b
+     /* Do the following 16 operations. */
+    SET(a, b, c, d,  0,  6, T49);
+    SET(d, a, b, c,  7, 10, T50);
+    SET(c, d, a, b, 14, 15, T51);
+    SET(b, c, d, a,  5, 21, T52);
+    SET(a, b, c, d, 12,  6, T53);
+    SET(d, a, b, c,  3, 10, T54);
+    SET(c, d, a, b, 10, 15, T55);
+    SET(b, c, d, a,  1, 21, T56);
+    SET(a, b, c, d,  8,  6, T57);
+    SET(d, a, b, c, 15, 10, T58);
+    SET(c, d, a, b,  6, 15, T59);
+    SET(b, c, d, a, 13, 21, T60);
+    SET(a, b, c, d,  4,  6, T61);
+    SET(d, a, b, c, 11, 10, T62);
+    SET(c, d, a, b,  2, 15, T63);
+    SET(b, c, d, a,  9, 21, T64);
+#undef SET
+
+     /* Then perform the following additions. (That is increment each
+        of the four registers by the value it had before this block
+        was started.) */
+    pms->abcd[0] += a;
+    pms->abcd[1] += b;
+    pms->abcd[2] += c;
+    pms->abcd[3] += d;
+}
+
+void
+md5_init(md5_state_t *pms)
+{
+    pms->count[0] = pms->count[1] = 0;
+    pms->abcd[0] = 0x67452301;
+    pms->abcd[1] = /*0xefcdab89*/ T_MASK ^ 0x10325476;
+    pms->abcd[2] = /*0x98badcfe*/ T_MASK ^ 0x67452301;
+    pms->abcd[3] = 0x10325476;
+}
+
+void
+md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes)
+{
+    const md5_byte_t *p = data;
+    int left = nbytes;
+    int offset = (pms->count[0] >> 3) & 63;
+    md5_word_t nbits = (md5_word_t)(nbytes << 3);
+
+    if (nbytes <= 0)
+       return;
+
+    /* Update the message length. */
+    pms->count[1] += nbytes >> 29;
+    pms->count[0] += nbits;
+    if (pms->count[0] < nbits)
+       pms->count[1]++;
+
+    /* Process an initial partial block. */
+    if (offset) {
+       int copy = (offset + nbytes > 64 ? 64 - offset : nbytes);
+
+       memcpy(pms->buf + offset, p, copy);
+       if (offset + copy < 64)
+           return;
+       p += copy;
+       left -= copy;
+       md5_process(pms, pms->buf);
+    }
+
+    /* Process full blocks. */
+    for (; left >= 64; p += 64, left -= 64)
+       md5_process(pms, p);
+
+    /* Process a final partial block. */
+    if (left)
+       memcpy(pms->buf, p, left);
+}
+
+void
+md5_finish(md5_state_t *pms, md5_byte_t digest[16])
+{
+    static const md5_byte_t pad[64] = {
+       0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+    };
+    md5_byte_t data[8];
+    int i;
+
+    /* Save the length before padding. */
+    for (i = 0; i < 8; ++i)
+       data[i] = (md5_byte_t)(pms->count[i >> 2] >> ((i & 3) << 3));
+    /* Pad to 56 bytes mod 64. */
+    md5_append(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1);
+    /* Append the length. */
+    md5_append(pms, data, 8);
+    for (i = 0; i < 16; ++i)
+       digest[i] = (md5_byte_t)(pms->abcd[i >> 2] >> ((i & 3) << 3));
+}
diff --git a/casper-md5check/md5.h b/casper-md5check/md5.h
new file mode 100644 (file)
index 0000000..698c995
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+  Copyright (C) 1999, 2002 Aladdin Enterprises.  All rights reserved.
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+
+  L. Peter Deutsch
+  ghost@aladdin.com
+
+ */
+/* $Id: md5.h,v 1.4 2002/04/13 19:20:28 lpd Exp $ */
+/*
+  Independent implementation of MD5 (RFC 1321).
+
+  This code implements the MD5 Algorithm defined in RFC 1321, whose
+  text is available at
+       http://www.ietf.org/rfc/rfc1321.txt
+  The code is derived from the text of the RFC, including the test suite
+  (section A.5) but excluding the rest of Appendix A.  It does not include
+  any code or documentation that is identified in the RFC as being
+  copyrighted.
+
+  The original and principal author of md5.h is L. Peter Deutsch
+  <ghost@aladdin.com>.  Other authors are noted in the change history
+  that follows (in reverse chronological order):
+
+  2002-04-13 lpd Removed support for non-ANSI compilers; removed
+       references to Ghostscript; clarified derivation from RFC 1321;
+       now handles byte order either statically or dynamically.
+  1999-11-04 lpd Edited comments slightly for automatic TOC extraction.
+  1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5);
+       added conditionalization for C++ compilation from Martin
+       Purschke <purschke@bnl.gov>.
+  1999-05-03 lpd Original version.
+ */
+
+#ifndef md5_INCLUDED
+#  define md5_INCLUDED
+
+/*
+ * This package supports both compile-time and run-time determination of CPU
+ * byte order.  If ARCH_IS_BIG_ENDIAN is defined as 0, the code will be
+ * compiled to run only on little-endian CPUs; if ARCH_IS_BIG_ENDIAN is
+ * defined as non-zero, the code will be compiled to run only on big-endian
+ * CPUs; if ARCH_IS_BIG_ENDIAN is not defined, the code will be compiled to
+ * run on either big- or little-endian CPUs, but will run slightly less
+ * efficiently on either one than if ARCH_IS_BIG_ENDIAN is defined.
+ */
+
+typedef unsigned char md5_byte_t; /* 8-bit byte */
+typedef unsigned int md5_word_t; /* 32-bit word */
+
+/* Define the state of the MD5 Algorithm. */
+typedef struct md5_state_s {
+    md5_word_t count[2];       /* message length in bits, lsw first */
+    md5_word_t abcd[4];                /* digest buffer */
+    md5_byte_t buf[64];                /* accumulate block */
+} md5_state_t;
+
+#ifdef __cplusplus
+extern "C" 
+{
+#endif
+
+/* Initialize the algorithm. */
+void md5_init(md5_state_t *pms);
+
+/* Append a string to the message. */
+void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes);
+
+/* Finish the message and return the digest. */
+void md5_finish(md5_state_t *pms, md5_byte_t digest[16]);
+
+#ifdef __cplusplus
+}  /* end extern "C" */
+#endif
+
+#endif /* md5_INCLUDED */
diff --git a/casper.conf b/casper.conf
new file mode 100644 (file)
index 0000000..c6967f9
--- /dev/null
@@ -0,0 +1,9 @@
+# This file should go in 
+#  conf/conf.d/
+# Supported variables are:
+# USERNAME, USERFULLNAME, HOST
+
+export USERNAME="debian"
+export USERFULLNAME="Debian Live user"
+export HOST="debian"
+
diff --git a/caspermon/GNOME_PythonAppletCasper.server b/caspermon/GNOME_PythonAppletCasper.server
new file mode 100644 (file)
index 0000000..34caa04
--- /dev/null
@@ -0,0 +1,30 @@
+<oaf_info>
+
+<oaf_server iid="OAFIID:GNOME_PythonAppletCasper_Factory"
+            type="exe"
+            location="/usr/share/casper-applet/casper-applet.py">
+
+        <oaf_attribute name="repo_ids" type="stringv">
+                <item value="IDL:Bonobo/GenericFactory:1.0"/>
+                <item value="IDL:Bonobo/Unknown:1.0"/>
+        </oaf_attribute>
+        <oaf_attribute name="name" type="string" value="PythonAppletCasper"/>
+        <oaf_attribute name="description" type="string" value="Python Applet CAsper"/>
+</oaf_server>
+
+<oaf_server iid="OAFIID:GNOME_PythonAppletCasper"
+            type="factory" 
+            location="OAFIID:GNOME_PythonAppletCasper_Factory">
+
+        <oaf_attribute name="repo_ids" type="stringv">
+                <item value="IDL:GNOME/Vertigo/PanelAppletShell:1.0"/>
+                <item value="IDL:Bonobo/Control:1.0"/>
+                <item value="IDL:Bonobo/Unknown:1.0"/>
+        </oaf_attribute>
+        <oaf_attribute name="name" type="string" value="PythonAppletCasper"/>
+        <oaf_attribute name="description" type="string" value="Python Applet Casper"/>
+        <oaf_attribute name="panel:category" type="string" value="Utility"/>
+        <oaf_attribute name="panel:icon" type="string" value="bug-buddy.png"/>
+</oaf_server>
+
+</oaf_info>
diff --git a/caspermon/caspermon-applet b/caspermon/caspermon-applet
new file mode 100755 (executable)
index 0000000..773e0a4
--- /dev/null
@@ -0,0 +1,75 @@
+#!/usr/bin/python
+
+import pygtk
+pygtk.require('2.0')
+
+import gtk
+import gnome.applet
+import subprocess
+import os
+
+# A simple applet to display the utilization of the snapshot device
+# during a casper session
+#
+# Matt Zimmerman <mdz@canonical.com>
+
+# TODO:
+# - tooltip with details
+# - flash at threshold
+
+class CasperApplet:
+    def __init__(self, applet, iid):
+        self.timeout_interval = 1000
+        self.device = 'casper-snapshot'
+        self.capacity = [0,0]
+        self.datafile = '/var/lib/casper/snapshot-status'
+        
+        # initializate the gnome internals
+        gnome.init("casper", "0.1")
+
+        self.applet = applet
+
+        self.tooltips = gtk.Tooltips()
+        self.hbox = gtk.HBox()
+        applet.add(self.hbox)
+
+        # add the second button event for the popup menu and the enter mouse event to change the tooltip value
+        self.ev_box = gtk.EventBox()
+        #self.ev_box.connect("button-press-event",self.button_press)
+        self.ev_box.connect("enter-notify-event", self.update_info)
+        self.hbox.add(self.ev_box)
+
+        self.prog = gtk.ProgressBar()
+        self.ev_box.add(self.prog)
+
+        self.update_info()
+        
+        gtk.timeout_add(self.timeout_interval,self.update_info, self)
+
+        applet.connect("destroy",self.cleanup)
+        applet.show_all()
+      
+    def update_info(self, event=None):
+        self.capacity = self.read_info()
+        self.prog.set_fraction(float(self.capacity[0]) / self.capacity[1])
+        self.prog.update()
+
+    def read_info(self):
+        fields = open(self.datafile).readline().split()
+        if fields[2] != 'snapshot':
+            return None
+
+        return map(int,fields[3].split('/', 1))
+
+    def cleanup(self):
+        # what goes here?
+        pass
+
+def casper_factory(applet, iid):
+    CasperApplet(applet, iid)
+
+    return gtk.TRUE
+
+gnome.applet.bonobo_factory("OAFIID:GNOME_PythonAppletCasper_Factory", 
+                             gnome.applet.Applet.__gtype__, 
+                             "casper", "0", casper_factory)
diff --git a/caspermon/caspermond b/caspermon/caspermond
new file mode 100644 (file)
index 0000000..e126447
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+STATEFILE=/var/run/caspermond/status.casper-snapshot
+
+while true; do
+    dmsetup status /dev/mapper/casper-snapshot > $STATEFILE.new
+    mv $STATEFILE.new $STATEFILE
+    sleep 60
+done
diff --git a/debian/casper.dirs b/debian/casper.dirs
new file mode 100644 (file)
index 0000000..276a2b3
--- /dev/null
@@ -0,0 +1,3 @@
+/usr/lib/casper
+/usr/share/initramfs-tools/hooks
+/usr/share/initramfs-tools/scripts
diff --git a/debian/casper.init b/debian/casper.init
new file mode 100755 (executable)
index 0000000..797d230
--- /dev/null
@@ -0,0 +1,40 @@
+#! /bin/sh
+
+grep -qs boot=casper /proc/cmdline || exit 0
+
+# Try to cache everything we're likely to need after ejecting. This
+# is fragile and simple-minded, but our options are limited.
+cache_path() {
+    path="$1"
+
+    if [ -d "$path" ]; then
+        find "$path" -type f | xargs cat > /dev/null 2>&1
+    elif [ -f "$path" ]; then
+        if [ -x "$path" ]; then
+            if file "$path" | grep -q 'dynamically linked'; then
+                for lib in $(ldd "$path" | awk '{ print $3 }'); do
+                    cache_path "$lib"
+                done
+            fi
+        fi
+        cat "$path" >/dev/null 2>&1
+    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 -n "Please remove the disc (if any), close the tray (if any) and 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)"
+    /sbin/usplash_write "TEXT and press ENTER to continue"
+fi
+
+read x < /dev/console
+
+exit 0
diff --git a/debian/casper.install b/debian/casper.install
new file mode 100644 (file)
index 0000000..28a4469
--- /dev/null
@@ -0,0 +1,4 @@
+bin/casper-reconfigure usr/share/casper
+bin/casper-preseed     usr/share/casper
+hooks                  usr/share/initramfs-tools
+scripts                        usr/share/initramfs-tools
diff --git a/debian/casper.lintian b/debian/casper.lintian
new file mode 100644 (file)
index 0000000..e7fdc6a
--- /dev/null
@@ -0,0 +1 @@
+casper: init.d-script-does-not-implement-required-option
diff --git a/debian/casper.postinst b/debian/casper.postinst
new file mode 100644 (file)
index 0000000..d7bc14d
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+update-initramfs -u
+
+#DEBHELPER#
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..f2182d6
--- /dev/null
@@ -0,0 +1,31 @@
+casper (1.59+debian-1) unstable; urgency=low
+
+  [ Daniel Baumann ]
+  * Upload to unstable (Closes: #354539).
+
+  [ Marco Amadori ]
+  * Added possibility to set locale on chroot, not only at runtime.
+  * Removed "persistent" wait.
+  * Fixed persistence lock and added "homepersistence" boot parameter.
+  * Updated locales handling to latest debian policy.
+  * Cleanups
+
+ -- Daniel Baumann <daniel@debian.org>  Thu, 22 Jun 2006 06:21:00 +0200
+
+casper (1.59+debian-0) UNRELEASED; urgency=low
+
+  * Added "toram" boot parameter.
+  * Extendend fs support to ext2 and xfs file image.
+  * Changed debian-inexistant "-Q" modprobe option with "-q".
+  * Removed ubiquity code.
+  * USERNAME and HOST defaulted to "debian".
+  * Preliminary netboot (cifs) patch by  
+    "Jason D. Clinton" <me@jasonclinton.com>
+  * Lowered dependence of dmsetup code (now only Suggests).
+  * Checks for replacing "udevplug" (ubuntu-only) with "udevtrigger".
+  * Reworked xorg and anacron patches from  
+    Frederic Lehobey <Frederic.Lehobey@free.fr>.
+  * scripts/casper-bottom/10adduser: configuring only the $USERNAME for sudo
+      instead of group 'admin'.
+
+ -- Marco Amadori <marco.amadori@gmail.com>  Fri, 16 Jun 2006 11:01:48 +0200
diff --git a/debian/changelog.upstream b/debian/changelog.upstream
new file mode 100644 (file)
index 0000000..c27fcbe
--- /dev/null
@@ -0,0 +1,1079 @@
+casper (1.59) UNRELEASED; urgency=low
+
+  * Change start symlinks to kill symlinks for anacron, to avoid it being
+    started by invoke-rc.d and similar.
+  * Rearrange source package.
+  * Redo how the init script works and require it to be installed in the
+    live fs.
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Wed, 31 May 2006 00:01:40 +0200
+
+casper (1.58) dapper; urgency=low
+
+  * Really rename properly, without dirname.
+
+ -- Scott James Remnant <scott@ubuntu.com>  Tue, 30 May 2006 22:47:04 +0100
+
+casper (1.57) dapper; urgency=low
+
+  * Rename the anacron rc.d/S* symlinks to K*, instead of removing them.
+    Because otherwise pbbuttonsd decides that starting anacron on the
+    LiveCD would be a clever thing to do.
+
+ -- Scott James Remnant <scott@ubuntu.com>  Wed, 24 May 2006 23:06:04 +0100
+
+casper (1.56) dapper; urgency=low
+
+  * Hopefully work a bit better when checking DVDs on 32 bit
+    architectures.
+  * Do an explicit read from /dev/console when waiting for keypress after
+    CD/DVD has been ejected.
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Mon, 22 May 2006 16:43:03 +0200
+
+casper (1.55) dapper; urgency=low
+
+  * Reconfigure gnome-power-manager when doing live installations.
+    Malone #45654
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Mon, 22 May 2006 11:16:46 +0200
+
+casper (1.54) dapper; urgency=low
+
+  [ Luke Yelavich ]
+  * Set large print fonts for the v1 accessibility profile. Closes 
+    Malone #45376. 
+
+  [ Colin Watson ]
+  * Fix preseed/file handling (closes: Malone #43683).
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Thu, 18 May 2006 19:36:24 +0200
+
+casper (1.53) dapper; urgency=low
+
+  [ Tollef Fog Heen ]
+  * Disable fglrx and nvidida drivers by default.  Somewhat addresses
+    #43706
+
+  [ Colin Watson ]
+  * Pass all command-line preseed arguments (other than preseed/file) to
+    /root's debconf db.
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Sat, 13 May 2006 10:14:36 +0200
+
+casper (1.52) dapper; urgency=low
+
+  * Export the path in casper-reconfigure so X and friends actually have
+    sbin in their path.
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Thu, 11 May 2006 21:04:11 +0200
+
+casper (1.51) dapper; urgency=low
+
+  [ Luke Yelavich ]
+  * casper-bottom/30accessibility:
+    - Removed stale reference to acessx_applet.
+    - Fix some typos for gconf values that had to be set as lists.
+
+  [ Colin Watson ]
+  * Pass debian-installer/locale to /root's debconf db (closes: Malone
+    #41896).
+  * Identify ourselves as casper when communicating with debconf.
+  * Factor out preseeding code into casper-preseed; this knows that it only
+    needs to register a question if it fails to set it, which saves memory
+    by avoiding debconf having to rewrite templates.dat.
+  * Preseed kbd-chooser/method as well as debian-installer/keymap, so that
+    kbd-chooser run from ubiquity picks up the selected keyboard (closes:
+    Malone #42202).
+  * Use new dpkg-reconfigure --no-reload option (debconf 1.4.72ubuntu6) to
+    avoid needlessly rewriting templates.dat.
+  
+  [ Tollef Fog Heen ]
+  * Add ... to the end of all usplash messages.  Malone #43856
+  * Add maybe_break casper-bottom to allow breaking before running bottom
+    scripts.  Malone #43860
+  * Don't show the name of the live cd user that's added.
+  * Mount COW filesystem if show-cow is present on the kernel command line.
+    Malone #43687
+  * Disable the Kubuntu update notifier too.  Malone #43806
+  * Disable hibernation and enable sleep where appropriate.  Malone #23882
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Thu, 11 May 2006 12:11:08 +0200
+
+casper (1.50) dapper; urgency=low
+
+  [ Luke Yelavich ]
+  * Fixed some typos, and added missing settings to some accessibility
+    profiles, as they were either not working properly, or at all. Malone:
+    #39472, #39473
+  * Removed the desktop wallpaper, and changed the background colour to gray
+    for the v1 accessibility profile.
+  * Set the whiteglass mouse theme for the v1 accessibility profile.
+  * Moved the gconftool-2 -s flag to individual gct calls, to allow for future
+    use of gconftool-2 flags that are incompatible with -s.
+  
+  [ Daniele Favara ]
+  * Allow custom HOST, USERNAME, USERFULLNAME.  Malone: #42118
+  * Add example file
+    - debian/casper.dir: Add examples dir 
+    - debian/casper.conf: Explain briefly how to use new variables 
+    - debian/rules: Install casper.conf as example_conf_casper
+  
+  [ Tollef Fog Heen ]
+  * Stylistic changes to Daniele's changes.
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Tue,  2 May 2006 14:12:31 +0200
+
+casper (1.49) dapper; urgency=low
+
+  * Also look for hardware named wlan*
+
+ -- Scott James Remnant <scott@ubuntu.com>  Wed, 26 Apr 2006 13:37:13 +0100
+
+casper (1.48) dapper; urgency=low
+
+  * Write /etc/network/interfaces entries for eth0, eth1, eth2, ath0 and
+    wlan0 if there's no hardware detected for them; as it may be plugged
+    in after boot.
+
+ -- Scott James Remnant <scott@ubuntu.com>  Wed, 26 Apr 2006 12:31:38 +0100
+
+casper (1.47) dapper; urgency=low
+
+  [ Tollef Fog Heen ]
+  * Turn on debugging of the X config.
+  * Log to a file which gets copied to /var/log/casper.log.  Malone: #39895
+  * Only pick UTF-8 locales.  Malone: #40178
+  * Use correct /root rather than /target for seeing what version of
+    gnome-panel-data is installed.
+  * Make festival (and probably some other apps) happier by using
+    127.0.1.1 for our ubuntu hostname and 127.0.0.1 just resolves to
+    "localhost".
+  * Make casper-md5check read from tty8 since it wants to get keypresses
+    from the active console (where usplash runs).  Malone: #40490.
+  * Copy /etc/modules when installing with ubiquity.  Malone: #40311
+  * /etc/gdm/gdm-cdd.conf can be a symlink.  Cope with that.  Malone: #40767  
+
+  [ Colin Watson ]
+  * ubiquity-casper conflicts/replaces espresso-casper.
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Mon, 24 Apr 2006 09:41:14 +0200
+
+casper (1.46) dapper; urgency=low
+
+  * Use debian-installer/dummy for preseeding rather than espresso/dummy,
+    since the latter was removed in espresso 0.99.38.
+  * espresso is being renamed to ubiquity. Rename espresso-casper to
+    ubiquity-casper to match.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Fri, 21 Apr 2006 12:52:48 +0100
+
+casper (1.45) dapper; urgency=low
+
+  [ Matt Zimmerman ]
+  * [share/shutdown] Disable the usplash timeout and wrap the prompt to two
+    lines
+
+  [ Tollef Fog Heen ]
+  * Use devmapper for ia64, hppa and sparc.
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Wed, 19 Apr 2006 11:36:49 +0200
+
+casper (1.44) dapper; urgency=low
+
+  * Reset the timeout after casper-premount has run so we're sure that the
+    timeout is what we want it to be.  Udev seems to change it too.
+  * Remove a few set -x commands to make the boot slightly less verbose.
+  * Fix 10adduser to actually install the correct icons for espresso.
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Wed, 12 Apr 2006 14:20:53 +0200
+
+casper (1.43) dapper; urgency=low
+
+  * Copy espresso-kdeui.desktop file to user's desktop 
+    Branch at http://kubuntu.org/~jriddell/bzr/casper/trunk/
+
+ -- Jonathan Riddell <jriddell@ubuntu.com>  Thu, 13 Apr 2006 15:37:49 +0100
+
+casper (1.42) dapper; urgency=low
+
+  [ Luke Yelavich ]
+  * casper-bottom/30accessibility:
+    - Removed some settings from accessibility profiles as these are now
+      in the relevant packages.
+
+  [ Tollef Fog Heen ]
+  * Make sure to call gconftool as the right user.  Malone #38408
+  * Write an entry for / in fstab.  Hopefully fixes Malone #34330
+  * Change gdm-cdd.conf if it exists, not gdm.conf. Malone #37467
+  * Really disable update-notifier, this time by removing the correct
+    file.
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Tue, 11 Apr 2006 15:43:24 +0200
+
+casper (1.41) dapper; urgency=low
+
+  * Don't mkdir then install -D, just install -D (this should prevent
+    ~ubuntu/Desktop being owned by root)
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Wed, 29 Mar 2006 10:52:42 +0200
+
+casper (1.40) dapper; urgency=low
+
+  * Add snd_powermac to /etc/modules on ppc.  (Malone: #27862)
+  * Use chmod -x instead of mv to disable readahead in order to not
+    trigger unionfs bugs
+  * Reboot the system when a key is pressed at the end of the integrity
+    check.  (Malone: #29203)
+  * Use usplash_write too when doing shutdown.  (Malone: #34537)
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Tue, 28 Mar 2006 10:09:49 +0200
+
+casper (1.39) dapper; urgency=low
+
+  [ Tollef Fog Heen ]
+  * Disable update-notifier by default, as it won't make much sense for
+    most people.
+
+  [ Colin Watson ]
+  * Clear out user-setup questions from the debconf database after creating
+    the live CD user, to avoid confusing espresso into offering "Ubuntu
+    LiveCD user" as the user's default full name.
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Mon, 13 Mar 2006 11:38:39 +0100
+
+casper (1.38) dapper; urgency=low
+
+  * Disable readahead since it breaks too much with squashfs and unionfs.
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Thu,  9 Mar 2006 09:43:39 +0100
+
+casper (1.37) dapper; urgency=low
+
+  * Add support for having the squashfs directly on a device, thanks to
+    Paul Sladen for idea and a patch.
+  * If a directory "Examples" exists in ~ after we've run adduser, move it
+    to the Desktop subdirectory for greater visibility.
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Sat,  4 Mar 2006 11:55:50 +0100
+
+casper (1.36) dapper; urgency=low
+
+  [ Tollef Fog Heen ]
+  * Fix typo in find_cow_device so block devices didn't work at all.
+    Malone #31639.  Thanks to Richard Nemec for the catch.
+  * Update accessibility framework, thanks to Luke Yelavich.
+
+  [ Colin Watson ]
+  * Move the /cdrom mount into the new root filesystem.
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Wed,  1 Mar 2006 11:13:54 +0100
+
+casper (1.35) dapper; urgency=low
+
+  * Check for preseed/file= in /proc/cmdline and feed any given file to
+    debconf-set-selections.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Mon, 27 Feb 2006 17:32:02 +0000
+
+casper (1.34) dapper; urgency=low
+
+  [ Luke Yelavich ]
+  * Add initial accessibility support framework
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Wed, 22 Feb 2006 14:36:07 +0100
+
+casper (1.33) dapper; urgency=low
+
+  * Make sure Desktop and the espresso-$ui.desktop is owned by the Ubuntu
+    user.  Malone #31991
+  * Fix check for rc6.d/S90reboot at the bottom of 25configure_init to
+    actually look in the right place.
+  * Make me the maintainer of the package.
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Mon, 20 Feb 2006 09:49:02 +0100
+
+casper (1.32) dapper; urgency=low
+
+  * Fix copying of /usr/share/applications/espresso-gtkui.desktop.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Thu, 16 Feb 2006 16:47:15 +0000
+
+casper (1.31) dapper; urgency=low
+
+  [ Tollef Fog Heen ]
+  * Print message about rebooting the system when the md5 check is
+    finished.
+  * Just have one copy of the casper shutdown scripts and symlink those
+    into the right place.  Malone #20978
+
+  [ Colin Watson ]
+  * Copy /usr/share/applications/espresso-gtkui.desktop to the live CD
+    user's desktop.
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Tue, 14 Feb 2006 14:52:16 +0100
+
+casper (1.30) dapper; urgency=low
+
+  * Set a blank password for the ubuntu user.  This hopefully resolves
+    Malone #30118
+  * Pass keyboard layout information to xserver-xorg in the "new" scheme.
+  * Set up the right console keymap.
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Tue, 14 Feb 2006 14:48:14 +0100
+
+casper (1.29) dapper; urgency=low
+    
+  [ Tollef Fog Heen ]
+  * Fix typo in 22gnome_panel_data
+  * Configure all detected network interfaces.
+  * Add support for putting the persistent storage in a loopback file on
+    vfat volumes
+  * Configure all detected network interfaces.
+  * Allow putting the live filesystem image on a VFAT volume
+  * Allow putting the persistent storage in a loopback file on a VFAT
+    volume
+  * Lots of cleanups
+
+  [ Colin Watson ]
+  * Change casper-reconfigure to take the target root filesystem as its
+    first argument.
+  * Add espresso-casper package with hooks to repeat some things done by
+    casper in the installed system.
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Wed, 25 Jan 2006 14:25:45 +0100
+
+casper (1.28) dapper; urgency=low
+
+  * Depend on user-setup
+  * First shot at IEEE1394 support.  Add sbp2 and ohci1394 as modules to
+    be copied into the initramfs.
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Mon, 16 Jan 2006 22:06:35 +0100
+
+casper (1.27) dapper; urgency=low
+
+  * Try using unionfs on ppc again 
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Tue, 10 Jan 2006 20:55:19 +0100
+
+casper (1.26) dapper; urgency=low
+
+  * Add persistency support
+  * Usplash integration
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Tue, 10 Jan 2006 17:53:54 +0100
+
+casper (1.25) dapper; urgency=low
+
+  * Make /rofs available to in the target system. 
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Mon,  9 Jan 2006 15:25:12 +0100
+
+casper (1.24) dapper; urgency=low
+
+  * For debconf-communicate, use a here-doc rather than trying to have \n
+    working in shell variables.
+  * The usplash fifo has moved, update paths accordingly.  Also conflict
+    with the old usplash and depend on new enough initramfs-tools.
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Fri,  6 Jan 2006 14:20:37 +0100
+
+casper (1.23) dapper; urgency=low
+
+  * Move the building to binary-dep, since we're an arch: any package
+    now.
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Thu,  5 Jan 2006 10:37:31 +0100
+
+casper (1.22) dapper; urgency=low
+
+  * Bunch debconf-communicate commands together to speed up the boot a
+    little bit.
+  * Add integrity checker, this is compiled code, so casper is now arch:
+    any
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Wed,  4 Jan 2006 12:56:13 +0100
+
+casper (1.21) dapper; urgency=low
+
+  * If locale is unset, use en_US.UTF8, not whatever comes first in the
+    list of supported locales.
+  * Generate locale and set the locale in /etc/environment
+  * Use user-setup to create the user, rather than doing it ourselves.
+  * Various cleanups and fixes, such as making debconf-communicate silent
+  * Disable checkroot when booting
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Mon,  2 Jan 2006 11:00:25 +0100
+
+casper (1.20) dapper; urgency=low
+
+  * Remove a large bunch of debugging output
+  * Depend on dmsetup so the hook script can copy in that
+  * Handle both squashfs and cloop images, with run-time detection
+  * Use devmapper + cloop on powerpc, not unionfs, since unionfs is a
+    disaster there.
+  * Make sure we have both SCSI and IDE CDROM modules available in the
+    initramfs.
+  * Do some initial keyboard setup handling so X will, at least in some
+    cases, have a chance of giving the user a sane keymap.
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Mon, 19 Dec 2005 14:23:13 +0100
+
+casper (1.19) dapper; urgency=low
+
+  * Switch to initramfs, so casper only survives in spirit
+  * Use unionfs instead of a writeable devmapper snapshot
+  * Remove all debconfiscation, since we're an initramfs script now
+  * Make the postinst call update-initramfs -u
+  * Mount the CD read-only explicitly
+  * Make udevinfo silent if the device is not found.
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Tue, 13 Dec 2005 16:22:45 +0100
+
+casper (1.18) breezy; urgency=low
+
+  * Update translations from Rosetta: Greek, Spanish, French, Hungarian,
+    Brazilian Portuguese.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Mon, 19 Sep 2005 20:05:02 +0100
+
+casper (1.17) breezy; urgency=low
+
+  * Set /apps/gnome-screensaver/lock if gnome-screensaver is installed
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Fri, 16 Sep 2005 15:24:35 -0700
+
+casper (1.16) breezy; urgency=low
+
+  * Install a fake script in /lib/debian-installer.d/S72menu-exit after
+    pivoting that just calls sleep, to prevent scary console messages as d-i
+    tries to exit without its root filesystem.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Wed, 14 Sep 2005 10:28:06 +0100
+
+casper (1.15) breezy; urgency=low
+
+  * Neutralize branding in startup message
+  * Use clear in addition to reset, in hopes of concealing error messages on
+    the console from d-i's death throes
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Fri,  9 Sep 2005 11:24:14 -0700
+
+casper (1.14) breezy; urgency=low
+
+  * Set RUNNING_UNDER_GDM=yes in the user's environment to stop xscreensaver
+    locking the screen (Ubuntu #7150).
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Thu,  8 Sep 2005 13:37:00 +0100
+
+casper (1.13) breezy; urgency=low
+
+  * Use reset, rather than clear, to clean up after the colored dialogs on vt1
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Wed,  7 Sep 2005 16:09:45 -0700
+
+casper (1.12) breezy; urgency=low
+
+  * Kill bterm after pivoting so that we can use vt1 rather than vt2,
+    thereby avoiding a fight between gdm and the X server (closes: Ubuntu
+    #14851).
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Wed,  7 Sep 2005 15:48:40 +0100
+
+casper (1.11) breezy; urgency=low
+
+  * Remove debugging code which crept into 1.10
+  * Revert changes to casper-udeb.postinst which were intended for
+    starting usplash earlier (pre-1.10)
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Fri,  2 Sep 2005 13:43:03 -0700
+
+casper (1.10) breezy; urgency=low
+
+  * Instead of starting usplash directly, create an init script which will
+    start it later (after the new init), to avoid it being killed by
+    busybox init
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Mon, 29 Aug 2005 20:26:58 -0700
+
+casper (1.9) breezy; urgency=low
+
+  * Remember to re-run 30copy-dev from 94usplash, in order to preserve the
+    device nodes clobbered by udev
+  * Redirect stdin of /etc/init.d/udev from /dev/console, to avoid
+    incredibly obnoxious 60-second sleep because it thinks we're
+    interactive
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Mon, 29 Aug 2005 18:30:38 -0700
+
+casper (1.8) breezy; urgency=low
+
+  * Add usplash support
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Mon, 29 Aug 2005 17:30:57 -0700
+
+casper (1.7) breezy; urgency=low
+
+  * Set DEBUG_XORG_PACKAGE=yes when reconfiguring xserver-xorg.  The
+    output is only written to post.log and isn't visible to the user, and
+    can be invaluable for debugging
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Mon, 22 Aug 2005 10:25:38 -0700
+
+casper (1.6) breezy; urgency=low
+
+  * Use debconf-copydb again (thanks, Tollef)
+  * Rename pre.d/20xconfig to pre.d/20prexconfig so that it is distinct from
+    post.d/20xconfig for purposes of the progress bar (no text for it; it's
+    very fast)
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Wed, 17 Aug 2005 14:55:24 -0700
+
+casper (1.5) breezy; urgency=low
+
+  * Call MAKEDEV console in post.d/20xconfig as a workaround for bug
+    #13523
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Tue, 16 Aug 2005 15:24:06 -0700
+
+casper (1.4) breezy; urgency=low
+
+  * Revert to the old debconf hack; the debconf-copydb approach needs more
+    work
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Mon, 15 Aug 2005 22:48:11 -0700
+
+casper (1.3) breezy; urgency=low
+
+  * Revert unintentional release of experimental unionfs code in 1.2
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Sat, 13 Aug 2005 11:19:50 -0700
+
+casper (1.2) breezy; urgency=low
+
+  * Fix debconf-copydb regex in 20xconfig
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Sat, 13 Aug 2005 11:07:46 -0700
+
+casper (1.1) breezy; urgency=low
+
+  * Cope with xserver-xorg's rename of force_keyboard_detection to
+    autodetect_keyboard
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Mon,  4 Jul 2005 02:52:07 -0700
+
+casper (1.0) breezy; urgency=low
+
+  * Version number bump (we've been through a stable Ubuntu release, after
+    all)
+  * Rename pre.d/10snapshot to post.d/10filesystem, as it is about to
+    become more generic
+  * Seed xserver-xorg/force_keyboard_detection to true in 20xconfig, so as
+    to cause the keyboard layout to (continue to) be autodetected based on
+    d-i settings
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Thu, 16 Jun 2005 11:21:54 -0700
+
+casper (0.65) breezy; urgency=low
+
+  * As a performance optimization, only reconfigure gnome-panel-data if
+    booting on a laptop
+  * Disable the "lock screen" menu item (Ubuntu bug#7150)
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Wed,  8 Jun 2005 16:02:14 -0700
+
+casper (0.64) breezy; urgency=low
+
+  * Merge colin.watson@canonical.com--2005/casper--debconf-copydb--0
+    - Use debconf-copydb rather than our temporary hack
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Tue, 31 May 2005 12:08:51 -0700
+
+casper (0.63) breezy; urgency=low
+
+  * Merge colin.watson@canonical.com--2005/casper--cdebconf-info--0
+    - Update for cdebconf 0.75: use db_info rather than db_x_setbacktitle.
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Mon, 18 Apr 2005 20:59:58 -0700
+
+casper (0.62) hoary; urgency=low
+
+  * Updated translations from
+    colin.watson@canonical.com--2005/casper--translations--0 (nb)
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Tue,  5 Apr 2005 09:01:02 -0700
+
+casper (0.61) hoary; urgency=low
+
+  * Updated translations from
+    colin.watson@canonical.com--2005/casper--translations--0 (el, es, ro)
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Tue,  5 Apr 2005 08:06:51 -0700
+
+casper (0.60) hoary; urgency=low
+
+  * Updated translations from
+    colin.watson@canonical.com--2005/casper--translations--0 (hu, id, pl)
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Mon, 28 Mar 2005 11:26:21 -0800
+
+casper (0.59) hoary; urgency=low
+
+  * Updated translations from
+    colin.watson@canonical.com--2005/casper--translations--0 (de, pt_BR)
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Fri, 25 Mar 2005 16:51:17 -0800
+
+casper (0.58) hoary; urgency=low
+
+  * Remove postfix shutdown links, as well as startup, to avoid an ugly error
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Thu, 24 Mar 2005 18:24:03 -0800
+
+casper (0.57) hoary; urgency=low
+
+  * Merge colin.watson@canonical.com--2005/casper--translations--0 up to
+    patch-2
+  * Preseed netcfg/wireless_essid_again for noninteractive network setup, +new
+    in netcfg 1.08ubuntu3 [colin.watson@canonical.com--2005/casper--netcfg--0]
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Wed, 23 Mar 2005 08:33:46 -0800
+
+casper (0.56) hoary; urgency=low
+
+  * Suppress error output from eject
+  * Remind the user to close the CD tray if they have one (Ubuntu #6668)
+  * Add arch-build target to debian/rules
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Tue, 22 Mar 2005 10:21:41 -0800
+
+casper (0.55) hoary; urgency=low
+
+  * Remove the hack introduced in 0.54, xorg 6.8.2-5 should be fixed
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Wed, 16 Mar 2005 18:11:05 -0800
+
+casper (0.54) hoary; urgency=low
+
+  * Temporarily set RECONFIGURE=true when reconfiguring xserver-xorg, to work
+    around a bug introduced in 6.8.2-3
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Wed, 16 Mar 2005 15:08:45 -0800
+
+casper (0.53) hoary; urgency=low
+
+  * Provide target-base-system (i.e. base system installed in /target, also
+    provided by base-installer).
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Tue, 15 Mar 2005 13:01:53 +0000
+
+casper (0.52) hoary; urgency=low
+
+  * Arrange for $LANG to be set after pivot_root, so that (e.g.)
+    xserver-xorg can use it to infer the keymap (Ubuntu #7138)
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Sat, 12 Mar 2005 02:10:59 -0800
+
+casper (0.51) hoary; urgency=low
+
+  * Disable kpersonalizer startup on first login
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Sat,  5 Mar 2005 13:47:13 -0800
+
+casper (0.50) hoary; urgency=low
+
+  * Add support for configuring kdm autologin
+  * Rename 15gdm-autologin to 15autologin, and the corresponding debconf template
+  * Remove obsolete XORG_FORCE_PROBE from 20xconfig
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Thu,  3 Mar 2005 10:37:31 -0800
+
+casper (0.49) hoary; urgency=low
+
+  * Fix 20xconfig harder
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Wed,  2 Mar 2005 21:20:03 -0800
+
+casper (0.48) hoary; urgency=low
+
+  * Source confmodule in 20xconfig
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Wed,  2 Mar 2005 21:02:35 -0800
+
+casper (0.47) hoary; urgency=low
+
+  * Copy over the value of debian-installer/keymap into the target system,
+    to allow the new logic in xserver-xorg.config to work
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Wed,  2 Mar 2005 20:45:38 -0800
+
+casper (0.46) hoary; urgency=low
+
+  * Lock the live user's password entirely.  Since the user is now
+    automagically logged in, continuously, both on the console and in X,
+    their password is irrelevant.
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Mon, 28 Feb 2005 08:31:13 -0800
+
+casper (0.45) hoary; urgency=low
+
+  * Enable TimedLogin in gdm, so that if the user logs out, they are
+    automatically logged back in after a few seconds (Ubuntu #6667)
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Sun, 27 Feb 2005 16:06:16 -0800
+
+casper (0.44) hoary; urgency=low
+
+  * Configure init to spawn shells on virtual consoles, rather than login
+    prompts (Ubuntu #6666)
+  * Skip X configuration if a serial console is in use
+  * Set the live user's password to be blank, rather than "ubuntu".  This
+    is, paradoxically, more secure if the user decides to install
+    openssh-server, since empty passwords are disallowed by default
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Sun, 27 Feb 2005 15:40:15 -0800
+
+casper (0.43) hoary; urgency=low
+
+  * Override localechooser progress bar text to be more appropriate for the
+    live CD (closes: Ubuntu #6664).
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Thu, 24 Feb 2005 19:12:00 +0000
+
+casper (0.42) hoary; urgency=low
+
+  * Preseed netcfg/no_interfaces, to avoid prompt when no network interfaces
+    can be configured (closes: Ubuntu #6107).
+  * Remove redundant DH_COMPAT setting in debian/rules, since there's
+    already a (different) debian/compat.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Tue, 22 Feb 2005 12:43:43 +0000
+
+casper (0.41) hoary; urgency=low
+
+  * Cope with change in default /etc/sudoers (admin group).
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Tue, 22 Feb 2005 09:14:30 +0000
+
+casper (0.40) hoary; urgency=low
+
+  * Copy /dev/tts to the live system as well as /dev/vc, for serial console.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Mon, 21 Feb 2005 19:03:54 +0000
+
+casper (0.39) hoary; urgency=low
+
+  * Fix reboot operation (cache the reboot binary)
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Thu, 10 Feb 2005 20:51:08 -0800
+
+casper (0.38) hoary; urgency=low
+
+  * Eject the CD during shutdown/reboot
+    - Awful hack to copy /dev/cdroms to the live system, because the CD is
+      mounted using devfs names
+    - Add /usr/share/casper/shutdown script to casper-udeb
+    - Copy /usr/share/casper/shutdown to /etc/rc[06].d in 25configure-init
+  * Remove caspermon binary package, inadvertently enabled (not even
+    remotely ready)
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Thu, 10 Feb 2005 13:43:56 -0800
+
+casper (0.37) hoary; urgency=low
+
+  * Fix casper-udeb/runlevel template
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Tue,  8 Feb 2005 19:37:43 -0800
+
+casper (0.36) hoary; urgency=low
+
+  * Rename post.d/25disable-init-scripts to 25configure-init
+  * Add casper-udeb/runlevel, to allow the default runlevel
+    to be set
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Tue,  8 Feb 2005 19:14:16 -0800
+
+casper (0.35) hoary; urgency=low
+
+  * Preseed netcfg/wireless_essid
+  * Remove obsolete confmodule load from pre.d/12fstab
+  * Don't mount a tmpfs on /var/run; it doesn't save a huge amount of
+    snapshot space, and packages expect their directories there to be
+    persistent
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Mon,  7 Feb 2005 15:46:52 -0800
+
+casper (0.34) hoary; urgency=low
+
+  * Use casper-reconfigure in 10adduser as well
+  * Add post.d/93save-logs to save copies of the bootstrap logs to
+    /var/log/casper
+  * Stop reconfiguring fontconfig; it insists on rebuilding the entire
+    font cache, and the only benefit was to unable subpixel hints
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Wed,  2 Feb 2005 10:42:19 -0800
+
+casper (0.33) hoary; urgency=low
+
+  * Re-upload to fix borked source package
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Sun, 30 Jan 2005 12:21:07 -0800
+
+casper (0.32) hoary; urgency=low
+
+  * Factor out debconf hackery into casper-reconfigure
+  * Mount sysfs earlier, so we don't need to mess with it in 20xconfig
+  * Break 22simple-reconfig into 22fontconfig and 22gnome-panel-data, and
+    create progress bar text for them
+  * Preseed netcfg/dhcp_failed, to avoid a prompt when DHCP fails
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Sat, 29 Jan 2005 14:03:36 -0800
+
+casper (0.31) hoary; urgency=low
+
+  * Clear tty2 and print a nice message, before signalling init
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Sat, 29 Jan 2005 13:15:44 -0800
+
+casper (0.30) hoary; urgency=low
+
+  * Reconfigure fontconfig, to enable subpixel rendering based on the
+    hardware in use
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Thu, 27 Jan 2005 14:21:49 -0800
+
+casper (0.29) hoary; urgency=low
+
+  * Fix the problem described in 0.28 by preseeding a default for
+    netcfg/get_hostname
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Tue, 25 Jan 2005 23:04:03 -0800
+
+casper (0.28) hoary; urgency=low
+
+  * Suppress network configuration questions
+  
+    - The goal is to make a reasonable effort to configure one interface
+    automatically, but if that is not possible, fall back to no
+    configuration.  We aren't quite there yet.
+  
+    - If we fail to resolve our IP into a hostname using DNS, netcfg seems
+    to fall back to an empty value, rather than the default in the
+    template.
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Tue, 25 Jan 2005 22:55:35 -0800
+
+casper (0.27) hoary; urgency=low
+
+  * Add post.d/22simple-reconfig
+    - Reconfigure gnome-panel-data if it is installed, to set up the GNOME
+      session based on whether the system is a laptop
+    - Corresponding progress template
+    - mount /proc earlier (needed for, e.g. laptop-detect)
+  * Warn about screen blanking in X configuration progress message
+  * Simplify post.d/20xconfig and pre.d/13swap a bit
+  * Update TODO
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Sat, 22 Jan 2005 15:56:49 -0800
+
+casper (0.26) hoary; urgency=low
+
+  * Set NOPASSWD in /etc/sudoers for the initial user
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Fri, 21 Jan 2005 16:53:49 -0800
+
+casper (0.25) hoary; urgency=low
+
+  * mount /proc before signalling init, as it now uses /proc to determine
+    what is and is not a kernel thread
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Fri, 21 Jan 2005 16:04:52 -0800
+
+casper (0.24) hoary; urgency=low
+
+  * Add a backtitle properly
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Fri, 21 Jan 2005 09:07:19 -0800
+
+casper (0.23) hoary; urgency=low
+
+  * Add a backtitle
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Fri, 21 Jan 2005 09:02:01 -0800
+
+casper (0.22) hoary; urgency=low
+
+  * Search for swap on SCSI disks as well as IDE
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Wed, 19 Jan 2005 14:27:09 -0800
+
+casper (0.21) unstable; urgency=low
+
+  * Cosmetic changes to debconf templates
+  * Fix 10adduser to register debconf questions before setting their
+    values and flags
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Wed, 19 Jan 2005 14:14:20 -0800
+
+casper (0.20) hoary; urgency=low
+
+  * Remove legacy symlinks from casper/pre.d; they are now contained in
+    the relevant udebs
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Wed, 19 Jan 2005 13:22:33 -0800
+
+casper (0.19) hoary; urgency=low
+
+  * Update TODO
+  * casper-udeb Depends: md-modules
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Wed, 19 Jan 2005 11:23:51 -0800
+
+casper (0.18) hoary; urgency=low
+
+  * Enable new adduser code, using db_fset ... seen to suppress the questions
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Tue, 18 Jan 2005 15:06:48 -0800
+
+casper (0.17) hoary; urgency=low
+
+  * Convert snapshot setup to use debconf instead of hardcoded parameters
+  * Remove obselete-before-being-used username template
+  * Convert post.d/10adduser to use debconf passthrough to the passwd package,
+    and thus share its user-adding code rather than duplicating it.
+    - But don't enable it yet, since we need to find a way to prevent its
+    questions from being asked
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Tue, 18 Jan 2005 13:04:48 -0800
+
+casper (0.16) hoary; urgency=low
+
+  * casper-udeb Depends: casper-check, harddrive-detection
+  * Automatically find and enable swap devices
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Tue, 18 Jan 2005 11:23:48 -0800
+
+casper (0.15) hoary; urgency=low
+
+  * Set anna/standard_modules to false at startup to suppress unnecessary
+    udeb retrieval.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Tue, 18 Jan 2005 13:41:00 +0000
+
+casper (0.14) hoary; urgency=low
+
+  * Enable X autoconfiguration(!)
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Sat, 15 Jan 2005 02:19:58 -0800
+
+casper (0.13) hoary; urgency=low
+
+  * Rename templates so that they are named after the {pre,post}.d hook
+    which uses them
+  * Remove some unused templates
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Fri, 14 Jan 2005 10:11:02 -0800
+
+casper (0.12) hoary; urgency=low
+
+  * Add debconf templates for various things that we currently hardcode.
+    Not actually used yet due to need for testing, but having the
+    templates present greatly simplifies testing the remaining integration
+    work
+
+ -- Matt Zimmerman <mdz@ubuntu.com>  Thu, 13 Jan 2005 20:32:39 -0800
+
+casper (0.11) hoary; urgency=low
+
+  * Update post.d/20xconfig to use debconf passthrough to cdebconf
+    (requires debconf 1.4.42 and cdebconf 0.75), but leave it disabled for
+    now
+  * Create /etc/fstab in the target (this also seems to solve the problem
+    with noatime disappearing, and so should reduce snapshot utilization)
+
+ -- Matt Zimmerman <mdz@debian.org>  Thu, 13 Jan 2005 18:25:36 -0800
+
+casper (0.10) hoary; urgency=low
+
+  * Remove rc?.d/K??hwclock.sh links, to avoid changing the system clock
+    during reboot or shutdown
+
+ -- Matt Zimmerman <mdz@debian.org>  Thu, 13 Jan 2005 18:13:31 -0800
+
+casper (0.9) hoary; urgency=low
+
+  * Fix gdm autologin configuration (broken in 0.8)
+
+ -- Matt Zimmerman <mdz@debian.org>  Wed, 12 Jan 2005 10:52:05 -0800
+
+casper (0.8) hoary; urgency=low
+
+  * Add debian-installer/casper-udeb/title template, to specify more
+    readable menu item text
+  * Create /usr/lib/casper/{pre,post}.d and move all of our internal logic
+    there
+  * Create temporary symlinks in pre.d for the prebaseconfig.d items we
+    want
+  * Convert errors into proper error dialogs
+  * Make some pre.d scripts idempotent, for ease of testing
+
+ -- Matt Zimmerman <mdz@debian.org>  Tue, 11 Jan 2005 16:59:35 -0800
+
+casper (0.7) hoary; urgency=low
+
+  * Disable X configuration temporarily; need to resolve debconf issues
+
+ -- Matt Zimmerman <mdz@canonical.com>  Tue, 11 Jan 2005 13:14:43 -0800
+
+casper (0.6) hoary; urgency=low
+
+  * Allow "modprobe ext2" to fail; apparently it's sometimes compiled in
+
+ -- Matt Zimmerman <mdz@debian.org>  Tue, 11 Jan 2005 12:12:28 -0800
+
+casper (0.5) hoary; urgency=low
+
+  * Attempt to configure X
+    - This doesn't work very well yet (PCI BusID doesn't seem to get
+    updated, for example), so we still don't start gdm by default)
+  * Conditionalize some of the configuration code, so we automatically do
+    the right thing if gdm or X isn't installed
+  * Add German translation from Andreas Mueller
+  * modprobe ext2, to let powerpc work (this should probably happen
+    elsewhere, but for now...)
+
+ -- Matt Zimmerman <mdz@debian.org>  Sun,  9 Jan 2005 17:49:56 -0800
+
+casper (0.4) hoary; urgency=low
+
+  * Mount tmpfs on /tmp and /var/run, should save many writes to the snapshot
+
+ -- Matt Zimmerman <mdz@debian.org>  Fri,  7 Jan 2005 18:35:26 -0800
+
+casper (0.3) hoary; urgency=low
+
+  * Disable anacron and postfix startup
+  * Don't cripple /bin/apt-install in d-i (this was a workaround to
+    prevent d-i from installing packages which should have been present in
+    the filesystem image anyway, but weren't)
+
+ -- Matt Zimmerman <mdz@debian.org>  Fri,  7 Jan 2005 18:10:55 -0800
+
+casper (0.2) hoary; urgency=low
+
+  * Use mount --move to move the cdrom mount point, so that we can unmount
+    /initrd and free up the memory used by d-i
+  * Use /dev/ram1 rather than /dev/ram0 for the COW stuff, since /dev/ram0
+    is used for initrds and we want to avoid confusion
+  * Organize casper-udeb.postinst into shell functions
+  * Add a progress bar
+  * Add a debian/compat file (version 4)
+
+ -- Matt Zimmerman <mdz@debian.org>  Fri,  7 Jan 2005 08:01:21 -0800
+
+casper (0.1) hoary; urgency=low
+
+  * Initial Release. 
+  
+ -- Matt Zimmerman <mdz@canonical.com>  Wed,  5 Jan 2005 14:30:28 -0800
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..b8626c4
--- /dev/null
@@ -0,0 +1 @@
+4
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..95a9674
--- /dev/null
@@ -0,0 +1,17 @@
+Source: casper
+Section: admin
+Priority: optional
+Maintainer: Marco Amadori <marco.amadori@gmail.com>
+Uploaders: Daniel Baumann <daniel@debian.org>
+Build-Depends: debhelper (>= 4)
+Standards-Version: 3.7.2
+
+Package: casper
+Section: admin
+Architecture: any
+Depends: initramfs-tools (>= 0.40), user-setup
+Conflicts: usplash (<< 0.1-30)
+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/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..7127931
--- /dev/null
@@ -0,0 +1,52 @@
+This package was first debianized by Matt Zimmerman <mdz@canonical.com> on
+Wed,  5 Jan 2005 14:30:28 -0800.
+
+Upstream Authors: Marco Amadori <marco.amadori@gmail.com>,
+                 Tollef Fog Heen <tfheen@canonical.com>,
+                 Matt Zimmerman <mdz@canonical.com>.
+
+License (casper-md5check/md5.c, casper-md5check/md5,h}):
+
+       Copyright (C) 1999-2002 Aladdin Enterprises
+       All rights reserved.
+
+       This software is provided 'as-is', without any express or implied
+       warranty.  In no event will the authors be held liable for any damages
+       arising from the use of this software.
+
+       Permission is granted to anyone to use this software for any purpose,
+       including commercial applications, and to alter it and redistribute it
+       freely, subject to the following restrictions:
+
+       1. The origin of this software must not be misrepresented; you must not
+          claim that you wrote the original software. If you use this software
+          in a product, an acknowledgment in the product documentation would be
+          appreciated but is not required.
+
+       2. Altered source versions must be plainly marked as such, and must not
+          be misrepresented as being the original software.
+
+       3. This notice may not be removed or altered from any source
+          distribution.
+
+License (everything else):
+
+       Copyright (C) 2006 Marco Amadori <marco.amadori@gmail.com>
+       Copyright (C) 2005-2006 Canonical Ltd. <http://www.cannonical.com/>
+
+       This program is free software; you can redistribute it and/or modify
+       it under the terms of the GNU General Public License as published by
+       the Free Software Foundation; either version 2 of the License, or
+       (at your option) any later version.
+
+       This program is distributed in the hope that it will be useful,
+       but WITHOUT ANY WARRANTY; without even the implied warranty of
+       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+       GNU General Public License for more details.
+
+       You should have received a copy of the GNU General Public License
+       along with this program; if not, write to the Free Software
+       Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+On Debian systems, the complete text of the GNU General Public License
+can be found in /usr/share/common-licenses/GPL file.
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..1b140bb
--- /dev/null
@@ -0,0 +1,58 @@
+#!/usr/bin/make -f
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+VERSION:=$(shell dpkg-parsechangelog |sed -n -e '/^Version:/s/^Version: //p')
+DEB_BUILD_PROG:=dpkg-buildpackage -us -uc -rfakeroot
+
+upstream:
+       cd .. && bzr branch http://mammadori.homeip.net/bzr/casper-debian || exit 0
+       rm .bzr -rf
+       find . -type d -name .svn -exec rm -rf {} \; || exit 0
+
+build: build-stamp
+build-stamp:
+       dh_testdir
+
+       $(MAKE) -C casper-md5check
+
+       touch build-stamp
+
+clean:
+       dh_testdir
+       rm -f build-stamp
+
+       -$(MAKE) -C casper-md5check clean
+
+       dh_clean
+
+install: build
+       dh_testdir
+       dh_clean -k
+       dh_installdirs
+       dh_install
+
+       install -m755 casper-md5check/casper-md5check debian/casper/usr/lib/casper
+       install -D -m 644 debian/casper.lintian debian/casper/usr/share/lintian/overrides/casper
+       chmod 0755 debian/casper/usr/share/initramfs-tools/scripts/casper
+
+binary-indep: build install
+
+binary-arch: build install
+       dh_testdir
+       dh_testroot
+       dh_installdocs
+       dh_installinit -r --no-start -- start 89 0 6 .
+       dh_installchangelogs debian/changelog.upstream
+       dh_link
+       dh_strip
+       dh_compress
+       dh_fixperms
+       dh_installdeb
+       dh_gencontrol
+       dh_md5sums
+       dh_builddeb
+
+binary: binary-arch binary-indep
+.PHONY: build clean binary-indep binary-arch binary install
diff --git a/debian/ubiquity-casper.install b/debian/ubiquity-casper.install
new file mode 100644 (file)
index 0000000..866ebdd
--- /dev/null
@@ -0,0 +1,2 @@
+bin/casper-reconfigure usr/bin
+ubiquity-hooks/* usr/lib/ubiquity/target-config
diff --git a/hooks/casper b/hooks/casper
new file mode 100755 (executable)
index 0000000..7229612
--- /dev/null
@@ -0,0 +1,81 @@
+#!/bin/sh -e
+# initramfs hook for casper
+
+PREREQS=""
+
+# Output pre-requisites
+prereqs()
+{
+       echo "$PREREQ"
+}
+
+case "$1" in
+    prereqs)
+       prereqs
+       exit 0
+       ;;
+esac
+
+. /usr/share/initramfs-tools/hook-functions
+
+
+manual_add_modules unionfs
+
+# 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
+fi
+
+# We need losetup
+copy_exec /sbin/losetup /sbin
+
+# Casper hooks
+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
+if [ -x /sbin/udevplug ]; 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
+else
+       copy_exec /sbin/udevtrigger /sbin
+fi
+
+copy_exec /usr/bin/udevinfo /bin
+
+# cifs boot 
+if [ -x /sbin/mount.cifs ]; then
+       copy_exec /sbin/mount.cifs /sbin
+       for x in cifs; do
+               manual_add_modules ${x}
+       done
+fi
+
+# squashfs
+manual_add_modules squashfs
+manual_add_modules loop
+
+# random file system modules
+manual_add_modules vfat
+manual_add_modules ext3
+# needed for vfat. :-/
+manual_add_modules nls_cp437
+manual_add_modules nls_utf8
+manual_add_modules nls_iso8859-1
+
+# cdrom modules
+manual_add_modules sr_mod
+manual_add_modules ide-cd
+manual_add_modules sbp2
+manual_add_modules ohci1394
+
+# integrity check
+copy_exec /usr/lib/casper/casper-md5check /bin
+
+auto_add_modules net
diff --git a/scripts/casper b/scripts/casper
new file mode 100644 (file)
index 0000000..2557595
--- /dev/null
@@ -0,0 +1,382 @@
+#!/bin/sh
+
+# set -e
+
+mountpoint=/live_media
+root_persistence="casper-rw"
+home_persistence="home-rw"
+
+mkdir -p $mountpoint
+
+overlay_method=unionfs
+if [ "${DPKG_ARCH}" = "ia64" ] || [ "${DPKG_ARCH}" = "hppa" ] || [ "${DPKG_ARCH}" = "sparc" ]; then
+    overlay_method=devmapper
+fi
+
+USERNAME=debian
+USERFULLNAME="Debian Live user"
+HOST=debian
+
+[ -f /etc/casper.conf ] && . /etc/casper.conf
+
+export USERNAME USERFULLNAME HOST
+
+casper_path() { # Fixme: uglyness
+    path=$1
+    if [ -e "$path/casper/filesystem.cloop" ]; then
+        echo "$path/casper/filesystem.cloop"
+        return 0
+    elif [ -e "$path/casper/filesystem.squashfs" ]; then
+        echo "$path/casper/filesystem.squashfs"
+        return 0
+    elif [ -e "$path/casper/filesystem.ext2" ]; then
+        echo "$path/casper/filesystem.ext2"
+        return 0
+    elif [ -e "$path/casper/filesystem.xfs" ]; then
+        echo "$path/casper/filesystem.xfs"
+        return 0
+    fi
+    return 1
+}
+
+subdevices() {
+    sysblock=$1
+    r=""
+    for dev in "${sysblock}" "${sysblock}"/*; do
+        if [ -e "${dev}/dev" ]; then
+            r="${r} ${dev}"
+        fi
+    done
+    echo ${r}
+}
+
+get_backing_device() {
+       case "$1" in
+            *.cloop)
+                echo $(setup_loop "$1" "cloop" "/sys/block/cloop*")
+                       ;;
+            *.squashfs|*.ext2|*.xfs)
+                echo $(setup_loop "$1" "loop" "/sys/block/loop*")
+                ;;
+            *)
+                panic "Unrecognized casper filesystem: $1"
+                ;;
+       esac
+}
+
+setup_cow() {
+       case "$1" in
+            unionfs)
+                setup_unionfs "$2" "$rootmnt"
+                ;;
+            devmapper)
+                setup_devmapper "$2" "$rootmnt"
+       esac
+}
+
+sys2dev() {
+    sysdev=${1#/sys}
+    echo "/dev/$(udevinfo -q name -p ${sysdev} 2>/dev/null|| echo ${sysdev##*/})"
+}
+
+setup_loop() {
+    local fspath=$1
+    local module=$2
+    local pattern=$3
+
+    modprobe -qb "$module"
+    if [ -x /sbin/udevplug ]; then
+        udevplug -W
+    else
+        udevtrigger
+    fi
+    for loopdev in $pattern; do
+        if [ "$(cat $loopdev/size)" -eq 0 ]; then
+            dev=$(sys2dev "${loopdev}")
+            losetup "$dev" "$fspath"
+            echo "$dev"
+            return 0
+        fi
+    done
+    panic "No loop devices available"
+}
+
+get_fstype() {
+    local FSTYPE
+    local FSSIZE
+    eval $(fstype < $1)
+    if [ "$FSTYPE" != "unknown" ]; then
+        echo $FSTYPE
+        return 0
+    fi
+    /lib/udev/vol_id -t $1 2>/dev/null
+}
+
+setup_devmapper() {
+    backdev="$1"
+    rootmnt="$2"
+
+    modprobe -qb dm-mod
+    COW_DEVICE=/dev/ram1
+    COW_NAME="casper-cow"
+
+    BACKING_FILE_SIZE=$(blockdev --getsize "$backdev")
+    MAX_COW_SIZE=$(blockdev --getsize "$COW_DEVICE")
+    CHUNK_SIZE=8 # sectors
+
+    if [ -z "$COW_SIZE" -o "$COW_SIZE" -gt "$MAX_COW_SIZE" ]; then
+        COW_SIZE=$MAX_COW_SIZE
+    fi
+
+    echo "0 $COW_SIZE linear $COW_DEVICE 0" | dmsetup create $COW_NAME
+
+    echo "0 $BACKING_FILE_SIZE snapshot $backdev /dev/mapper/$COW_NAME p $CHUNK_SIZE" | \
+        dmsetup create casper-snapshot
+    if [ "$(get_fstype $backdev)" = "unknown" ]; then
+        panic "Unknown file system type on $backdev"
+    fi
+    mount -t $(get_fstype "$backdev") /dev/mapper/casper-snapshot $rootmnt || panic "Can not mount /dev/mapper/casper/snapshot on $rootmnt"
+
+    mkdir -p "$rootmnt/rofs"
+    echo "0 $BACKING_FILE_SIZE linear $backdev 0" | dmsetup create casper-backing
+    mount -t $(get_fstype "$backdev") /dev/mapper/casper-backing "$rootmnt/rofs"
+}
+
+where_is_mounted() {
+    device=$1
+    if grep -q "^$device " /proc/mounts; then
+        grep "^$device " /proc/mounts | read d mountpoint rest
+        echo $mountpoint
+        return 0
+    fi
+    return 1
+}
+
+copy_to_ram() {
+       copyto="${mountpoint}_swap"
+
+       size=$(du -ks ${mountpoint} | 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
+       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 ${mountpoint}/* ${copyto}
+               umount ${mountpoint}
+               mount -r -o move ${copyto} ${mountpoint}
+               rmdir ${copyto}
+               [ "$quiet" != "y" ] && log_end_msg
+       fi
+}
+
+find_cow_device() {
+       pers_label="${1}"
+       cow_backing="/${pers_label}-backing"
+       for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop); do
+               for dev in $(subdevices "${sysblock}"); do
+                       devname=$(sys2dev "${dev}")
+                       if [ "$(/lib/udev/vol_id -l $devname 2>/dev/null)" = "${pers_label}" ]; then
+                               echo "$devname"
+                               return
+                       elif [ "$(get_fstype ${devname})" = "vfat" ]; then
+                               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
+
+                               if [ -e "${cow_backing}/${pers_label}" ]; then
+                                       echo $(setup_loop "${cow_backing}/${pers_label}" "loop" "/sys/block/loop*")
+                                       return 0
+                               else
+                                       umount ${cow_backing}
+                               fi
+                       fi
+               done
+       done
+}
+
+do_netmount() {
+       rofsmnt="$1"
+       # adapted from NFS filesystem mounting
+
+       modprobe -q cifs
+       # For DHCP
+       modprobe -q af_packet
+
+       ipconfig ${DEVICE} /tmp/net-${DEVICE}.conf
+       if [ "x${NFSROOT}" = "xauto" ]; then
+               NFSROOT=${ROOTSERVER}:${ROOTPATH}
+       fi
+
+       NFSOPTS="-ouser=root,password="
+
+       [ "$quiet" != "y" ] && log_begin_msg "Mounting using mount.cifs with ${NFSROOT} ${rofsmnt} ${NFSOPTS}"
+       mount.cifs "${NFSROOT}" "${rofsmnt}" "${NFSOPTS}" 
+       [ "$quiet" != "y" ] && log_end_msg
+}
+
+setup_unionfs() {
+       backdev="$1"
+       rootmnt="$2"
+       modprobe -qb unionfs
+       mkdir -p /cow
+       cowdevice="tmpfs"
+       cow_fstype="tmpfs"
+       # Looking for "${root_persistence}" device or file
+       if grep -q persistent /proc/cmdline; then
+               cowprobe=$(find_cow_device "${root_persistence}")
+               if [ -b "${cowprobe}" ]; then
+                       cowdevice=${cowprobe}
+                       cow_fstype=$(get_fstype "${cowprobe}")
+               else
+                       [ "$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"
+
+       mkdir -p /rofs
+       if grep -q netboot /proc/cmdline; then
+               do_netmount /rofs || panic "Can not mount netroot on /rofs"
+       else
+               if [ "$(get_fstype $backdev)" = "unknown" ]; then
+                       panic "Unknown file system type on $backdev"
+               fi
+               mount -t $(get_fstype "$backdev") -o ro "$backdev" /rofs || panic "Can not mount $backdev on /rofs"
+       fi
+       
+       mount -t unionfs -o dirs=/cow=rw:/rofs=ro unionfs "$rootmnt"
+       if grep -q show-cow /proc/cmdline; then
+               mkdir -p "$rootmnt/cow"
+               mount -o bind /cow "$rootmnt/cow"
+       fi
+       mkdir -p "$rootmnt/rofs"
+       mount -o bind /rofs "$rootmnt/rofs"
+
+       # Adding home persitence
+       if grep -q homepersistence /proc/cmdline; 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
+       fi
+}
+
+is_usb_device() {
+    sysfs_path="${1#/sys}"
+    if /lib/udev/path_id "${sysfs_path}" | grep -q "ID_PATH=usb"; then
+        return 0
+    fi
+    return 1
+}
+
+find_live() {
+       mounted=
+        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 casper_path $mountpoint; then
+                    echo $(casper_path $mountpoint)
+                    return
+                else
+                    umount $mountpoint
+                fi
+            elif is_usb_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 casper_path $mountpoint; then
+                                echo $(casper_path $mountpoint)
+                                return
+                            else
+                                umount $mountpoint
+                            fi
+                            ;;
+                    esac
+                done
+           elif [ "${fstype}" = "squashfs" ]; then
+
+                # This is an ugly hack situation, the block device has
+                # a squashfs image directly on it.  It's hopefully
+                # casper, so take it and run with it.
+
+                ln -s "${devname}" "${devname}.${fstype}"
+                echo "${devname}.${fstype}"
+                return
+            fi
+        done
+}
+
+set_usplash_timeout() {
+    if [ -x /sbin/usplash_write ]; then
+        /sbin/usplash_write "TIMEOUT 120"
+    fi
+}
+
+mountroot() {
+    exec 6>&1
+    exec 7>&2
+    exec > casper.log
+    exec 2>&1
+
+    set_usplash_timeout
+    [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/casper-premount"
+    run_scripts /scripts/casper-premount
+    [ "$quiet" != "y" ] && log_end_msg
+
+    # Needed here too because some things (*cough* udev *cough*)
+    # changes the timeout
+
+    set_usplash_timeout
+
+    for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13; do
+        live_image=$(find_live)
+        if [ "${live_image}" ]; then
+            break
+        fi
+        sleep 1
+    done
+    if [ "$?" -gt 0 ]; then
+        panic "Unable to find a medium containing a live file system"
+    fi
+    
+       if grep -q toram /proc/cmdline; then
+               copy_to_ram
+       fi
+
+    setup_cow "$overlay_method" "$(get_backing_device $live_image)" "$rootmnt"
+
+       # show it on new rootfs
+       mkdir ${rootmnt}/${mountpoint}
+       mount -o bind ${mountpoint} ${rootmnt}/${mountpoint}
+
+    log_end_msg
+
+    maybe_break casper-bottom
+    [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/casper-bottom"
+
+    PATH=/root/usr/bin:/root/usr/sbin:/root/bin:/root/sbin:$PATH run_scripts /scripts/casper-bottom
+    [ "$quiet" != "y" ] && log_end_msg
+
+    exec 1>&6 6>&-
+    exec 2>&7 7>&-
+    cp casper.log "${rootmnt}/var/log/"
+}
diff --git a/scripts/casper-bottom/01integrity_check b/scripts/casper-bottom/01integrity_check
new file mode 100755 (executable)
index 0000000..8c8e153
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+PREREQ=""
+
+prereqs()
+{
+       echo "$PREREQ"
+}
+
+case $1 in
+# get pre-requisites
+prereqs)
+       prereqs
+       exit 0
+       ;;
+esac
+
+grep integrity-check /proc/cmdline && casper-md5check /live_media /live_media/md5sum.txt < /dev/tty8
diff --git a/scripts/casper-bottom/05mountpoints b/scripts/casper-bottom/05mountpoints
new file mode 100755 (executable)
index 0000000..ca8845a
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+PREREQ=""
+DESCRIPTION="Moving mount points..."
+
+. /scripts/functions
+
+prereqs()
+{
+       echo "$PREREQ"
+}
+
+case $1 in
+# get pre-requisites
+prereqs)
+       prereqs
+       exit 0
+       ;;
+esac
+
+log_begin_msg "$DESCRIPTION"
+
+# Move to the new root filesystem so that programs there can get at it.
+mkdir -p /root/cdrom
+mount -n -o move /cdrom /root/cdrom
+
+log_end_msg
diff --git a/scripts/casper-bottom/10adduser b/scripts/casper-bottom/10adduser
new file mode 100755 (executable)
index 0000000..dc8aaa8
--- /dev/null
@@ -0,0 +1,66 @@
+#!/bin/sh
+
+PREREQ=""
+DESCRIPTION="Adding live CD user..."
+
+. /scripts/functions
+
+prereqs()
+{
+       echo "$PREREQ"
+}
+
+case $1 in
+# get pre-requisites
+prereqs)
+       prereqs
+       exit 0
+       ;;
+esac
+
+log_begin_msg "$DESCRIPTION"
+
+chroot /root debconf-communicate -fnoninteractive casper > /dev/null <<EOF
+set passwd/root-password-crypted *
+set passwd/user-password-crypted U6aMy0wojraho
+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
+
+# Clear out debconf database again to avoid confusing ubiquity later.
+chroot /root debconf-communicate -fnoninteractive casper > /dev/null <<EOF
+set passwd/root-password-crypted
+set passwd/user-password-crypted
+set passwd/user-fullname
+set passwd/username
+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
+        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
+    else # We are in debian :-)
+        echo "${USERNAME}  ALL=(ALL) NOPASSWD: ALL" >> /root/etc/sudoers           
+    fi
+fi
+
+if [ -L /root/home/$USERNAME/Examples ]; then
+    chroot /root install -o $USERNAME -g $USERNAME -d /home/$USERNAME/Desktop/
+    mv /root/home/$USERNAME/Examples /root/home/$USERNAME/Desktop/
+fi
+
+log_end_msg
diff --git a/scripts/casper-bottom/12fstab b/scripts/casper-bottom/12fstab
new file mode 100755 (executable)
index 0000000..00e5c50
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+PREREQ=""
+DESCRIPTION="Configuring fstab..."
+FSTAB=/root/etc/fstab
+
+. /scripts/functions
+
+prereqs()
+{
+       echo "$PREREQ"
+}
+
+case $1 in
+# get pre-requisites
+prereqs)
+       prereqs
+       exit 0
+       ;;
+esac
+
+log_begin_msg "$DESCRIPTION"
+
+cat > $FSTAB <<EOF
+unionfs / unionfs rw 0 0
+tmpfs /tmp tmpfs nosuid,nodev 0 0
+EOF
+
+rm -f /root/etc/rcS.d/S10checkroot.sh
+
+log_end_msg
diff --git a/scripts/casper-bottom/13swap b/scripts/casper-bottom/13swap
new file mode 100755 (executable)
index 0000000..44d73f3
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+PREREQ=""
+DESCRIPTION="Setting up swap..."
+FSTAB=/root/etc/fstab
+
+. /scripts/functions
+
+prereqs()
+{
+       echo "$PREREQ"
+}
+
+case $1 in
+# get pre-requisites
+prereqs)
+       prereqs
+       exit 0
+       ;;
+esac
+
+log_begin_msg "$DESCRIPTION"
+
+devices=""
+for device in /dev/[hs]d[a-z][0-9]*; do
+    if ! [ -b "$device" ]; then
+        continue
+    fi
+
+    magic=$(dd if="$device" bs=4086 skip=1 count=1 2>/dev/null | dd bs=10 count=1 2>/dev/null) || continue
+    
+    if [ "$magic" = "SWAPSPACE2" -o "$magic" = "SWAP-SPACE" ]; then
+#        log "Found $device"
+        devices="$devices $device"
+        fi
+done
+
+for device in $devices; do
+    cat >> $FSTAB <<EOF
+$device swap swap defaults 0 0
+EOF
+done
+
+log_end_msg
diff --git a/scripts/casper-bottom/14locales b/scripts/casper-bottom/14locales
new file mode 100755 (executable)
index 0000000..6d5b73c
--- /dev/null
@@ -0,0 +1,52 @@
+#! /bin/sh
+
+PREREQ=""
+DESCRIPTION="Setting up locales..."
+
+. /scripts/functions
+
+prereqs()
+{
+       echo "$PREREQ"
+}
+
+case $1 in
+# get pre-requisites
+prereqs)
+       prereqs
+       exit 0
+       ;;
+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 '"' ) 
+elif [ -e /root/etc/environment ]; then # Old locales policy
+       grep_file=/root/etc/environment
+fi
+
+# commandline
+for x in $(cat /proc/cmdline); do
+       case $x in
+               debian-installer/locale=*)
+                       locale=${x#debian-installer/locale=}
+                       set_locale="true"
+                       ;;
+       esac
+done
+
+if [ -z "${locale}" ]; then
+       # Set a default one
+       locale=en_US.UTF-8
+       set_locale="true"
+fi
+
+if [ ! -z "${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}"
+fi
+
+log_end_msg
diff --git a/scripts/casper-bottom/15autologin b/scripts/casper-bottom/15autologin
new file mode 100755 (executable)
index 0000000..5f7797a
--- /dev/null
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+PREREQ=""
+DESCRIPTION="Setting up automatic login..."
+
+. /scripts/functions
+
+prereqs()
+{
+       echo "$PREREQ"
+}
+
+case $1 in
+# get pre-requisites
+prereqs)
+       prereqs
+       exit 0
+       ;;
+esac
+
+log_begin_msg "$DESCRIPTION"
+
+if chroot /root [ -f /etc/gdm/gdm-cdd.conf ]; then
+    GDMCONF=/etc/gdm/gdm-cdd.conf
+else
+    GDMCONF=/etc/gdm/gdm.conf
+fi
+
+if chroot /root [ -f ${GDMCONF} ]; then
+    # Configure GDM autologin
+    chroot /root sed -i \
+        -e "s/^AutomaticLoginEnable=.*\$/AutomaticLoginEnable=true/" \
+        -e "s/^AutomaticLogin=.*\$/AutomaticLogin=$USERNAME/" \
+        -e "s/^TimedLoginEnable=.*\$/TimedLoginEnable=true/" \
+        -e "s/^TimedLogin=.*\$/TimedLogin=$USERNAME/" \
+        -e "s/^TimedLoginDelay=.*\$/TimedLoginDelay=10/" \
+        ${GDMCONF}
+fi
+
+if [ -f /root/etc/kde3/kdm/kdmrc ]; then
+    # Configure KDM autologin
+    sed -i -r \
+        -e "s/^#?AutoLoginEnable=.*\$/AutoLoginEnable=true/" \
+        -e "s/^#?AutoLoginUser=.*\$/AutoLoginUser=$USERNAME/" \
+        -e "s/^#?AutoReLogin=.*\$/AutoReLogin=true/" \
+        /root/etc/kde3/kdm/kdmrc
+fi
+
+if chroot /root /usr/bin/which kpersonalizer >/dev/null; then
+    # Disable first-login wizard for KDE
+    if [ ! -f /root/etc/kde3/kpersonalizerrc ]; then
+        cat > /root/etc/kde3/kpersonalizerrc <<EOF
+[General]
+FirstLogin=false
+EOF
+    else
+        echo "I'm not smart enough to disable kpersonalizer startup" >&2
+        echo "Because kpersonalizerrc already exists" >&2
+    fi
+fi
+
+log_end_msg
diff --git a/scripts/casper-bottom/18hostname b/scripts/casper-bottom/18hostname
new file mode 100755 (executable)
index 0000000..7ac5b00
--- /dev/null
@@ -0,0 +1,38 @@
+#! /bin/sh
+
+PREREQ=""
+DESCRIPTION="Setting hostname..."
+
+. /scripts/functions
+
+prereqs()
+{
+       echo "$PREREQ"
+}
+
+case $1 in
+# get pre-requisites
+prereqs)
+       prereqs
+       exit 0
+       ;;
+esac
+
+log_begin_msg "$DESCRIPTION"
+
+echo "$HOST" > /root/etc/hostname
+cat > /root/etc/hosts <<EOF
+127.0.0.1 localhost
+127.0.1.1 $HOST
+
+# The following lines are desirable for IPv6 capable hosts
+::1     ip6-localhost ip6-loopback
+fe00::0 ip6-localnet
+ff00::0 ip6-mcastprefix
+ff02::1 ip6-allnodes
+ff02::2 ip6-allrouters
+ff02::3 ip6-allhosts
+
+EOF
+
+log_end_msg
diff --git a/scripts/casper-bottom/19keyboard b/scripts/casper-bottom/19keyboard
new file mode 100755 (executable)
index 0000000..895a698
--- /dev/null
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+PREREQ=""
+DESCRIPTION="Setting up keyboard..."
+
+. /scripts/functions
+
+prereqs()
+{
+       echo "$PREREQ"
+}
+
+case $1 in
+# get pre-requisites
+prereqs)
+       prereqs
+       exit 0
+       ;;
+esac
+
+log_begin_msg "$DESCRIPTION"
+
+kbd=us
+
+for x in $(cat /proc/cmdline); do
+                case $x in
+                        kbd-chooser/method=*)
+                                kbd=${x#kbd-chooser/method=}
+                                ;;
+                esac
+done
+
+chroot /root /usr/sbin/install-keymap $kbd
+casper-preseed /root debian-installer/keymap "$kbd"
+log_end_msg
diff --git a/scripts/casper-bottom/20xconfig b/scripts/casper-bottom/20xconfig
new file mode 100755 (executable)
index 0000000..840200d
--- /dev/null
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+PREREQ=""
+DESCRIPTION="Configuring X..."
+
+. /scripts/functions
+
+prereqs()
+{
+       echo "$PREREQ"
+}
+
+case $1 in
+# get pre-requisites
+prereqs)
+       prereqs
+       exit 0
+       ;;
+esac
+
+log_begin_msg "$DESCRIPTION"
+
+if [ "$TERM_TYPE" = "serial" ]; then
+    # Don't bother trying to configure or start X on a serial console
+    rm -f /etc/rc?.d/S??[gxk]dm
+    exit 0
+fi
+
+locale=en_US.UTF-8
+
+for x in $(cat /proc/cmdline); do
+                case $x in
+                        debian-installer/locale=*)
+                                locale=${x#debian-installer/locale=}
+                                ;;
+                esac
+done
+
+mount -n -o bind /sys /root/sys
+mount -n -o bind /proc /root/proc
+
+chroot /root debconf-communicate -fnoninteractive casper > /dev/null <<EOF
+set xserver-xorg/autodetect_keyboard true
+fset xserver-xorg/autodetect_keyboard seen true
+EOF
+
+DEBUG_XORG_PACKAGE=1 DEBUG_XORG_DEBCONF=1 LANG=$(grep "^${locale}" /root/usr/share/i18n/SUPPORTED | grep UTF-8 | sed -e 's, .*,,' -e q) casper-reconfigure /root xserver-xorg
+umount /root/sys
+umount /root/proc
+
+log_end_msg
diff --git a/scripts/casper-bottom/22gnome_panel_data b/scripts/casper-bottom/22gnome_panel_data
new file mode 100755 (executable)
index 0000000..7bedd7a
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+PREREQ=""
+DESCRIPTION="Configuring gnome-panel-data..."
+
+. /scripts/functions
+
+prereqs()
+{
+       echo "$PREREQ"
+}
+
+case $1 in
+# get pre-requisites
+prereqs)
+       prereqs
+       exit 0
+       ;;
+esac
+
+log_begin_msg "$DESCRIPTION"
+
+if [ -x /root/usr/sbin/laptop-detect ]; then
+       if chroot /root /bin/sh -c /usr/sbin/laptop-detect; then
+           casper-reconfigure /root gnome-panel-data
+       fi
+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
+fi
+
+log_end_msg
diff --git a/scripts/casper-bottom/22screensaver b/scripts/casper-bottom/22screensaver
new file mode 100755 (executable)
index 0000000..2a98b1a
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+PREREQ=""
+DESCRIPTION="Configuring screensaver..."
+
+. /scripts/functions
+
+prereqs()
+{
+       echo "$PREREQ"
+}
+
+case $1 in
+# get pre-requisites
+prereqs)
+       prereqs
+       exit 0
+       ;;
+esac
+
+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
+fi
+
+log_end_msg
diff --git a/scripts/casper-bottom/23etc_modules b/scripts/casper-bottom/23etc_modules
new file mode 100755 (executable)
index 0000000..622d96e
--- /dev/null
@@ -0,0 +1,30 @@
+#! /bin/sh
+
+PREREQ=""
+DESCRIPTION="Preconfiguring /etc/modules..."
+
+. /scripts/functions
+
+prereqs()
+{
+       echo "$PREREQ"
+}
+
+case $1 in
+# get pre-requisites
+prereqs)
+       prereqs
+       exit 0
+       ;;
+esac
+
+log_begin_msg "$DESCRIPTION"
+
+case "$DPKG_ARCH" in
+# load the right modules
+powerpc|ppc64)
+        echo snd_powermac >> /root/etc/modules
+       ;;
+esac
+
+log_end_msg
diff --git a/scripts/casper-bottom/23networking b/scripts/casper-bottom/23networking
new file mode 100755 (executable)
index 0000000..7238773
--- /dev/null
@@ -0,0 +1,55 @@
+#! /bin/sh
+
+PREREQ=""
+DESCRIPTION="Preconfiguring networking..."
+IFFILE="/root/etc/network/interfaces"
+
+. /scripts/functions
+
+prereqs()
+{
+       echo "$PREREQ"
+}
+
+case $1 in
+# get pre-requisites
+prereqs)
+       prereqs
+       exit 0
+       ;;
+esac
+
+log_begin_msg "$DESCRIPTION"
+
+cat > "$IFFILE" <<EOF
+auto lo
+iface lo inet loopback
+
+EOF
+
+if [ -x /sbin/udevplug ]; then
+       udevplug -Bpci -Iclass="0x02*"
+else
+       udevtrigger
+fi
+
+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
+
+for i in eth0 eth1 eth2 ath0 wlan0; do
+    [ ! -e /sys/class/net/$i ] || continue
+    cat >> "$IFFILE" <<EOF
+auto $i
+iface $i inet dhcp
+
+EOF
+done
+
+log_end_msg
diff --git a/scripts/casper-bottom/24preseed b/scripts/casper-bottom/24preseed
new file mode 100755 (executable)
index 0000000..468ec2e
--- /dev/null
@@ -0,0 +1,43 @@
+#! /bin/sh
+
+PREREQ=""
+DESCRIPTION="Loading preseed file..."
+
+. /scripts/functions
+
+prereqs ()
+{
+       echo "$PREREQ"
+}
+
+case $1 in
+# get pre-requisites
+prereqs)
+       prereqs
+       exit 0
+       ;;
+esac
+
+log_begin_msg "$DESCRIPTION"
+
+location=
+for x in $(cat /proc/cmdline); do
+       case $x in
+               preseed/file=*)
+                       location="${x#preseed/file=}"
+                       ;;
+               */*=*)
+                       question="${x%%=*}"
+                       value="${x#*=}"
+                       casper-preseed /root "$question" "$value"
+                       ;;
+       esac
+done
+
+if [ "$location" ]; then
+       chroot /root debconf-set-selections < "/root$location"
+fi
+
+log_end_msg
+
+exit 0
diff --git a/scripts/casper-bottom/25configure_init b/scripts/casper-bottom/25configure_init
new file mode 100755 (executable)
index 0000000..0c5c43e
--- /dev/null
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+PREREQ=""
+DESCRIPTION="Setting up init..."
+
+. /scripts/functions
+
+prereqs()
+{
+       echo "$PREREQ"
+}
+
+case $1 in
+# get pre-requisites
+prereqs)
+       prereqs
+       exit 0
+       ;;
+esac
+
+log_begin_msg "$DESCRIPTION"
+
+# Arrange for shells on virtual consoles, rather than login prompts
+
+if [ -n "$USERNAME" ]; then
+    sed -i -e "s|^\([^:]*:[^:]*:[^:]*\):.*getty.*\<\(tty[0-9]*\).*$|\1:/bin/login -f $USERNAME </dev/\2 >/dev/\2 2>\&1|" /root/etc/inittab
+fi
+
+# This has the nice side effect of the cron.{daily,weekly,monthly} jobs in
+# /etc/crontab remaining disabled, yet also not run by anacron
+if [ -x /root/etc/init.d/anacron ]; then
+       for f in /root/etc/rc?.d/S??anacron; do
+       mv ${f} $(dirname ${f})/K00anacron
+       done
+fi
+
+# No point, really
+rm -f /root/etc/rc?.d/[SK]??postfix
+
+# Avoid clobbering the user's clock
+rm -f /root/etc/rc?.d/K??hwclock.sh
+
+# Disable readahead since it doesn't play well with squashfs + unionfs
+# use chmod instead of mv to not trigger unionfs bugs.
+if [ -e /root/sbin/readahead-list ]; then
+       chmod -x /root/sbin/readahead-list
+fi
+
+log_end_msg
+
+exit 0
diff --git a/scripts/casper-bottom/30accessibility b/scripts/casper-bottom/30accessibility
new file mode 100755 (executable)
index 0000000..c6015e1
--- /dev/null
@@ -0,0 +1,81 @@
+#!/bin/sh
+
+PREREQ=""
+DESCRIPTION="Configuring accessibility options..."
+
+. /scripts/functions
+
+prereqs()
+{
+       echo "$PREREQ"
+}
+
+case $1 in
+# get pre-requisites
+prereqs)
+       prereqs
+       exit 0
+       ;;
+esac
+
+log_begin_msg "$DESCRIPTION"
+
+gct() {
+    chroot /root su $USERNAME -- gconftool-2 "$@"
+}
+
+for x in $(cat /proc/cmdline); do
+                case $x in
+                        # Lesser Visual Impairment
+                        access=v1)
+                        gct -s -t string /desktop/gnome/interface/gtk_theme HighContrastLargePrint
+                        gct -s -t string /desktop/gnome/interface/icon_theme HighContrast
+                        gct -s -t string /desktop/gnome/interface/monospace_font_name "monospace 18"
+                        gct -s -t string /desktop/gnome/interface/font_name "sans 18"
+                        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/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
+                        ;;
+                        # 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
+                        ;;
+                        # 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
+                        ;;
+                        # Minor Motor Difficulties
+                        access=m1)
+                        gct -s -t bool /desktop/gnome/accessibility/keyboard/enable true
+                        gct -s -t bool /desktop/gnome/accessibility/keyboard/mousekeys_enable true
+                        gct -s -t bool /desktop/gnome/accessibility/keyboard/stickykeys_enable true
+                        gct -s -t bool /desktop/gnome/accessibility/keyboard/stickykeys_modifier_beep true
+                        gct -s -t bool /desktop/accessibility/gnome/keyboard/stickykeys_two_key_off false
+                        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
+                        ;;
+                        # Motor Difficulties - pointing devices
+                        access=m2)
+                        gct -s -t bool /desktop/gnome/accessibility/keyboard/enable 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
+                        ;;
+               esac
+done
+log_end_msg
diff --git a/scripts/casper-bottom/31disable_update_notifier b/scripts/casper-bottom/31disable_update_notifier
new file mode 100755 (executable)
index 0000000..082b818
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+PREREQ=""
+DESCRIPTION="Disabling update-notifier..."
+
+. /scripts/functions
+
+prereqs()
+{
+       echo "$PREREQ"
+}
+
+case $1 in
+# get pre-requisites
+prereqs)
+       prereqs
+       exit 0
+       ;;
+esac
+
+log_begin_msg "$DESCRIPTION"
+
+rm -f /root/etc/xdg/autostart/update-notifier.desktop
+rm -f /root/usr/share/autostart/adept_notifier_auto.desktop
+
+log_end_msg
diff --git a/scripts/casper-bottom/32disable_hibernation b/scripts/casper-bottom/32disable_hibernation
new file mode 100755 (executable)
index 0000000..7b7d976
--- /dev/null
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+PREREQ=""
+DESCRIPTION="Configuring power management..."
+
+. /scripts/functions
+
+prereqs()
+{
+       echo "$PREREQ"
+}
+
+case $1 in
+# get pre-requisites
+prereqs)
+       prereqs
+       exit 0
+       ;;
+esac
+
+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
+fi
+
+if [ -f /root/usr/share/kubuntu-default-settings/kde-profile/default/share/config/kcmlaptoprc ]; then
+    sed -i s/EnableHibernate=true/EnableHibernate=false/ \
+        /root/usr/share/kubuntu-default-settings/kde-profile/default/share/config/kcmlaptoprc
+fi
+
+log_end_msg
diff --git a/scripts/casper-bottom/33disable_binary_drivers b/scripts/casper-bottom/33disable_binary_drivers
new file mode 100755 (executable)
index 0000000..4e4fec3
--- /dev/null
@@ -0,0 +1,25 @@
+#! /bin/sh
+
+PREREQ=""
+DESCRIPTION="Configuring some drivers..."
+
+. /scripts/functions
+
+prereqs()
+{
+       echo "$PREREQ"
+}
+
+case $1 in
+# get pre-requisites
+prereqs)
+       prereqs
+       exit 0
+       ;;
+esac
+
+log_begin_msg "$DESCRIPTION"
+
+if [ -e /root/etc/default/linux-restricted-modules-common ]; then
+       echo 'DISABLED_MODULES="fglrx nv"' >> /root/etc/default/linux-restricted-modules-common
+fi
diff --git a/ubiquity-hooks/20xconfig b/ubiquity-hooks/20xconfig
new file mode 100755 (executable)
index 0000000..6f8becd
--- /dev/null
@@ -0,0 +1,11 @@
+#! /bin/sh
+set -e
+
+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
+fi
+
+exit 0
diff --git a/ubiquity-hooks/22gnome_panel_data b/ubiquity-hooks/22gnome_panel_data
new file mode 100755 (executable)
index 0000000..2c1059f
--- /dev/null
@@ -0,0 +1,8 @@
+#! /bin/sh
+set -e
+
+if laptop-detect; then
+    casper-reconfigure /target gnome-panel-data
+fi
+
+exit 0
diff --git a/ubiquity-hooks/25modules b/ubiquity-hooks/25modules
new file mode 100755 (executable)
index 0000000..59a0d15
--- /dev/null
@@ -0,0 +1,8 @@
+#! /bin/sh
+set -e
+
+if [ -f /etc/modules ]; then
+    cp -a /etc/modules /target/etc/modules
+fi
+
+exit 0
diff --git a/ubiquity-hooks/32gnome_power_manager b/ubiquity-hooks/32gnome_power_manager
new file mode 100755 (executable)
index 0000000..213a917
--- /dev/null
@@ -0,0 +1,6 @@
+#! /bin/sh
+set -e
+
+casper-reconfigure /target gnome-power-manager
+
+exit 0