Package: console-tools
Version: 1:0.2.3dbs-69
Severity: normal
OK, new version, same old bug. For anyone wanting to keep the kernel
font (for whatever reason) and wishing to avoid having Debian set of
software fonts, they will be setting the value of SCREEN_FONT to a null
string in '/etc/console-tools/config', like this:
SCREEN_FONT=
This will result in an error message when '/etc/init.d/console-screen.sh'
is run:
/etc/init.d/console-screen.sh: line 249: [: 1: unary operator expected
To reproduce the error, configure '/etc/console-tools/config' as
indicated above and run the script. To understand why the error
happens, make these changes,
# diff -C 4 console-screen.sh.orig console-screen.sh
*** console-screen.sh.orig 2010-03-02 15:29:07.000000000 -0500
--- console-screen.sh 2010-03-03 08:12:47.000000000 -0500
***************
*** 239,246 ****
--- 239,249 ----
then
dumpkeys < ${DEVICE_PREFIX}1 | sed -f /etc/console-tools/remap |
loadkeys --quiet
fi
# Set LEDS here
+ echo "Setting up keyboard LEDs..."
+ echo '$LEDS=' $LEDS
+ echo '$NUM_CONSOLES=' $NUM_CONSOLES
if [ "$LEDS" != "" ]
then
i=1
while [ $i -le $NUM_CONSOLES ]
and run the script again:
# /etc/init.d/console-screen.sh restart
Setting console screen modes and fonts.
cannot (un)set powersave mode
Setting up keyboard LEDs...
$LEDS= +num
$NUM_CONSOLES=
/etc/init.d/console-screen.sh: line 249: [: 1: unary operator expected
This problem should be solved by code in the setup_fonts() function:
setup_fonts ()
{
[...]
# Try to be cleverer and run for all consoles, but this is run
# _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=$(($NUM_CONSOLES - 1))
[ ${NUM_CONSOLES} -eq 1 ] && NUM_CONSOLES=6
[...]
}
Alas, it doesn't work.
However, moving those "try to be cleverer" lines outside of
setup_fonts() solves the problem. To test, make changes like this:
# diff -C 4 console-screen.sh.orig console-screen.sh
*** console-screen.sh.orig 2010-03-02 15:29:07.000000000 -0500
--- console-screen.sh 2010-03-03 09:03:06.000000000 -0500
***************
*** 62,69 ****
--- 62,77 ----
if test "$CHARMAP" = "UTF-8" ; then
UNICODE_MODE=yes
fi
+ # Try to be cleverer and run for all consoles, but this is run
+ # _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=$(($NUM_CONSOLES - 1))
+ [ ${NUM_CONSOLES} -eq 1 ] && NUM_CONSOLES=6
+
+
unicode_start_stop ()
{
vc=$1
if [ -n "$UNICODE_MODE" -a -z "`eval echo \\$CONSOLE_MAP_vc$vc`" ];
then
***************
*** 121,135 ****
echo 0
fi > /sys/module/vt/parameters/default_utf8
fi
- # Try to be cleverer and run for all consoles, but this is run
- # _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=$(($NUM_CONSOLES - 1))
- [ ${NUM_CONSOLES} -eq 1 ] && NUM_CONSOLES=6
-
# Global default font+sfm
if [ "${SCREEN_FONT}" ]
then
[ "$VERBOSE" != "no" ] && log_action_begin_msg "Setting up general
console font"
--- 129,136 ----
***************
*** 239,246 ****
--- 240,250 ----
then
dumpkeys < ${DEVICE_PREFIX}1 | sed -f /etc/console-tools/remap |
loadkeys --quiet
fi
# Set LEDS here
+ echo "Setting up keyboard LEDs..."
+ echo '$LEDS=' $LEDS
+ echo '$NUM_CONSOLES=' $NUM_CONSOLES
if [ "$LEDS" != "" ]
then
i=1
while [ $i -le $NUM_CONSOLES ]
Now running the script produces no error:
# /etc/init.d/console-screen.sh restart
Setting console screen modes and fonts.
cannot (un)set powersave mode
Setting up keyboard LEDs...
$LEDS= +num
$NUM_CONSOLES= 7
-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (990, 'unstable'), (350, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.33-drt100223-383be5d.100225.desktop.kms (SMP w/4 CPU cores;
PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages console-tools depends on:
ii debconf [debconf-2.0] 1.5.28 Debian configuration management sy
ii libc6 2.10.2-6 Embedded GNU C Library: Shared lib
ii libconsole 1:0.2.3dbs-69 Shared libraries for Linux console
ii lsb-base 3.2-23 Linux Standard Base 3.2 init scrip
Versions of packages console-tools recommends:
ii console-common 0.7.85 basic infrastructure for text cons
ii console-data 2:1.10-3 keymaps, fonts, charset maps, fall
Versions of packages console-tools suggests:
pn kbd-compat <none> (no description available)
-- no debconf information
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]