Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 39864 - [ PATCH ] sys-apps/baselayout /etc/init.d/consolefont multiple vt code fails with kbd-1.12
Summary: [ PATCH ] sys-apps/baselayout /etc/init.d/consolefont multiple vt code fails ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-30 03:57 UTC by Ed Catmur
Modified: 2004-02-08 19:41 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
New consolefont incorporating fixes to bug 39864 and bug 37596 / bug 39863 (consolefont,1.98 KB, text/plain)
2004-01-30 09:08 UTC, Ed Catmur
Details
Corrected version (consolefont,2.00 KB, text/plain)
2004-01-30 17:38 UTC, Ed Catmur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Catmur 2004-01-30 03:57:49 UTC
From /etc/init.d/consolefont:

                        # We patched setfont to have --tty support ...
                        if [ -n "`setfont --help 2>&1 | grep -e '--tty'`" ]
                        then
                                for x in 1 2 3 4 5 6 7 8 9 10
                                do
                                        # Using DEVFS ?
                                        if [ -e /dev/.devfsd ] || \
                                           [ -e /dev/.udev -a -d /dev/vc ]
                                        then
                                                /bin/setfont ${CONSOLEFONT} ${param} \
                                                        --tty=/dev/vc/${x} >/dev/null
                                                retval=$?
                                        else
                                                /bin/setfont ${CONSOLEFONT} ${param} \
                                                        --tty=/dev/tty${x} >/dev/null
                                                retval=$?
                                        fi
                                done
                        else

This is fine for kbd-1.08-r5; however kbd-1.12 supports setting consolefont for
a vt by using the short switch '-C' instead of the long switch '--tty' 
(presumably they applied our patch, changing the option name).

Suggest adding the following code:

                        # then they incorporated the patch with `-C' syntax
                        elif [ -n "`setfont --help 2>&1 | grep -e '-C'`" ]
                        then
                                for x in 1 2 3 4 5 6 7 8 9 10
                                do
                                        # Using DEVFS ?
                                        if [ -e /dev/.devfsd ] || \
                                           [ -e /dev/.udev -a -d /dev/vc ]
                                        then
                                                /bin/setfont ${CONSOLEFONT} ${param} \
                                                        -C /dev/vc/${x} >/dev/null
                                                retval=$?
                                        else
                                                /bin/setfont ${CONSOLEFONT} ${param} \
                                                        -C /dev/tty${x} >/dev/null
                                                retval=$?
                                        fi
                                done

Note: NOTADUPLICATE of bug 37596 as that was filed prior to kbd-1.12 hitting
Portage.
Comment 1 Tim Yamin (RETIRED) gentoo-dev 2004-01-30 08:38:04 UTC
If you'd like to merge this code with the code in bug 37596 comment 5 then I'd be happy to commit this in. Thanks.
Comment 2 Ed Catmur 2004-01-30 09:08:59 UTC
Created attachment 24644 [details]
New consolefont incorporating fixes to bug 39864 and bug 37596 / bug 39863
Comment 3 Ed Catmur 2004-01-30 17:38:39 UTC
Created attachment 24667 [details]
Corrected version

/dev/vc* to /dev/vc/*
/dev/tty* to /dev/tty[0-9]* - only numbered ttys ie vts will be set

Oops.
Comment 4 ferret 2004-02-04 13:47:21 UTC
Thanks, this consolefont script works for me (I use 10 vt's, have 63 nodes in
/dev/vc/* and NONE in /dev/tty[0-9]*)

Could the same treatment be applied to /etc/init.d/numlock and
/etc/init.d/bootsplash please? I can open new bugs w/ patches for these if you
want, just need to know who to assign them too. :)

(by the way, I'm not sure about using /dev/vc/* for bootsplash... it may be quite
slow for 63 vt's... and my suggestion in 37596 of /etc/inittab parsing probably
isn't a great idea :/ )
Comment 5 ferret 2004-02-05 01:44:15 UTC
Err, forget bootsplash, that has a /etc/conf.d variable
Comment 6 Martin Schlemmer (RETIRED) gentoo-dev 2004-02-08 03:08:28 UTC
Here is the patch that goes in:

--
Index: init.d/consolefont
===================================================================
RCS file: /home/cvsroot/gentoo-src/rc-scripts/init.d/consolefont,v
retrieving revision 1.19
diff -u -r1.19 consolefont
--- init.d/consolefont  26 Dec 2003 00:25:24 -0000      1.19
+++ init.d/consolefont  8 Feb 2004 11:02:46 -0000
@@ -12,6 +12,7 @@
 start() {
        local x=
        local param=
+       local sf_param=
        local retval=1
  
        if [ -n "${CONSOLEFONT}" ]
@@ -28,8 +29,16 @@
                        ebegin "Setting user font"
  
                        # We patched setfont to have --tty support ...
-                       if [ -n "`setfont --help 2>&1 | grep -e '--tty'`" ]
+                       if [ -n "`setfont --help 2>&1 | grep -e '--tty'`" -o \
+                            -n "`setfont --help 2>&1 | grep -e '-C'`" ]
                        then
+                               if [ -n "`setfont --help 2>&1 | grep -e '--tty'`" ]
+                               then
+                                       sf_param="--tty="
+                               else
+                                       sf_param="-C "
+                               fi
+
                                for x in 1 2 3 4 5 6 7 8 9 10
                                do
                                        # Using DEVFS ?
@@ -37,11 +46,11 @@
                                           [ -e /dev/.udev -a -d /dev/vc ]
                                        then
                                                /bin/setfont ${CONSOLEFONT} ${param} \
-                                                       --tty=/dev/vc/${x} >/dev/null
+                                                       ${sf_param}/dev/vc/${x} >/dev/null
                                                retval=$?
                                        else
                                                /bin/setfont ${CONSOLEFONT} ${param} \
-                                                       --tty=/dev/tty${x} >/dev/null
+                                                       -${sf_param}/dev/tty${x} >/dev/null
                                                retval=$?
                                        fi
                                done
--

As we need to support stable kbd still.

Also, what is the issue with numlock?  I have:

--
        for tty in $(seq 1 11)
        do
                if [ -e /dev/.devfsd ] || \
                   [ -e /dev/.udev -a -d /dev/vc ]
                then
                        setleds -D +num < /dev/vc/${tty} &>/dev/null
                else
                        setleds -D +num < /dev/tty${tty} &>/dev/null
                fi
        done
--

which should work fine ...
Comment 7 ferret 2004-02-08 19:41:26 UTC
Is bug 39863 fixed now too?