Opened 12 years ago

Closed 12 years ago

#614 closed defect (fixed)

SLES keyboard mapping is wrongly set at boot

Reported by: victor gattegno Owned by: Bruno Cornec
Priority: normal Milestone: 3.0.3
Component: mindi Version: 3.0.1
Severity: normal Keywords: mindi keyboard
Cc:

Description

The SLES 10 keyboard mapping is wrong at boot, it is mapped to cz-lat2-us.map instead of being mapped to us.map

I checked mondorestore.log

Using /usr/share/kbd/keymaps/i386/qwerty/cz-lat2-us.map.gz keyboard map.

I checked the server keyboard config:

/etc/sysconfig> grep -vE "^$|^#" keyboard
KEYTABLE="us.map.gz"
KBD_DELAY=""
KBD_RATE=""
KBD_NUMLOCK="bios"
KBD_SCRLOCK="no"
KBD_CAPSLOCK="no"
KBD_DISABLE_CAPS_LOCK="no"
KBD_TTY="tty1 tty2 tty3 tty4 tty5 tty6"
COMPOSETABLE="clear winkeys shiftctrl latin1.add"
YAST_KEYBOARD="english-us,pc104"

I checked the us.map keyboards

/usr/share/kbd/keymaps/i386> find . -print | grep us.map
./qwerty/cz-lat2-us.map.gz
./qwerty/br-latin1-us.map.gz
./qwerty/us.map.gz
./qwerty/is-latin1-us.map.gz

So it seems that mindi takes the first one (cz-lat2-us.map.gz) instead of taking us.map.gz.

Attachments (12)

mondorestore.log (308.5 KB ) - added by victor gattegno 12 years ago.
mondoarchive.log.gz (33.8 KB ) - added by victor gattegno 12 years ago.
3-mindi-xv-us.map-grep-solution-too.log.gz (244.2 KB ) - added by victor gattegno 12 years ago.
Result of : # sh -xv /usr/sbin/mindi < /dev/null 2>&1 | tee 3-mindi-xv-us.map-grep-solution-too.log
mindi-with-the-2-solutions (120.0 KB ) - added by victor gattegno 12 years ago.
/usr/sbin/mindi with the 2 solutions for us.map keyboard problem
mindi.log-with-the-2-solutions (176.2 KB ) - added by victor gattegno 12 years ago.
mindi.log with my 2 solutions
mindi-us-ok.log (179.4 KB ) - added by victor gattegno 12 years ago.
mindi.log for us.map.gz - result ok
mindi-xv-us-ok.log.gz (248.1 KB ) - added by victor gattegno 12 years ago.
mindi debug for us.map.gz - result ok
mindi-fr-latin1-ok.log (178.7 KB ) - added by victor gattegno 12 years ago.
mindi.log for fr-latin1.map.gz - result ok
mindi-xv-fr-latin1-ok.log.gz (247.4 KB ) - added by victor gattegno 12 years ago.
mindi debug for fr-latin1.map.gz - result ok
pb-clavier.jpg (221.6 KB ) - added by victor gattegno 12 years ago.
screenshot with error: cannot open include file azerty-layout
mindi2.1.2.log (175.8 KB ) - added by victor gattegno 12 years ago.
mindi 2.1.2 log from a SLES 10 SP3 mondoarchived
mondoarchive3.0.2.log (329.6 KB ) - added by victor gattegno 12 years ago.
mondoarchive 3.0.2 log from SLES 10 (AZERTY keyboard) mondoarchived

Change History (32)

comment:1 by victor gattegno, 12 years ago

I don't see any mindi (line 368) FindAndAddUserKeyboardMappingFile() echoes in mindi.log file nor in mondoarchive.log file.

As we have in the SLES server /etc/sysconfig/keyboard, we should see the following lines in log files, but we don't see it:

"Red Hat-style config detected."
"keyfile=us.map.gz"

comment:2 by victor gattegno, 12 years ago

Note : "comment 1" is just a remark.

by victor gattegno, 12 years ago

Attachment: mondorestore.log added

by victor gattegno, 12 years ago

Attachment: mondoarchive.log.gz added

comment:3 by victor gattegno, 12 years ago

I put mindi in debug mode and I found a solution.

mindi 2.1.1 line 438 should be changed

locale=`grep -F KEYTABLE "$keyfile" | tr -d '"' |cut -d'=' -f2`

because, on my SLES 10 SP3 I get :

# grep -F KEYTABLE /etc/sysconfig/keyboard

# e.g. KEYTABLE="de-latin1-nodeadkeys", "us" or empty for US settings
KEYTABLE="fr-latin1.map.gz"
#  or KEYTABLE will be used then -- most keyboard maps don't have a

# grep -F KEYTABLE /etc/sysconfig/keyboard | tr -d '"' |cut -d'=' -f2

de-latin1-nodeadkeys, us or empty for US settings
fr-latin1.map.gz
#  or KEYTABLE will be used then -- most keyboard maps don't have a

So I propose this solution for mindi 2.1.1 line 438:

locale=`grep -v "^#" /etc/sysconfig/keyboard | grep -F KEYTABLE| tr -d '"'  |cut -d'=' -f2` 

With my solution I get:

# echo $locale
fr-latin1.map.gz

comment:4 by victor gattegno, 12 years ago

With the other server (KEYTABLE="us.map.gz), I get us.map.gz with my solution.

comment:5 by victor gattegno, 12 years ago

There is a second problem, in mindi, line 447, We can see:

mp=.................. | grep -F "/${locale}."

Then the search through that grep fails because it's done on:

grep -F /us.map.gz.

I don't know if the dot (.) was useful for another GNU/Linux distrib, but For SUSE, I propose to change that grep to:

grep -F "/${locale}"

comment:6 by victor gattegno, 12 years ago

I tested my 2 solutions and it works, I now have the good us.map.gz mapping saved by mindi.

Here are the two modifications :

# diff mindi mindi-orig
438c438
<       locale=`grep -v "^#" "$keyfile" | grep -F KEYTABLE | tr -d '"' |cut -d'=' -f2`
---
>       locale=`grep -F KEYTABLE "$keyfile" | tr -d '"' |cut -d'=' -f2`
447c447
<       mp=`grep "i[3-8]86" $MINDI_TMP/keymaps.find | grep -F "/${locale}" | grep -vx " *#.*"`
---
>       mp=`grep "i[3-8]86" $MINDI_TMP/keymaps.find | grep -F "/${locale}." | grep -vx " *#.*"`

And the result, in "3-mindi-xv-us.map-grep-solution-too.log" file created through: # sh -xv /usr/sbin/mindi < /dev/null 2>&1 | tee 3-mindi-xv-us.map-grep-solution-too.log

Line 65672 :
grep "i[3-8]86" $MINDI_TMP/keymaps.find | grep -F "/${locale}" | grep -vx " *#.*"
++ grep 'i[3-8]86' /tmp/mindi.jGXAJb7152/keymaps.find
++ grep -F /us.map.gz
++ grep -vx ' *#.*'
+ mp=/usr/share/kbd/keymaps/i386/qwerty/us.map.gz

Line 65690 :
+ echo -en 'Adding the following keyboard mapping tables: '
Adding the following keyboard mapping tables: + mkdir -p /tmp/mindi.jGXAJb7152/bigdir/tmp
+ echo /usr/share/kbd/keymaps/i386/qwerty/us.map.gz
+ KBDEPTH=0
+ AddKeyboardMappingFile /usr/share/kbd/keymaps/i386/qwerty/us.map.gz
+ local mappath r included_list included_item i res ii sss
+ mappath=/usr/share/kbd/keymaps/i386/qwerty/us.map.gz

by victor gattegno, 12 years ago

Result of : # sh -xv /usr/sbin/mindi < /dev/null 2>&1 | tee 3-mindi-xv-us.map-grep-solution-too.log

by victor gattegno, 12 years ago

Attachment: mindi-with-the-2-solutions added

/usr/sbin/mindi with the 2 solutions for us.map keyboard problem

by victor gattegno, 12 years ago

mindi.log with my 2 solutions

comment:7 by victor gattegno, 12 years ago

The "us.map mapping not saved by mindi" problem is solved by these two modifications.

Bruno will validate the changes.

comment:8 by Bruno Cornec, 12 years ago

Status: newassigned

Thanks Victor for persuing this problem.

I added your grep to avoid comments to perturbte the analysis.

For the addiotnal '.', this is because on RHEL based systems, just the local is given (fr-latin1 or us) whereas we need to find the file with .map.... in the find list.

So I made an adaptation for the SLES case.

All that is in rev [2999], if you want to test it.

comment:9 by victor gattegno, 12 years ago

Thanks Bruno.

I tested your adaptation of the solutions on SLES 10 SP3, with us.map, and with fr-latin1.map, both work well, you'll find attached the mindi.log and mindi-xv debug.

by victor gattegno, 12 years ago

Attachment: mindi-us-ok.log added

mindi.log for us.map.gz - result ok

by victor gattegno, 12 years ago

Attachment: mindi-xv-us-ok.log.gz added

mindi debug for us.map.gz - result ok

by victor gattegno, 12 years ago

Attachment: mindi-fr-latin1-ok.log added

mindi.log for fr-latin1.map.gz - result ok

by victor gattegno, 12 years ago

mindi debug for fr-latin1.map.gz - result ok

comment:10 by victor gattegno, 12 years ago

Results of search ".map.gz" in mindi.log :

mindi-us-ok.log (3 hits)

Line 2248: INFO: mappath = /usr/share/kbd/keymaps/i386/qwerty/us.map.gz
Line 2249: INFO: Added kbd map /usr/share/kbd/keymaps/i386/qwerty/us.map.gz
Line 2264: INFO: Added kbd map /usr/share/kbd/keymaps/i386/include/euro1.map.gz

mindi-fr-latin1-ok.log (2 hits)

Line 2248: INFO: mappath = /usr/share/kbd/keymaps/i386/azerty/fr-latin1.map.gz
Line 2249: INFO: Added kbd map /usr/share/kbd/keymaps/i386/azerty/fr-latin1.map.gz

comment:11 by Bruno Cornec, 12 years ago

Resolution: fixed
Status: assignedclosed

This will be in mindi 2.1.2 then. thanks for your tests and report Victor.

comment:12 by victor gattegno, 12 years ago

I tested the new version (mondo 3.0.1 / mindi 2.1.1) on SLES 10 SP3. The keyboard problem is only partially solved.

In mondoarchive.log, we see that adequate map is selected and saved:

INFO: Adding the following keyboard mapping tables: fr-latin1.map.gz

But, at boot, one file is missing, so the keyboard was not set to AZERTY, on boot screen I see:

Loading /usr/share/kbd/keymaps/i386/azerty/fr-latin1.map.gz
loadkeys: /usr/share/kbd/keymaps/i386/azerty/fr-latin1.map.gz:2: cannot open include file azerty-layout

We should have get instead, in mondoarchive.log (as we get for a RHEL mondo backup):

INFO: Adding the following keyboard mapping tables: fr-latin1.map.gz azerty-layout.inc

Path of azerty-layout.inc in SLES 10 and 11, is:

/usr/share/kbd/keymaps/mac/include/mac-azerty-layout.inc
/usr/share/kbd/keymaps/i386/include/azerty-layout.inc

In other GNU/Linux distribs (RHEL 4, etc.), azerty-layout.inc is in

/lib/kbd/keymaps/i386/include

and is well backuped in all.tar.gz by mondorescue, but SLES azerty-layout.inc path is different.

comment:13 by victor gattegno, 12 years ago

Resolution: fixed
Status: closedreopened

by victor gattegno, 12 years ago

Attachment: pb-clavier.jpg added

screenshot with error: cannot open include file azerty-layout

comment:14 by victor gattegno, 12 years ago

Sorry, my test was not on mindi 2.1.1 and mondo 3.0.1, it was on mindi v2.1.2-r3018 and Mondo Archive v3.0.2-r3018

With mindi 2.1.2, I see in this SLES mindi2.1.2.log:

INFO: Analyzing your keyboard's configuration.
INFO: Red Hat-style config detected.
INFO: keyfile=/etc/sysconfig/keyboard
INFO: locale=fr-latin1
INFO: mappath = /usr/share/kbd/keymaps/i386/azerty/fr-latin1.map.gz
INFO: Added kbd map /usr/share/kbd/keymaps/i386/azerty/fr-latin1.map.gz

We can see that is missing azerty-layout.inc, which was saved by mindi v2.1.1-r2999 (check in mindi-fr-latin1-ok.log).

by victor gattegno, 12 years ago

Attachment: mindi2.1.2.log added

mindi 2.1.2 log from a SLES 10 SP3 mondoarchived

by victor gattegno, 12 years ago

Attachment: mondoarchive3.0.2.log added

mondoarchive 3.0.2 log from SLES 10 (AZERTY keyboard) mondoarchived

comment:15 by victor gattegno, 12 years ago

Note : mindi2.1.2.log and mondoarchive3.0.2.log concern the same mondoarchive backup, on a SLES 10 SP3 with AZERTY keyboard.

The result is that, at boot on mondorescue.iso, we get a QWERTY keyboard, instead of having an AZERTY mapped keyboard.

comment:16 by victor gattegno, 12 years ago

I checked mindi sources : mindi v2.1.1-r2999 vs. official (rev 2.1.1-r3018)

The include files (include/azerty-layout.inc, etc.) are now missing with official mindi (rev 2.1.1-r3018) because line 256 and 258 of /usr/sbin/mindi is missing one of the two sed commands that were present in mindi v2.1.1-r2999 :

sed s/'"'//

In mindi v2.1.1-r2999 :

Lines 255-259 :
  if [ "`echo $mappath | grep -F ".gz"`" ] ; then
    included_list=`gzip -dc $mappath | grep -Fi include | sed s/'"'// | sed s/'"'// | cut -d' ' -f2`
  else
    included_list=`grep -Fi include $mappath | sed s/'"'// | sed s/'"'// | cut -d' ' -f2`
  fi

If I execute it manually, it gives :

# gzip -dc /usr/share/kbd/keymaps/i386/azerty/fr-latin1.map.gz | grep -Fi include | sed s/'"'// | sed s/'"'//   | cut -d' ' -f2
azerty-layout
linux-with-alt-and-altgr

In mindi v2.1.1-r3018 :

Lines 255-259 :
  if [ "`echo $mappath | grep -F ".gz"`" ] ; then
    included_list=`gzip -dc $mappath | grep -Fi include | sed s/'"'// | cut -d' ' -f2`
  else
    included_list=`grep -Fi include $mappath | sed s/'"'// | cut -d' ' -f2`
  fi

If I execute it manually, it gives :

# gzip -dc /usr/share/kbd/keymaps/i386/azerty/fr-latin1.map.gz | grep -Fi include | sed s/'"'//  | cut -d' ' -f2
azerty-layout"
linux-with-alt-and-altgr"

Then, in mindi rev 2.1.1-r3018, the following grep cannot succeed, and then the include files (include/azerty-layout.inc, etc.) are not added to the backup.

comment:17 by victor gattegno, 12 years ago

That new bug can also be solved by replacing in mindi v2.1.1-r3018, lines 256 and 258:

sed s/'"'//

by

sed s/'"'//g

comment:18 by victor gattegno, 12 years ago

On a SLES 11 I modified /usr/sbin/mindi with my solution (sed s/'"'g) and I tested it :

The new bug is solved with my solution, now I get :

# mindi
...
INFO: Analyzing your keyboard's configuration.
INFO: Adding the following keyboard mapping tables: fr-latin1.map.gz mac-azerty-layout.inc azerty-layout.inc linux-with-alt-and-altgr.inc mac-linux-keys-bare.inc linux-keys-bare.inc

And I can see in mindi.log the include files that are now backuped too :

INFO: Analyzing your keyboard's configuration.
INFO: Red Hat-style config detected.
INFO: keyfile=/etc/sysconfig/keyboard
INFO: locale=fr-latin1
INFO: mappath = /usr/share/kbd/keymaps/i386/azerty/fr-latin1.map.gz
INFO: Added kbd map /usr/share/kbd/keymaps/i386/azerty/fr-latin1.map.gz
INFO: Added kbd map /usr/share/kbd/keymaps/mac/include/mac-azerty-layout.inc
INFO: Added kbd map /usr/share/kbd/keymaps/i386/include/azerty-layout.inc
INFO: Added kbd map /usr/share/kbd/keymaps/i386/include/linux-with-alt-and-altgr.inc
INFO: Added kbd map /usr/share/kbd/keymaps/mac/include/mac-linux-keys-bare.inc
INFO: Added kbd map /usr/share/kbd/keymaps/i386/include/linux-keys-bare.inc

comment:19 by victor gattegno, 12 years ago

I pached mindi with my solution(sed s/'"'g), and I tested it by booting a mondorescue.iso created on our DL360 test server.

It works well, I get the good (AZERTY) keyboard at boot.

comment:20 by Bruno Cornec, 12 years ago

Milestone: 3.0.23.0.3
Resolution: fixed
Status: reopenedclosed

Fixed again then in rev [3023]. Thanks for your patch Victor.

Note: See TracTickets for help on using tickets.