From 8421bbd25885a670de6b616da12711b5dcf68e1b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 23 Sep 2007 14:46:27 +0200 Subject: [PATCH] Adding casper 1.77+debian-5. --- bin/casper-snapshot | 26 +++++--- debian/changelog | 11 ++++ debian/manpage/casper-snapshot.1 | 11 ++-- debian/manpage/casper.7 | 42 ++++++++----- scripts/casper | 62 +++++++++--------- scripts/casper-bottom/14locales | 1 + scripts/casper-bottom/19keyboard | 15 ++--- scripts/casper-bottom/20xconfig | 22 ++++++- scripts/casper-bottom/24preseed | 33 +++------- scripts/casper-bottom/30accessibility | 115 +++++++++++++++++----------------- 10 files changed, 190 insertions(+), 148 deletions(-) diff --git a/bin/casper-snapshot b/bin/casper-snapshot index 4c9dcd6..33dede4 100644 --- a/bin/casper-snapshot +++ b/bin/casper-snapshot @@ -53,13 +53,12 @@ fi # Depend on lsb-base (>= 3.0-6) to ensure that this file is present. . /lib/lsb/init-functions -# Some defaults: -MOUNTP="/mnt/casper-snapshot" -COW="/cow" +MOUNTP="" +COW="" DEV="" -DEST="${MOUNTP}/casper-sn.cpio.gz" -TYPE="cpio" -DESKTOP_LINK=/home/$USERNAME/Desktop/casper-snapshot +DEST="" +TYPE="" +DESKTOP_LINK="" Header () { @@ -95,7 +94,7 @@ Help () echo " -d, --device: specifies the output snapshot device (default: none)." echo " -o, --output: specifies the output image file (default: $type dependent)." echo " -r, --resync-string: internally used to resync previous made snapshots." - echo " -t,--type: specifies the snapshot type between \'squashfs\', \'ext2\' or \'cpio\'.gz archive (default: cpio)" + echo " -t, --type: specifies the snapshot type between \"squashfs\", \"ext2\" or \"cpio\".gz archive (default: cpio)" echo -e "\nLook at casper-snapshot(1) man page for more information." exit 0 } @@ -224,6 +223,13 @@ Mount_device () Defaults () { + MOUNTP="/mnt/casper-snapshot" + COW="/cow" + DEV="" + DEST="${MOUNTP}/casper-sn.cpio.gz" + TYPE="cpio" + DESKTOP_LINK=/home/$USERNAME/Desktop/casper-snapshot + if [ -n "${SNAP_RSTRING}" ]; then COW=$(echo "${SNAP_RSTRING}" | cut -f1 -d ':') DEV=$(echo "${SNAP_RSTRING}" | cut -f2 -d ':') @@ -264,13 +270,13 @@ Defaults () #if Is_same_mount fi - Mount_device $DEV - DEST="${MOUNTP}/${DEST}" - # check vars if [ ! -d "${COW}" ]; then Usage "Error: ${COW} is not a directory" fi + + Mount_device $DEV + } Clean () diff --git a/debian/changelog b/debian/changelog index c39b541..4b85a68 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +casper (1.77+debian-5) unstable; urgency=low + + * Fixed preseeding locale and keyboard's variant and options. + * Reorganized scans of /proc/cmdline. + * Improved manpages, thanks to Oliver Osburg for syntax corrections. + * Added "nopersistent" boot option to disable the "persistent" boot param. + * Added "xdebconf" boot option, that uses xdebconfigurator on the + rootfs to configure X (experimental). + + -- Marco Amadori Mon, 20 Nov 2006 22:12:18 +0100 + casper (1.77+debian-4) unstable; urgency=medium * Removed -phigh from casper-reconfigure, not needed anymore. diff --git a/debian/manpage/casper-snapshot.1 b/debian/manpage/casper-snapshot.1 index 3cd5309..8f27412 100644 --- a/debian/manpage/casper-snapshot.1 +++ b/debian/manpage/casper-snapshot.1 @@ -30,27 +30,28 @@ casper-snapshot \- a simple script to ease persistence usage. .RB \-v \||\| \-\-version .SH DESCRIPTION -Casper-snapshot is a script useful to build the right types of persistent image files supported by casper, it is also used on exit by the casper init script to resync the boot-found snapshots devices. +Casper-snapshot is a script which can be used to build the right types of persistent image files supported by casper. It is also used on exit by the casper init script to resync the boot-found snapshots devices. .SH OPTIONS .TP .BI "\-c, \-\-cow" DIRECTORY specifies the input directory to be cloned in the image file. -This parameters often does not need to be specified as the default of "/cow" for it should be right for most uses, however it could be handy to specify "/home" and type ext2 for the type to prepare an image file suited to be directly mounted by casper as home. +Its default value "/cow" should be right for most uses. However it could be handy to specify "/home" and type ext2 for the type to prepare an image file suited to be directly mounted by casper as home. .TP .BI "\-d, \-\-device" DEVICE -the device on where the media which the snapshot/persistence file/partition will be put. If not specified a tmpfs will be used and linked on user's desktop to move it where he/her wants. If the device has not a filesystem on it, an ext2 fs will be created in it and labeled like --output options or with a sane default. +sets the device where the media which the snapshot/persistence file/partition will be put. If it is not specified, a tmpfs will be used and linked to the user's desktop to move it where it is needed. If the device has no filesystem, an ext2 fs will be automatically created and labelled according to the values specified after the "--output" value or with a sane default. .TP .BI "\-e, \-\-exclude\-list" FILE -you could pass a list of filenames/path that should not be saved. This exclude list will be remebered on the target snapshotting media for reuse. +a file containing a list of filenames/paths that should not be saved. This exclude list will be remebered on the target snapshot media for reuse. .TP .BI "\-o, \-\-output" FILE -the filename/label to be used for the output file/partition, if left blank it could search for a proper file on the device or use the whole partition. +the filename/label used for the output file/partition. If left blank, casper-snapshot will search for a proper file on the device or use the whole partition. .TP .BI "\-r, \-\-resync\-string" STRING internally used on resyncs. .TP .BI "\-t, \-\-type" TYPE +Type could be one of "cpio", "squashfs" or "ext2". .SH BUGS .B casper-snapshot diff --git a/debian/manpage/casper.7 b/debian/manpage/casper.7 index 6b2bc6f..aac3eca 100644 --- a/debian/manpage/casper.7 +++ b/debian/manpage/casper.7 @@ -8,53 +8,65 @@ casper \- a hook for initramfs-tools to boot live systems. As kernel parameter boot prompt. .SH DESCRIPTION -Casper is an hook for initramfs-tools used to generate initramfs able to boot live systems like those created by make-live, this includes the Debian-Live isos, netboot tarballs, and usb stick image and Ubuntu live cds. At boot time it will look for a (often read-only) media containing a "/casper" directory where root filesystems (often squashfs compressed) lies and create, using unionfs, a writable environment for debian like systems to boot from. +Casper is a hook for initramfs-tools used to generate an initramfs capable to boot live systems as those created by make-live. This includes the Debian-Live isos, netboot tarballs, and usb stick images and Ubuntu live cds. At boot time it will look for a (read-only) media containing a "/casper" directory where a root filesystems (often a compressed squashfs) is stored. If found, it will create a writable environment, using unionfs, for debian like systems to boot from. .SH RECOGNIZED BOOT OPTIONS .TP .B casper-getty -This enable a special serial login shell (experimental). +This enables a special "serial" login shell (experimental). +.TP +.B xdebconf +uses xdebconfigurator, if present on the rootfs, to configure X instead of the standard procedure (experimental). .TP .BI "hostname=" HOSTNAME " , userfullname=" USERFULLNAME " , username=" USERNAME Those parameters lets you override values read from the config file. .TP -.BI "keyb=" KEYBOARD " | kbd-chooser/method=" KEYBOARD " ; console-setup/layoutcode=" LAYOUT " , console-setup/variantcode=" VARIANT " , console-setup/modelcode" CODE -Configure the running keyboard as specified, if this one misses casper behave as "keyb=us" was specified. It will be interfered from "locale=" if locale is only 2 lowecase letters as a special case. You could also specify layout, variant, and code (no defaults). +.BI "{keyb|kbd-chooser/method}=" KEYBOARD " , {klayout|console-setup/layoutcode}=" LAYOUT " , {kvariant|console-setup/variantcode}=" VARIANT " , {kmodel|console-setup/modelcode}=" CODE " , koptions=" OPTIONS +Configure the running keyboard as specified, if this one misses casper behaves as if "keyb=us" was specified. It will be interfered from "locale=" if locale is only 2 lowecase letters as a special case. You could also specify console layout, variant, code, and options (no defaults). .TP .BI ip= IFACE,ADDRESS,NETMASK,GATEWAY [ :IFACE,ADDRESS,NETMASK,GATEWAY "]*" -Let you specify the name(s) and the options of the interface(s) that should be configured at boot time. Do not specify it if you want to use dhcp (default). +Let you specify the name(s) and the options of the interface(s) that should be configured at boot time. Do not specify this if you want to use dhcp (default). .TP .BR ip[= frommedia ] -This way dhcp and static configuration is just skipped and the system will use the (must be) media-preconfigured /etc/network/interfaces instead. +If this variable is set, dhcp and static configuration are just skipped and the system will use the (must be) media-preconfigured /etc/network/interfaces instead. .TP .BI "locale=" LOCALE " | debian-installer/locale=" LOCALE Configure the running locale as specified, if not present the live-media rootfs configured locale will be used and if also this one misses casper behave as "locale=en_US.UTF-8" was specified. If only 2 lowercase letter are specified (like "it"), the "maybe wanted" locale is generated (like it:IT.UTF-8), in this case if also "keyb=" is unspecified is set with those 2 lowercase letters (keyb=it). .TP -.BI live-media= DEVICE " | bootfrom=" DEVICE -If you specify one of this two equivalent forms, casper will try first to look on this device for the "/casper" directory where it should lie the read-only root filesystem, if it did not find it, the normal scan for block devices will be performed. +.BI "{live-media|bootfrom}=" DEVICE +If you specify one of this two equivalent forms, casper will first try to find this device for the "/casper" directory where the read-only root filesystem should reside. If it did not find something usable, the normal scan for block devices is performed. .TP .BR "netboot[=" nfs "|" cifs ] -This tells casper to look for a network mount, to be specified by parameter "nfsroot=" (with optional "nfsopts="), for the "/casper" dirs where root filesystem lies. With no args, will try cifs first, and if it fails nfs. +This tells casper to perform a network mount. The parameter "nfsroot=" (with optional "nfsopts="), should specify where is the location of the root filesystem. With no args, will try cifs first, and if it fails nfs. .TP .B persistent -Casper will look for persistent and snapshot partitions or files labeled "casper-rw", "home-rw", and files called "casper-sn*", "home-sn*" and will try to, in order: mount as /cow the first, mount the second in /home, and just copy the contents of the latters in appropriate locations (snapshots). Snapshots will be tried to be updated on reboot/shutdown. Look at casper-snapshot(1) for more informations. +Casper will look for persistent and snapshot partitions or files labeled "casper-rw", "home-rw", and files called "casper-sn*", "home-sn*" and will try to, in order: mount as /cow the first, mount the second in /home, and just copy the contents of the latter in appropriate locations (snapshots). Snapshots will be tried to be updated on reboot/shutdown. Look at casper-snapshot(1) for more informations. +.TP +.B nopersistent +disables the above mentioned "persistent" feature, useful if the bootloader (like syslinux) has been installed with persistent enabled. .TP .B "showmounts" -Specifying this will make casper to show on "/" the ro filesystems (mostly compressed) on /casper. This is not enabled by default because could lead to problems by application like "mono" which store binary paths on installation. +This parameter will make casper to show on "/" the ro filesystems (mostly compressed) on /casper. This is not enabled by default because could lead to problems by applications like "mono" which store binary paths on installation. .TP .BI "todisk=" DEVICE -Adding this parameter, casper will try to copy to the specified device the whole read-only media before mounting the root filesystem, it could need a lot of free space, according to one used by the read-only media. Subsequent boots should then skip this step and just specify the "live-media=DEVICE" boot parameter with the same DEVICE used this time. +Adding this parameter, casper will try to copy the entire read-only media to the specified device before mounting the root filesystem. It probably needs a lot of free space. Subsequent boots should then skip this step and just specify the "live-media=DEVICE" boot parameter with the same DEVICE used this time. .TP .B toram -Adding this parameter, casper will try to copy to ram the whole read-only media before mounting the root filesystem, it could need a lot of ram, according to the space used by the read-only media. +Adding this parameter, casper will try to copy the whole read-only media to the computer's RAM before mounting the root filesystem. This could need a lot of ram, according to the space used by the read-only media. +.TP +.BI "{preseed/file|file}=" FILE +A path to a file present on the rootfs could be used to preseed debconf database. +.TP +.BI "package/question=" VALUE +All debian installed packages could be preseeded from command-line that way, beware of blanks spaces, they will interfere with parsing, use a preseed file in this case. .SH FILES .B /etc/casper.conf -some variables could be configured via this config file. +some variables can be configured via this config file. .SH BUGS .B casper -works fully on amd64, i386 and ppc, it should too on other archs. +works fully on amd64, i386 and ppc, it should also run on other archs. .SH HOMEPAGE Debian Live project diff --git a/scripts/casper b/scripts/casper index f932c65..8cfc0df 100644 --- a/scripts/casper +++ b/scripts/casper @@ -29,6 +29,7 @@ fi parse_cmdline () { + PRESEEDS= # looking for casper specifics options as kernel parameters for x in $(cat /proc/cmdline); do case $x in @@ -46,14 +47,20 @@ parse_cmdline () ;; netboot*) export NETBOOT=${x#netboot=} ;; + access=*) + export ACCESS=${x#access=} ;; + xdebconf) + export XDEBCONF="Yes" ;; toram) - export TORAM=1 ;; + export TORAM="Yes" ;; todisk=*) export TODISK=${x#todisk=} ;; showmounts) - export SHOWMOUNTS=1 ;; + export SHOWMOUNTS="Yes" ;; persistent) - export PERSISTENT=1 ;; + export PERSISTENT="Yes" ;; + nopersistent) + export PERSISTENT="" ;; ip*) STATICIP=${x#ip=} if [ "${STATICIP}" == "" ]; then @@ -62,28 +69,31 @@ parse_cmdline () export STATICIP ;; casper-getty) export CASPERGETTY=1 ;; - console=*) - export DEFCONSOLE=$(sed -e 's%.*console=%console=%' /proc/cmdline) ;; - bootfrom=*) - export LIVEMEDIA=${x#bootfrom=} ;; - live-media=*) - export LIVEMEDIA=${x#live-media=} ;; + bootfrom=*|live-media=*) + export LIVEMEDIA=${x#*=} ;; live-media-timeout=*) export LIVEMEDIA_TIMEOUT=${x#live-media-timeout=} ;; - debian-installer/locale=*) - export LOCALE=${x#debian-installer/locale=} ;; - locale=*) - export LOCALE=${x#locale=} ;; - kbd-chooser/method=*) - export KBD=${x#kbd-chooser/method=} ;; - keyb=*) - export KBD=${x#keyb=} ;; - console-setup/layoutcode=*) - export CSLAYOUT=${x#console-setup/layoutcode=} ;; - console-setup/variantcode=*) - export CSVARIANT=${x#console-setup/variantcode=} ;; - console-setup/modelcode=*) - export CSMODEL=${x#console-setup/modelcode=} ;; + locale=*|debian-installer/locale=*) + export LOCALE=${x#*=} ;; + keyb=*|kbd-chooser/method=*) + export KBD=${x#*=} ;; + klayout=*|console-setup/layoutcode=*) + export KLAYOUT=${x#*=} ;; + koptions=*) + export KOPTIONS=${x#koptions=} ;; + kvariant=*|console-setup/variantcode=*) + export KVARIANT=${x#*=} ;; + kmodel=*|console-setup/modelcode=*) + export KMODEL=${x#*=} ;; + preseed/file=*|file=*) + export LOCATION="${x#*=}" ;; + */*=*) + question="${x%%=*}" + value="${x#*=}" + PRESEEDS="${PRESEEDS}\"${question}=${value}\" " + ;; + console=*) + export DEFCONSOLE=$(sed -e 's%.*console=%console=%' /proc/cmdline) ;; esac done @@ -601,12 +611,6 @@ mountroot() { run_scripts /scripts/casper-bottom [ "$quiet" != "y" ] && log_end_msg - if [ -f /casper.vars ]; then - echo "Casper vars:" - cat /casper.vars - fi - - echo "Casper Log:" exec 1>&6 6>&- exec 2>&7 7>&- cp casper.log "${rootmnt}/var/log/" diff --git a/scripts/casper-bottom/14locales b/scripts/casper-bottom/14locales index 102051b..18ed15e 100755 --- a/scripts/casper-bottom/14locales +++ b/scripts/casper-bottom/14locales @@ -69,6 +69,7 @@ if [ "${set_locale}" ]; then if [ "${BUILD_SYSTEM}" == "Ubuntu" ]; then printf 'LANG="%s"\n' "${LANG}" > "${grep_file}" chroot /root /usr/sbin/locale-gen "${LANG}" + casper-preseed /root debian-installer/locale "${locale}" else printf 'LANG=%s\n' "${LANG}" > "${grep_file}" printf '%s UTF-8\n' "${LANG}" > /root/etc/locale.gen diff --git a/scripts/casper-bottom/19keyboard b/scripts/casper-bottom/19keyboard index fc2baf9..40834d8 100755 --- a/scripts/casper-bottom/19keyboard +++ b/scripts/casper-bottom/19keyboard @@ -1,7 +1,7 @@ #!/bin/sh PREREQ="" -DESCRIPTION="Setting up keyboard..." +DESCRIPTION="Setting up console keyboard..." . /scripts/casper-functions @@ -34,14 +34,14 @@ fi really_export kbd -if [ -n "${CSLAYOUT}" ]; then - cslayout="${CSLAYOUT}" +if [ -n "${KLAYOUT}" ]; then + cslayout="${KLAYOUT}" fi -if [ -n "${CSVARIANT}" ]; then - csvariant="${CSVARIANT}" +if [ -n "${KVARIANT}" ]; then + csvariant="${KVARIANT}" fi -if [ -n "${CSMODEL}" ]; then - csmodel="${CSMODEL}" +if [ -n "${KMODEL}" ]; then + csmodel="${KMODEL}" fi if [ -x /root/bin/setupcon ] && [ -f /root/etc/default/console-setup ]; then @@ -68,5 +68,6 @@ if [ -x /root/bin/setupcon ] && [ -f /root/etc/default/console-setup ]; then else chroot /root /usr/sbin/install-keymap $kbd casper-preseed /root debian-installer/keymap "$kbd" + casper-preseed /root kbd-chooser/method "$kbd" fi log_end_msg diff --git a/scripts/casper-bottom/20xconfig b/scripts/casper-bottom/20xconfig index 98d2929..470f54c 100755 --- a/scripts/casper-bottom/20xconfig +++ b/scripts/casper-bottom/20xconfig @@ -30,6 +30,11 @@ fi mount -n -o bind /sys /root/sys mount -n -o bind /proc /root/proc +if [ -n "${XDEBCONF}" -a -x /root/usr/sbin/xdebconfigurator ]; then + # xdebconfigurator + chroot /root /usr/sbin/xdebconfigurator +fi + if [ "${BUILD_SYSTEM}" == "Ubuntu" ]; then chroot /root debconf-communicate -fnoninteractive casper > /dev/null < /dev/null + if [ -n "${KOPTIONS}" ]; then + setoptions="set xserver-xorg/config/inputdevice/keyboard/options ${KOPTIONS}" + fi + if [ -n "${KVARIANT}" ]; then + setvariant="set xserver-xorg/config/inputdevice/keyboard/variant ${KVARIANT}" + fi + if [ -n "${KMODEL}" ]; then + setmodel="set xserver-xorg/config/inputdevice/keyboard/model ${KMODEL}" + fi + + chroot /root debconf-communicate -fnoninteractive casper > /dev/null <