diff options
Diffstat (limited to 'scripts/casper-bottom')
| -rw-r--r-- | scripts/casper-bottom/02etc_casper_conf | 29 | ||||
| -rwxr-xr-x | scripts/casper-bottom/05mountpoints | 6 | ||||
| -rwxr-xr-x | scripts/casper-bottom/14locales | 4 | ||||
| -rwxr-xr-x | scripts/casper-bottom/20xconfig | 3 | ||||
| -rwxr-xr-x | scripts/casper-bottom/23networking | 7 | ||||
| -rwxr-xr-x | scripts/casper-bottom/24preseed | 4 | ||||
| -rwxr-xr-x | scripts/casper-bottom/25configure_init | 29 |
7 files changed, 73 insertions, 9 deletions
diff --git a/scripts/casper-bottom/02etc_casper_conf b/scripts/casper-bottom/02etc_casper_conf new file mode 100644 index 0000000..fd19ac9 --- /dev/null +++ b/scripts/casper-bottom/02etc_casper_conf @@ -0,0 +1,29 @@ +#!/bin/sh + +PREREQ="" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + + +if [ -f /etc/casper.conf ] ; then + cp -p /etc/casper.conf /root/etc/casper.conf +else + cat <<EOF >/root/etc/casper.conf +export USERNAME="$USERNAME" +export USERFULLNAME="$USERFULLNAME" +export HOST="$HOST" +EOF + +fi + diff --git a/scripts/casper-bottom/05mountpoints b/scripts/casper-bottom/05mountpoints index 33f265d..20a28fd 100755 --- a/scripts/casper-bottom/05mountpoints +++ b/scripts/casper-bottom/05mountpoints @@ -21,7 +21,9 @@ esac log_begin_msg "$DESCRIPTION" # Move to the new root filesystem so that programs there can get at it. -mkdir -p /root/live_media -mount -n -o move /live_media /root/live_media +if [ ! -d /root/live_media ]; then + mkdir -p /root/live_media + mount -n -o move /live_media /root/live_media +fi log_end_msg diff --git a/scripts/casper-bottom/14locales b/scripts/casper-bottom/14locales index 0d4e171..ebe7616 100755 --- a/scripts/casper-bottom/14locales +++ b/scripts/casper-bottom/14locales @@ -34,6 +34,10 @@ for x in $(cat /proc/cmdline); do locale=${x#debian-installer/locale=} set_locale="true" ;; + locale=*) + locale=${x#locale=} + set_locale="true" + ;; esac done diff --git a/scripts/casper-bottom/20xconfig b/scripts/casper-bottom/20xconfig index 840200d..b8a4552 100755 --- a/scripts/casper-bottom/20xconfig +++ b/scripts/casper-bottom/20xconfig @@ -33,6 +33,9 @@ for x in $(cat /proc/cmdline); do debian-installer/locale=*) locale=${x#debian-installer/locale=} ;; + locale=*) + locale=${x#locale=} + ;; esac done diff --git a/scripts/casper-bottom/23networking b/scripts/casper-bottom/23networking index ca7dd13..10d4ab2 100755 --- a/scripts/casper-bottom/23networking +++ b/scripts/casper-bottom/23networking @@ -27,14 +27,9 @@ iface lo inet loopback EOF -if [ -x /sbin/udevplug ]; then - udevplug -Bpci -Iclass="0x02*" -else - udevtrigger -fi +udevtrigger if [ -z "${NETBOOT}" ] ; then - for interface in /sys/class/net/eth* /sys/class/net/ath* /sys/class/net/wlan*; do [ -e $interface ] || continue i="$(basename $interface)" diff --git a/scripts/casper-bottom/24preseed b/scripts/casper-bottom/24preseed index 468ec2e..98a9864 100755 --- a/scripts/casper-bottom/24preseed +++ b/scripts/casper-bottom/24preseed @@ -31,6 +31,10 @@ for x in $(cat /proc/cmdline); do value="${x#*=}" casper-preseed /root "$question" "$value" ;; + locale=*) + value="${x#*=}" + casper-preseed /root debian-installer/locale "$value" + ;; esac done diff --git a/scripts/casper-bottom/25configure_init b/scripts/casper-bottom/25configure_init index 7c39478..010e2eb 100755 --- a/scripts/casper-bottom/25configure_init +++ b/scripts/casper-bottom/25configure_init @@ -23,7 +23,34 @@ log_begin_msg "$DESCRIPTION" # Arrange for shells on virtual consoles, rather than login prompts if [ -n "$USERNAME" ]; then - sed -i -e "s|^\([^:]*:[^:]*:[^:]*\):.*getty.*\<\(tty[0-9].*\).*$|\1:/bin/login -f $USERNAME </dev/\2 >/dev/\2 2>\&1|" /root/etc/inittab + if [ -z "${CASPERGETTY}" ]; then + sed -i -e "s|^\([^:]*:[^:]*:[^:]*\):.*getty.*\<\(tty[0-9].*\).*$|\1:/bin/login -f $USERNAME </dev/\2 >/dev/\2 2>\&1|" /root/etc/inittab + else + sed -i -e'/^[^#]/s%respawn:/sbin/getty%respawn:/sbin/casper-getty%' /root/etc/inittab + # AUTOMATIC SERIAL CONSOLE # + defconsole=$(sed -e 's%.*console=%console=%' /proc/cmdline) + if echo "${defconsole}" | grep -qs console=ttyS; then + PORT=$(echo "${defconsole}" | \ + sed -e's%^console=%%' -e's%,.*%%') + SPEED=$(echo "${defconsole}" | \ + sed -e 's%^console=ttyS[0-9]\+,%%' \ + -e's%\([0-9]\+\).*%\1%') + if ! ( sed -n -e'/^[^#]/p' /root/etc/inittab | grep -qs ":respawn:/sbin/getty.*${PORT}" ) ; then + IDs="A B C D E F G H I J K L M N O P Q R S T Q U V V X Y Z 0 1 2 3 4 5 6 7 8 9" + for ID1 in $IDs; do + for ID2 in $IDs; do + ID="${ID1}${ID2}" + if ! grep "^${ID}:" /etc/inittab ; then + #make sure it is not already in use + break 2 + fi + done + done + echo "${ID}:2345:respawn:/sbin/casper-getty -L ${PORT} ${SPEED} vt100" \ + >>/root/etc/inittab + fi + fi + fi fi # This has the nice side effect of the cron.{daily,weekly,monthly} jobs in |
