diff options
| author | Daniel Baumann <daniel@debian.org> | 2007-09-23 14:46:27 +0200 |
|---|---|---|
| committer | Daniel Baumann <daniel@debian.org> | 2007-09-23 14:46:27 +0200 |
| commit | 0a8e85ff66e30694a0583614f0ae90c36e8d44f6 (patch) | |
| tree | 041cfaabacb5e5d1d090fe30d90cbb0683278b12 /scripts/casper-bottom | |
| parent | 40c6f4508ec0868d331e346e9d7b1c44cce01966 (diff) | |
| download | live-boot-0a8e85ff66e30694a0583614f0ae90c36e8d44f6.tar.gz live-boot-0a8e85ff66e30694a0583614f0ae90c36e8d44f6.zip | |
Adding casper 1.77+debian-4.
Diffstat (limited to 'scripts/casper-bottom')
| -rwxr-xr-x | scripts/casper-bottom/14locales | 20 | ||||
| -rwxr-xr-x | scripts/casper-bottom/19keyboard | 7 | ||||
| -rwxr-xr-x | scripts/casper-bottom/20xconfig | 23 | ||||
| -rwxr-xr-x | scripts/casper-bottom/23networking | 52 |
4 files changed, 57 insertions, 45 deletions
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 |
