From 0a8e85ff66e30694a0583614f0ae90c36e8d44f6 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-4. --- bin/casper-reconfigure | 7 ++--- debian/changelog | 14 ++++++++++ debian/manpage/casper.7 | 2 +- scripts/casper | 25 +++++++++++++++--- scripts/casper-bottom/14locales | 20 ++++++++++----- scripts/casper-bottom/19keyboard | 7 ++++- scripts/casper-bottom/20xconfig | 23 ++++++----------- scripts/casper-bottom/23networking | 52 ++++++++++++++++++++++---------------- scripts/casper-functions | 21 ++++++++++++--- 9 files changed, 113 insertions(+), 58 deletions(-) diff --git a/bin/casper-reconfigure b/bin/casper-reconfigure index 7855210..c24c620 100755 --- a/bin/casper-reconfigure +++ b/bin/casper-reconfigure @@ -47,10 +47,7 @@ if [ -z "$version" ]; then exit 0 fi -if [ "${BUILD_SYSTEM}" == "Debian" ]; then - runcommandinroot "$root" dpkg-reconfigure -fnoninteractive --no-reload -phigh "$package" -else - runcommandinroot "$root" dpkg-reconfigure -fnoninteractive --no-reload "$package" -fi +runcommandinroot "$root" dpkg-reconfigure -fnoninteractive --no-reload "$package" + exit 0 diff --git a/debian/changelog b/debian/changelog index b634c5a..c39b541 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,17 @@ +casper (1.77+debian-4) unstable; urgency=medium + + * Removed -phigh from casper-reconfigure, not needed anymore. + * Fixed netboot /etc/network/interfaces generation, thanks to Hadar + . + * Fixed X keyboard setup. Thanks to for the idea. + * Fixed keyboard setup. + * Allow commandline-device to show up late, thanks to Bas Wijnen + for the code and the care (Closes: #397320). + * Urgency is set to medium to try reaching Etch with important + features/bugfixes. + + -- Marco Amadori Mon, 6 Nov 2006 19:00:29 +0100 + casper (1.77+debian-3) unstable; urgency=medium * Fixed "todisk=" parsing. diff --git a/debian/manpage/casper.7 b/debian/manpage/casper.7 index 794ee0d..6b2bc6f 100644 --- a/debian/manpage/casper.7 +++ b/debian/manpage/casper.7 @@ -60,7 +60,7 @@ works fully on amd64, i386 and ppc, it should too on other archs. Debian Live project .SH SEE ALSO -.BR casper-snapshot(1), initramfs-tools(8), make-live(1), make-live.conf(5) +.BR casper-snapshot(1), initramfs-tools(8), make-live(8), make-live.conf(5) .SH AUTHOR casper was written by Tollen Fog Heen , Matt Zimmerman , and Marco Amadori . diff --git a/scripts/casper b/scripts/casper index 32c4517..f932c65 100644 --- a/scripts/casper +++ b/scripts/casper @@ -23,6 +23,10 @@ export USERNAME USERFULLNAME HOSTNAME BUILD_SYSTEM . /scripts/casper-helpers +if [ ! -f /casper.vars ]; then + touch /casper.vars +fi + parse_cmdline () { # looking for casper specifics options as kernel parameters @@ -64,6 +68,8 @@ parse_cmdline () export LIVEMEDIA=${x#bootfrom=} ;; live-media=*) export LIVEMEDIA=${x#live-media=} ;; + live-media-timeout=*) + export LIVEMEDIA_TIMEOUT=${x#live-media-timeout=} ;; debian-installer/locale=*) export LOCALE=${x#debian-installer/locale=} ;; locale=*) @@ -480,12 +486,19 @@ check_dev () } find_livefs() { + timeout="${1}" # first look at the one specified in the command line if [ ! -z "${LIVEMEDIA}" ]; then if check_dev "null" "${LIVEMEDIA}"; then return 0 fi fi + # don't start autodetection before timeout has expired + if [ -n "${LIVEMEDIA_TIMEOUT}" ]; then + if [ "${timeout}" -lt "${LIVEMEDIA_TIMEOUT}" ]; then + return 1 + fi + fi # or do the scan of block devices for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v ram); do devname=$(sys2dev "${sysblock}") @@ -501,7 +514,7 @@ find_livefs() { fi done elif [ "${fstype}" = "squashfs" -o \ - "${fstype}" = "ext3" ] -o \ + "${fstype}" = "ext3" -o \ "${fstype}" = "ext2" ]; then # This is an ugly hack situation, the block device has # an image directly on it. It's hopefully @@ -554,8 +567,8 @@ mountroot() { else # Scan local devices for the image for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13; do - livefs_root=$(find_livefs) - if [ ! -z "${livefs_root}" ]; then + livefs_root=$(find_livefs $i) + if [ -n "${livefs_root}" ]; then break fi sleep 1 @@ -588,6 +601,12 @@ 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 12cfc4b..102051b 100755 --- a/scripts/casper-bottom/14locales +++ b/scripts/casper-bottom/14locales @@ -27,6 +27,7 @@ elif [ -e /root/etc/environment ]; then # Old locales policy fi if [ -n "${grep_file}" ]; then + # use rootfs configured locale locale=$(grep -s 'LANG=' ${grep_file} | sed s/'LANG='// | tr -d '"' ) else grep_file=/root/etc/default/locale @@ -46,27 +47,32 @@ fi if [ "${set_locale}" ]; then if echo "${locale}" | grep -sqE '^[[:lower:]]{2}$' ; then - # input is like "locale=it", so we will convert and setup also the keyboard + # input is like "locale=it", so we will convert and setup also the keyboard if not already set if [ -z "${KBD}" ]; then # FIXME: look if this keyb is supported KBD="${locale}" + really_export KBD fi uploc=$(echo "${locale}" | tr '[a-z]' '[A-Z]') locale="${locale}_${uploc}.UTF-8" fi - LANG=$(grep "^${locale}" /root/usr/share/i18n/SUPPORTED | grep UTF-8 |sed -e 's, .*,,' -e q) + LANG=$(grep "^${locale}" /root/usr/share/i18n/SUPPORTED | grep UTF-8 |sed -e 's, .*,,' -e q) if [ -z "${LANG}" ]; then log_warning_message "Locale ${locale} is unsupported." + locale="en_US.UTF-8" + LANG="${locale}" fi - if [ "${BUILD_SYSTEM}" == "Debian" ]; then - printf 'LANG=%s\n' "${LANG}" >> "${grep_file}" - printf '%s UTF-8\n' "${LANG}" >> /root/etc/locale.gen - chroot /root /usr/sbin/locale-gen - else + really_export LANG + + if [ "${BUILD_SYSTEM}" == "Ubuntu" ]; then printf 'LANG="%s"\n' "${LANG}" > "${grep_file}" chroot /root /usr/sbin/locale-gen "${LANG}" + else + printf 'LANG=%s\n' "${LANG}" > "${grep_file}" + printf '%s UTF-8\n' "${LANG}" > /root/etc/locale.gen + chroot /root /usr/sbin/locale-gen fi fi diff --git a/scripts/casper-bottom/19keyboard b/scripts/casper-bottom/19keyboard index 81cce72..fc2baf9 100755 --- a/scripts/casper-bottom/19keyboard +++ b/scripts/casper-bottom/19keyboard @@ -20,7 +20,7 @@ esac log_begin_msg "$DESCRIPTION" -kbd=us +kbd= cslayout= csvariant= csmodel= @@ -28,7 +28,12 @@ csmodel= # commandline if [ -n "${KBD}" ]; then kbd="${KBD}" +else + kbd=us fi + +really_export kbd + if [ -n "${CSLAYOUT}" ]; then cslayout="${CSLAYOUT}" fi diff --git a/scripts/casper-bottom/20xconfig b/scripts/casper-bottom/20xconfig index 3916f41..98d2929 100755 --- a/scripts/casper-bottom/20xconfig +++ b/scripts/casper-bottom/20xconfig @@ -5,6 +5,7 @@ DESCRIPTION="Configuring X..." . /scripts/casper-functions + prereqs() { echo "$PREREQ" @@ -26,28 +27,20 @@ if [ "$TERM_TYPE" = "serial" ]; then 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=} - ;; - locale=*) - locale=${x#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 < /dev/null < /dev/null +fi -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 +DEBUG_XORG_PACKAGE=1 DEBUG_XORG_DEBCONF=1 casper-reconfigure /root xserver-xorg umount /root/sys umount /root/proc diff --git a/scripts/casper-bottom/23networking b/scripts/casper-bottom/23networking index f410321..2bdf9b0 100755 --- a/scripts/casper-bottom/23networking +++ b/scripts/casper-bottom/23networking @@ -22,9 +22,9 @@ esac log_begin_msg "$DESCRIPTION" if [ "${STATICIP}" == "frommedia" ] && [ -e "$IFFILE" ] ; then - # will use existent /etc/network/interfaces - log_end_msg - exit 0 + # will use existent /etc/network/interfaces + log_end_msg + exit 0 fi cat > "$IFFILE" <> "$IFFILE" <> "$IFFILE" <> "$IFFILE" <> "$IFFILE" <> /casper.vars + fi + eval export "${STRING}"="${VALUE}" +} \ No newline at end of file -- 2.1.4