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
+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.
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>.
. /scripts/casper-helpers
+if [ ! -f /casper.vars ]; then
+ touch /casper.vars
+fi
+
parse_cmdline ()
{
# looking for casper specifics options as kernel parameters
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=*)
}
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}")
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
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
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/"
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
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
log_begin_msg "$DESCRIPTION"
-kbd=us
+kbd=
cslayout=
csvariant=
csmodel=
# commandline
if [ -n "${KBD}" ]; then
kbd="${KBD}"
+else
+ kbd=us
fi
+
+really_export kbd
+
if [ -n "${CSLAYOUT}" ]; then
cslayout="${CSLAYOUT}"
fi
. /scripts/casper-functions
+
prereqs()
{
echo "$PREREQ"
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
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
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}
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
. /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