Re: detecting keyboard layout during boot

2013-05-15 Thread Signore Citizen


On Wed, May 15, 2013, at 07:45 AM, Polytropon wrote:
> On Wed, 15 May 2013 15:53:08 +0200, Matthias Apitz wrote:
> > Hello,
> > 
> > Here on an laptop/netbook EeePC 900 with English keyboard it says:
> > 
> > # dmesg | fgrep kbd
> > kbd1 at kbdmux0
> > atkbdc0:  port 0x60,0x64 irq 1 on acpi0
> > atkbd0:  irq 1 on atkbdc0
> > kbd0 at atkbd0
> > atkbd0: [GIANT-LOCKED]
> > psm0:  irq 12 on atkbdc0
> > 
> > how do I know that the kb layout is English?
> 
> By looking at it. ONLY by looking at it. :-)
> 
> Even if you would remove the built-in keyboard (disconnect the
> flex), you would see that entry. It's not about the keyboard per
> se, it's about the keyboard controller. This interface usually
> is "in parallel" with a PS/2 connector (if present). There is
> no language information in it.
> 
> 
> 
> > > But as you're asking about USB, there is a way. But this way
> > > depends on how the manufacturer cooperates. Let's discuss that.
> > 
> > USB was only meant as the boot device.
> 
> Okay, then I misread it. English is not my native language. :-)
> 
> The logical conclusion: You have no way to find out what keyboard
> is physically installed (or attached via PS/2).
> 
> This _might_ be not entirely true: If you can obtain some hardware
> identification of the eeePC you're using, maybe some kind of ACPI
> string or other vendor and product ID from some component, you could
> guess what "localization" the device has, and then assume what
> keyboard is installed. But that's just a wild guess from my side.
> 
> 
Have you tried dmidecode?

Handle 0x000E, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator: J1A1
Internal Connector Type: None
External Reference Designator: Keyboard
External Connector Type: PS/2
Port Type: Keyboard Port

Handle 0x000F, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator: J1A1
Internal Connector Type: None
External Reference Designator: Mouse
External Connector Type: PS/2
Port Type: Mouse Port


-- 
  Signore Citizen
  [email protected]
___
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[email protected]"


Re: detecting keyboard layout during boot

2013-05-15 Thread Polytropon
On Wed, 15 May 2013 15:53:08 +0200, Matthias Apitz wrote:
> Hello,
> 
> Here on an laptop/netbook EeePC 900 with English keyboard it says:
> 
> # dmesg | fgrep kbd
> kbd1 at kbdmux0
> atkbdc0:  port 0x60,0x64 irq 1 on acpi0
> atkbd0:  irq 1 on atkbdc0
> kbd0 at atkbd0
> atkbd0: [GIANT-LOCKED]
> psm0:  irq 12 on atkbdc0
> 
> how do I know that the kb layout is English?

By looking at it. ONLY by looking at it. :-)

Even if you would remove the built-in keyboard (disconnect the
flex), you would see that entry. It's not about the keyboard per
se, it's about the keyboard controller. This interface usually
is "in parallel" with a PS/2 connector (if present). There is
no language information in it.



> > But as you're asking about USB, there is a way. But this way
> > depends on how the manufacturer cooperates. Let's discuss that.
> 
> USB was only meant as the boot device.

Okay, then I misread it. English is not my native language. :-)

The logical conclusion: You have no way to find out what keyboard
is physically installed (or attached via PS/2).

This _might_ be not entirely true: If you can obtain some hardware
identification of the eeePC you're using, maybe some kind of ACPI
string or other vendor and product ID from some component, you could
guess what "localization" the device has, and then assume what
keyboard is installed. But that's just a wild guess from my side.



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[email protected]"


Re: detecting keyboard layout during boot

2013-05-15 Thread Matthias Apitz
El día Wednesday, May 15, 2013 a las 03:27:24PM +0200, Polytropon escribió:

> On Wed, 15 May 2013 09:35:54 +0200, Matthias Apitz wrote:
> > 
> > Hello,
> > 
> > I have in /etc/rc.conf a line
> > 
> > keymap="german.iso"
> > 
> > to set the keyboard to German; as the system in question is on an USB
> > key for boot and sometimes used in other laptops with QWERTY layout, I
> > would like to have it adapt itself to the actual layout without changing
> > anything before booting in rc.conf and without asking the user to press
> > a key ... is there some way to detect the actual keyboard layout
> > automagically?
> 
> Basically, it's impossible, but it can be made possible by the
> power of FreeBSD. :-)
> 
> Allow me to explain:
> 
> Depending on where the keyboard is attached, some connections
> (AT 5 pin plug, PS/2 6 pin mini-plug) do not offer any means to
> detect what keyboard is connected (or even _if_ a keyboard is
> connected). This case usually applies to keyboards built into
> laptops. You can see that in "dmesg | grep kbd".
> 
> Example:
> 
>   % dmesg | grep kbd
>   kbd1 at kbdmux0
>   atkbdc0:  at port 0x60,0x64 on isa0
>   atkbd0:  irq 1 on atkbdc0
>   kbd0 at atkbd0
>   atkbd0: [GIANT-LOCKED]
>   atkbd0: [ITHREAD]
>   ukbd0:rev 2.00/1.05, addr 5> on usbus1
>   kbd2 at ukbd0
> 
> You see: The AT keyboard controller is detected, kbd0 is available.
> But there is no actual keyboard connected to that PS/2 port. Instead,
> a Sun USB Type 7 keyboard (german layout) is being used here, as
> kbd2.

Hello,

Here on an laptop/netbook EeePC 900 with English keyboard it says:

# dmesg | fgrep kbd
kbd1 at kbdmux0
atkbdc0:  port 0x60,0x64 irq 1 on acpi0
atkbd0:  irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
psm0:  irq 12 on atkbdc0

how do I know that the kb layout is English?

> But as you're asking about USB, there is a way. But this way
> depends on how the manufacturer cooperates. Let's discuss that.

USB was only meant as the boot device.

matthias

-- 
Sent from my FreeBSD netbook

Matthias Apitz   |  - No system with backdoors like Apple/Android
E-mail: [email protected] |  - Never being an iSlave
WWW: http://www.unixarea.de/ |  - No proprietary attachments, no HTML/RTF in 
E-mail
phone: +49-170-4527211   |  - Respect for open standards
___
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[email protected]"


Re: detecting keyboard layout during boot

2013-05-15 Thread Polytropon
On Wed, 15 May 2013 09:35:54 +0200, Matthias Apitz wrote:
> 
> Hello,
> 
> I have in /etc/rc.conf a line
> 
> keymap="german.iso"
> 
> to set the keyboard to German; as the system in question is on an USB
> key for boot and sometimes used in other laptops with QWERTY layout, I
> would like to have it adapt itself to the actual layout without changing
> anything before booting in rc.conf and without asking the user to press
> a key ... is there some way to detect the actual keyboard layout
> automagically?

Basically, it's impossible, but it can be made possible by the
power of FreeBSD. :-)

Allow me to explain:

Depending on where the keyboard is attached, some connections
(AT 5 pin plug, PS/2 6 pin mini-plug) do not offer any means to
detect what keyboard is connected (or even _if_ a keyboard is
connected). This case usually applies to keyboards built into
laptops. You can see that in "dmesg | grep kbd".

Example:

% dmesg | grep kbd
kbd1 at kbdmux0
atkbdc0:  at port 0x60,0x64 on isa0
atkbd0:  irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
atkbd0: [ITHREAD]
ukbd0:  on usbus1
kbd2 at ukbd0

You see: The AT keyboard controller is detected, kbd0 is available.
But there is no actual keyboard connected to that PS/2 port. Instead,
a Sun USB Type 7 keyboard (german layout) is being used here, as
kbd2.

But as you're asking about USB, there is a way. But this way
depends on how the manufacturer cooperates. Let's discuss that.

As you know, every USB device is characterized by two specific
USB numbers: vendor ID and product ID. In some cases, the product
ID is different regarding the language layout, but you need to
test that individually, no standard seems to exist.

Then, you can use the devd.conf file to select per this ID and
load the correct keyboard layout. This is done in the "rc.conf
stage". Prior to this stage, the "kernel stage", you can hardcode
layouts in the kernel config. Last time I checked this stopped
working, I have been told that the use of kbdmux is the reason
for this observation.

Example:

options ATKBD_DFLT_KEYMAP
makeoptions ATKBD_DFLT_KEYMAP=german.iso
options UKBD_DFLT_KEYMAP
makeoptions UKBD_DFLT_KEYMAP=german.iso

Those options would enable a german keyboard layout even in SUM.
Even adding a font for proper display has been possible:

options SC_DFLT_FONT
makeoptions SC_DFLT_FONT=iso

Not sure if this is still supported. Using Umlauts and Eszett is
discouraged in filenames, and the blind knowledge of the US keyboard
layout is quite standard among sysadmins. :-)



As a summery: No soup for you! ;-)




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[email protected]"


Re: detecting keyboard layout during boot

2013-05-15 Thread Ralf Mardorf
On Wed, 2013-05-15 at 09:35 +0200, Matthias Apitz wrote:
> is there some way to detect the actual keyboard layout
> automagically?

I suspect it's impossible to request what keyboard is used, since some
Linux installers ask the user to type some keys, after that
auto-detection does work. Perhaps you only can start a session with a
script, that does ask the user to type and then set up the needed
keyboard map.

___
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[email protected]"