summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2007-09-23 14:46:27 +0200
committerDaniel Baumann <daniel@debian.org>2007-09-23 14:46:27 +0200
commit0a8e85ff66e30694a0583614f0ae90c36e8d44f6 (patch)
tree041cfaabacb5e5d1d090fe30d90cbb0683278b12
parent40c6f4508ec0868d331e346e9d7b1c44cce01966 (diff)
downloadlive-boot-0a8e85ff66e30694a0583614f0ae90c36e8d44f6.tar.gz
live-boot-0a8e85ff66e30694a0583614f0ae90c36e8d44f6.zip
Adding casper 1.77+debian-4.
-rwxr-xr-xbin/casper-reconfigure7
-rw-r--r--debian/changelog14
-rw-r--r--debian/manpage/casper.72
-rw-r--r--scripts/casper25
-rwxr-xr-xscripts/casper-bottom/14locales20
-rwxr-xr-xscripts/casper-bottom/19keyboard7
-rwxr-xr-xscripts/casper-bottom/20xconfig23
-rwxr-xr-xscripts/casper-bottom/23networking52
-rw-r--r--scripts/casper-functions21
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
+ <whadar@gmail.com>.
+ * Fixed X keyboard setup. Thanks to <ascii_77@yahoo.fr> for the idea.
+ * Fixed keyboard setup.
+ * Allow commandline-device to show up late, thanks to Bas Wijnen
+ <wijnen@debian.org> for the code and the care (Closes: #397320).
+ * Urgency is set to medium to try reaching Etch with important
+ features/bugfixes.
+
+ -- Marco Amadori <marco.amadori@gmail.com> 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 <http://live.debian.net/>
.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 <tfheen@canonical.com>, Matt Zimmerman <mdz@canonical.com>, and Marco Amadori <marco.amadori@gmail.com>.
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 <<EOF
+if [ "${BUILD_SYSTEM}" == "Ubuntu" ]; then
+ chroot /root debconf-communicate -fnoninteractive casper > /dev/null <<EOF
set xserver-xorg/autodetect_keyboard true
fset xserver-xorg/autodetect_keyboard seen true
EOF
+else
+ # d-i code not present, so:
+ echo "set xserver-xorg/config/inputdevice/keyboard/layout ${kbd}" | chroot /root debconf-communicate -fnoninteractive casper > /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" <<EOF
@@ -35,15 +35,14 @@ EOF
udevtrigger
-if [ -z "${NETBOOT}" ] ; then
- if [ ! -z "${STATICIP}" ] && [ "${STATICIP}" != "frommedia" ]; then
- parsed=$(echo "${STATICIP}" | sed -e 's/:/ /g')
- for ifline in ${parsed}; do
- ifname="$(echo ${ifline} | cut -f1 -d ',')"
- ifaddress="$(echo ${ifline} | cut -f2 -d ',')"
- ifnetmask="$(echo ${ifline} | cut -f3 -d ',')"
- ifgateway="$(echo ${ifline} | cut -f4 -d ',')"
- cat >> "$IFFILE" <<EOF
+if [ -z "${NETBOOT}" -a -n "${STATICIP}" ] && [ "${STATICIP}" != "frommedia" ]; then
+ parsed=$(echo "${STATICIP}" | sed -e 's/:/ /g')
+ for ifline in ${parsed}; do
+ ifname="$(echo ${ifline} | cut -f1 -d ',')"
+ ifaddress="$(echo ${ifline} | cut -f2 -d ',')"
+ ifnetmask="$(echo ${ifline} | cut -f3 -d ',')"
+ ifgateway="$(echo ${ifline} | cut -f4 -d ',')"
+ cat >> "$IFFILE" <<EOF
auto ${ifname}
iface ${ifname} inet static
address ${ifaddress}
@@ -51,18 +50,27 @@ iface ${ifname} inet static
gateway ${ifgateway}
EOF
- done
- else
- for interface in /sys/class/net/eth* /sys/class/net/ath* /sys/class/net/wlan*; do
- [ -e $interface ] || continue
- i="$(basename $interface)"
- cat >> "$IFFILE" <<EOF
-auto $i
-iface $i inet dhcp
+ done
+else
+ if [ -z "${NETBOOT}" ]; then
+ # default, dhcp assigned
+ method="dhcp"
+ else
+ # make sure that the preconfigured interface would not get reassigned by dhcp
+ # on startup by ifup script - otherwise our root fs might be disconnected!
+ method="manual"
+ fi
+
+ # iterate the physical interfaces and add them to the interfaces list
+ 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 ${method}
EOF
- done
- fi
+ done
fi
log_end_msg
diff --git a/scripts/casper-functions b/scripts/casper-functions
index 9e36db7..2603eba 100644
--- a/scripts/casper-functions
+++ b/scripts/casper-functions
@@ -1,12 +1,25 @@
. /scripts/functions
+. /casper.vars
# Override this so we don't call PROGRESS
log_end_msg()
{
- if [ -x /sbin/usplash_write ]; then
- /sbin/usplash_write "SUCCESS ok"
- fi
- _log_msg "Done."
+ if [ -x /sbin/usplash_write ]; then
+ /sbin/usplash_write "SUCCESS ok"
+ fi
+ _log_msg "Done."
}
+really_export ()
+{
+ STRING="${1}"
+ VALUE="$(eval echo -n \${$STRING})"
+
+ if [ -f /casper.vars ] && cat /casper.vars | grep -sq "export ${STRING}" ; then
+ sed -i -e 's/\('${STRING}'=\).*$/\1'${VALUE}'/' /casper.vars
+ else
+ echo "export ${STRING}=\"${VALUE}\"" >> /casper.vars
+ fi
+ eval export "${STRING}"="${VALUE}"
+} \ No newline at end of file