On Wed, Aug 09, 2006 at 09:34:33AM +0100, Alastair McKinstry wrote:
> Thank you for this patch. I will include it in the next release (within
> the week, I hope).
>
>
> I shall be keeping the '.. done' for the moment, as I believe it is
> useful when running
> init scripts in parallel, and do not wish to experiment with this at
> this stage of
> release preparations, but the overall startup is a good improvement.
To ease your work here is version that behaves exactly like original
one (I think):
--- console-screen.sh.orig 2006-08-09 14:27:11.000000000 +0200
+++ console-screen.sh-new 2006-08-09 14:30:19.000000000 +0200
@@ -82,7 +82,7 @@
# start vcstime
if [ "${DO_VCSTIME}" = "yes" -a -x ${VCSTIME} ] ; then
- echo -n Starting clock on text console: `basename ${VCSTIME}`
+ echo -n Starting clock on text console: ${VCSTIME}
${VCSTIME} ${VCSTIME_OPT} &
echo .
fi
@@ -101,25 +101,26 @@
# _before_ getty and so only one console running. So,
# Set for the first 6 VCs (as they are allocated in /etc/inittab)
NUM_CONSOLES=`fgconsole --next-available`
- NUM_CONSOLES=`expr ${NUM_CONSOLES} - 1`
+ NUM_CONSOLES=$(($NUM_CONSOLES - 1))
[ ${NUM_CONSOLES} -eq 1 ] && NUM_CONSOLES=6
- for vc in `seq 0 ${NUM_CONSOLES}`
+ i=0
+ while [ $i -lt $NUM_CONSOLES ]
do
- ${SETFONT} --tty=${DEVICE_PREFIX}$vc ${SETFONT_OPT} ${SCREEN_FONT}
${SCREEN_FONT_MAP} || { echo " failed."; break; }
- if [ "$vc" -eq ${NUM_CONSOLES} ]; then echo " done."; fi
+ ${SETFONT} --tty=${DEVICE_PREFIX}$i ${SETFONT_OPT} ${SCREEN_FONT}
${SCREEN_FONT_MAP} || { echo " failed."; break; }
+ i=$(($i + 1))
done
+ echo " done."
fi
# Per-VC font+sfm
- PERVC_FONTS="`set | grep "^SCREEN_FONT_vc[0-9]*=" | tr -d \' `"
- if [ "${PERVC_FONTS}" ]
+ VCS="`set | grep '^SCREEN_FONT_vc[0-9]*=' | sed -e 's/^SCREEN_FONT_vc//'
-e 's/=.*//'`"
+ if [ "${VCS}" ]
then
echo -n "Setting up per-VC fonts: "
- for font in ${PERVC_FONTS}
+ for vc in ${VCS}
do
- # extract VC and FONTNAME info from variable setting
- vc=`echo $font | cut -b15- | cut -d= -f1`
+ # extract FONTNAME info from variable setting
eval font=\$SCREEN_FONT_vc$vc
if [ X"$QUIET_PERVC" != X1 ] ; then
echo -n "${DEVICE_PREFIX}${vc}, "
@@ -139,19 +140,18 @@
# Per-VC ACMs
- PERVC_ACMS="`set | grep "^APP_CHARSET_MAP_vc[0-9]*=" | tr -d \' `"
- if [ "${PERVC_ACMS}" ]
+ VCS="`set | grep '^APP_CHARSET_MAP_vc[0-9]*=' | sed -e
's/^APP_CHARSET_MAP_vc//' -e 's/=.*//'`"
+ if [ "${VCS}" ]
then
echo -n "Setting up per-VC ACM's: "
- for acm in ${PERVC_ACMS}
+ for vc in ${VCS}
do
- # extract VC and FONTNAME info from variable setting
- vc=`echo $acm | cut -b19- | cut -d= -f1`
+ # extract FONTNAME info from variable setting
eval acm=\$APP_CHARSET_MAP_vc$vc
if [ X"$QUIET_PERVC" != X1 ] ; then
echo -n "${DEVICE_PREFIX}${vc} ($acm), "
fi
- eval "${CHARSET} --tty='${DEVICE_PREFIX}$vc' G0 '$acm'"
+ ${CHARSET} --tty="${DEVICE_PREFIX}$vc" G0 "$acm"
done
echo "done."
fi
@@ -159,18 +159,13 @@
# Go to UTF-8 mode as necessary
#
- ENV_FILE="/dev/null"
+ ENV_FILE=''
[ -r /etc/environment ] && ENV_FILE="/etc/environment"
[ -r /etc/default/locale ] && ENV_FILE="/etc/default/locale"
- for var in LANG LC_ALL LC_CTYPE ; do
- value=$(egrep "^\s*${var}=" $ENV_FILE | tail -n1 | cut -d= -f2)
- eval $var=$value
- done
- CHARMAP=`LANG=$LANG LC_ALL=$LC_ALL LC_CTYPE=$LC_CTYPE locale charmap`
- if test "$CHARMAP" = "UTF-8"
+ [ "$ENV_FILE" ] && CHARMAP=$(set -a && . "$ENV_FILE" && locale charmap)
+ if test "$CHARMAP" = "UTF-8"
then
unicode_start 2> /dev/null || true
-
else
unicode_stop 2> /dev/null|| true
fi
@@ -212,14 +207,16 @@
# Allow user to remap keys on the console
if [ -r /etc/console-tools/remap ]
then
- dumpkeys < ${DEVICE_PREFIX}1 |sed -f /etc/console-tools/remap |loadkeys
--quiet
+ dumpkeys < ${DEVICE_PREFIX}1 | sed -f /etc/console-tools/remap |
loadkeys --quiet
fi
# Set LEDS here
if [ "$LEDS" != "" ]
then
- for i in `seq 1 ${NUM_CONSOLES}`
+ i=1
+ while [ $i -lt $NUM_CONSOLES ]
do
setleds -D $LEDS < $DEVICE_PREFIX$i
+ i=$(($i + 1))
done
fi
}
I hope I didn't break anything... Thanks!
--
This signature intentionally says nothing.
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]