Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 192442

Summary: sys-apps/baselayout-1.12.9-r2: keyboard is set to utf8 only in first console
Product: Gentoo Linux Reporter: Pacho Ramos <pacho>
Component: [OLD] baselayoutAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: normal CC: matej
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: keymaps-initd.diff
keymaps.diff
keymaps.diff

Description Pacho Ramos gentoo-dev 2007-09-13 17:21:32 UTC
Currently, I have to add "kbd_mode -u" to my bash profile for setting my keyboard to utf8 in all consoles. 

I attach a patch to be applied to /etc/init.d/keymaps for fixing this problem

Thanks a lot for fixing this :-)

Portage 2.1.2.12 (default-linux/x86/2007.0, gcc-4.1.2, glibc-2.5-r4, 2.6.22-gentoo-r6 i686)
=================================================================
System uname: 2.6.22-gentoo-r6 i686 Genuine Intel(R) CPU T2300 @ 1.66GHz
Gentoo Base System release 1.12.9
Timestamp of tree: Wed, 12 Sep 2007 22:20:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p17
dev-java/java-config: 1.3.7, 2.0.33-r1
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.9-r2
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.21
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium-m -pipe -fomit-frame-pointer -mfpmath=sse -msse3"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-O2 -march=pentium-m -pipe -fomit-frame-pointer -mfpmath=sse -msse3"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distlocks fixpackages metadata-transfer parallel-fetch sandbox sfperms strict"
GENTOO_MIRRORS="http://mirror.ovh.net/gentoo-distfiles/ "
LANG="es_ES.UTF-8"
LC_ALL="es_ES.UTF-8"
LINGUAS="es es_ES en_US"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/sunrise /usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi aim alsa ape arts asf audiofile avahi avi bash-completion bcmath beagle bitmap-fonts bonobo bzip2 bzlib cairo caps cdb cddb cdparanoia cdr cdrparanoia cli cpdflib cracklib cross crypt css cups curl curlwrappers daap dbus divx4linux dts dv dvb dvd dvdr dvdread emerald encode escreen esd exif fam fbcon ffmpeg firefox flac foomaticdb fortran ftp galago gb gcj gd gif gimp gimpprint glitz glut glx gmp gnome gphoto2 gpm gstreamer gtk gtk2 gtkhtml guile hal iconv imagemagick imlib ipv6 isdnlog jabber jack java jikes jpeg kde kdeenablefinal kdehiddenvisibility latex lcms lesstif libnotify logrotate mac mad mbox midi mikmod mime ming mmap mmx mmxext mng modplug mono motif mp3 mpeg mpi mplayer mudflap musepack musicbrainz nas ncurses nethack nls nocd nptl nptlonly nsplugin ntfs nvidia ogg oggvorbis openal opengl openmp opnegl pam pcmcia pcre pdf pdflib perl pic png pnp posix ppds pppd python qt qt3 qt4 quicktime readline real reflection reiserfs rpm rtc ruby scanner sdl seamonkey session slang slp smp sndfile sockets socks5 speex spell spl sse sse2 sse3 ssl startup-notification svg syslog tcltk tcpd tetex tga theora threads tiff timidity tk truetype truetype-fonts trusted type1-fonts unicode usb userlocales v4l v4l2 vcd videos vim vorbis wifi win32codecs wma wmf wxwindows x86 xcomposite xine xml xorg xpm xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="es es_ES en_US" USERLAND="GNU" VIDEO_CARDS="nvidia nv vesa fbdev"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS


Reproducible: Always
Comment 1 Pacho Ramos gentoo-dev 2007-09-13 17:21:55 UTC
Created attachment 130854 [details, diff]
keymaps-initd.diff
Comment 2 Roy Marples (RETIRED) gentoo-dev 2007-09-20 12:20:35 UTC
I don't see how that fixes anything ....
Comment 3 Pacho Ramos gentoo-dev 2007-09-20 13:55:55 UTC
(In reply to comment #2)
> I don't see how that fixes anything ....
> 

Running /usr/bin/kbd_mode -u in all ttys, not only in first one ... :-|
Comment 4 Roy Marples (RETIRED) gentoo-dev 2007-09-21 09:01:52 UTC
-		/usr/bin/kbd_mode -u
+		for n in $(seq 1 "${RC_TTY_NUMBER}") ; do
+			/usr/bin/kbd_mode -u
+		done

How is that running it in other ttys? You're just running it more times.
Comment 5 Pacho Ramos gentoo-dev 2007-09-21 13:49:22 UTC
(In reply to comment #4)
> -               /usr/bin/kbd_mode -u
> +               for n in $(seq 1 "${RC_TTY_NUMBER}") ; do
> +                       /usr/bin/kbd_mode -u
> +               done
> 
> How is that running it in other ttys? You're just running it more times.
> 

Without this seems that kbd_mode is only run in the first console, with this, it is also run in rest consoles. I token this from /etc/init.d/keymaps...:

        ebegin "Setting terminal encoding to ${termmsg}"
        for n in $(seq 1 "${RC_TTY_NUMBER}") ; do
                echo -n -e ${termencoding} > ${ttydev}${n}
        done
        eend 0

Comment 6 Roy Marples (RETIRED) gentoo-dev 2007-09-21 14:34:19 UTC
> ${ttydev}${n}

That's the bit that tells it which tty to work on.

kbd_mode -u < ${ttydev}${n}

is probably what you want.
Comment 7 Pacho Ramos gentoo-dev 2007-09-21 14:39:29 UTC
(In reply to comment #6)
> > ${ttydev}${n}
> 
> That's the bit that tells it which tty to work on.
> 
> kbd_mode -u < ${ttydev}${n}
> 
> is probably what you want.
> 

I haven't tried this :-|, but seems ok :-)
Comment 8 Pacho Ramos gentoo-dev 2007-09-21 14:42:08 UTC
I get this error restarting service:
/etc/init.d/keymaps: line 39: ${ttydev}${n}: ambiguous redirect

Comment 9 Roy Marples (RETIRED) gentoo-dev 2007-09-21 14:48:13 UTC
You did configure the ttydev and n variables yes?
Comment 10 Pacho Ramos gentoo-dev 2007-09-21 15:08:34 UTC
(In reply to comment #9)
> You did configure the ttydev and n variables yes?
> 

Where should I configure them?

echo -n -e ${termencoding} > ${ttydev}${n} works fine for me, the problem is only with kbd_mode

If I remove the ">" or "<" it doesn't leave this error, but doesn't resolve the problem.

Seems that kbd_mode only works for the console when it's run...

Thanks 
Comment 11 Pacho Ramos gentoo-dev 2007-09-22 09:55:53 UTC
Comment on attachment 130854 [details, diff]
keymaps-initd.diff

Seems that my patch doesn't work also :'(

But the bug is still here:
kbd_mode -u is only executed in first console

I was "fixing" this problem adding kbd_mode -u to my /etc/bash/bashrc, but this causes bug #186707

Does anybody know how kbd_mode -u can be run in all consoles?

Thanks a lot
Comment 12 Pacho Ramos gentoo-dev 2007-09-22 10:37:13 UTC
Created attachment 131581 [details, diff]
keymaps.diff

I found the solution :-D

The attached diff fixes the problem, but upgrading to sys-apps/kbd-1.13-r1 is needed

Thanks :-)
Comment 13 Roy Marples (RETIRED) gentoo-dev 2007-09-22 10:51:19 UTC
You're almost there!

You need to move the ttydev code so it's above your loop and use it in the loop, as the tty names differ sometimes. Maybe move it to the top of the function.
Comment 14 Pacho Ramos gentoo-dev 2007-09-22 11:41:19 UTC
Created attachment 131592 [details, diff]
keymaps.diff

Updated diff ;-)
Comment 15 Roy Marples (RETIRED) gentoo-dev 2007-09-28 12:55:39 UTC
Great job!

OK, this has been added to our svn repo and will be in baselayout-2.0.0_rc5.
I'm not interesting in bumping baselayout-1 just for this.

Thanks
Comment 16 Matěj Laitl 2007-10-15 19:34:31 UTC
(In reply to comment #15)
> Great job!
> 
> OK, this has been added to our svn repo and will be in baselayout-2.0.0_rc5.
> I'm not interesting in bumping baselayout-1 just for this.

When adding this feature to baselayout-2, please also introduce sys-apps/kbd-1.13-r1 dependency (probably inside kernel_linux ? ( ) ), as with my kbd-1.12-r8 /etc/init.s/keymaps complains that -C is unknown switch to kbd_mode and does not set keyboard mode at all. (thus a regression)

I know sys-apps/kbd-1.13-r1 is stable for many arches now, but I have a feeling that dependencies should be stable-state agnostic.

Regards,
   Matěj Laitl

(It looks like normal users do not have bugzie right to reopen other's bugs?)