Bug 9808

Summary: cannot open file alt_shift_toggle
Product: Mageia Reporter: Yuriy Vermenko <vermenkoyura>
Component: Release (media or process)Assignee: Mageia Bug Squad <bugsquad>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: Low CC: loginov_alex, mageia, mageia, sysadmin-bugs, thierry.vignaud
Version: CauldronKeywords: NEEDINFO
Target Milestone: Mageia 3   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Source RPM: dracut initscripts CVE:
Status comment:
Attachments: boot.log
# lsinitrd > lsinitrd.txt
Patch to fix the issue in dracut

Description Yuriy Vermenko 2013-04-20 12:09:43 CEST
Description of problem:
The boot process starts with messages: cannot open file alt_shift_toggle
This message may be found in file /var/log/boot.log

Version-Release number of selected component (if applicable):
mageia 3 beta 4

Reproducible: 

Steps to Reproduce:
Yuriy Vermenko 2013-04-20 12:10:39 CEST

Priority: Normal => Low
Hardware: i586 => x86_64
Severity: enhancement => minor

Yuriy Vermenko 2013-04-20 12:54:15 CEST

Target Milestone: --- => Mageia 3

Comment 1 Alex Loginov 2013-04-21 19:04:25 CEST
When will be fix? This problem 2 years old. Now in Mageia 3 RC problem is persists.

CC: (none) => loginov_alex

Comment 2 Thierry Vignaud 2013-04-23 01:58:52 CEST
Please attach your /var/log/boot.log

Keywords: (none) => NEEDINFO
CC: (none) => thierry.vignaud

Comment 3 Yuriy Vermenko 2013-04-23 10:51:08 CEST
Created attachment 3791 [details]
boot.log
Comment 4 Thierry Vignaud 2013-04-23 11:06:18 CEST
It's either dracut or initscripts

CC: (none) => mageia
Source RPM: (none) => dracut initscripts

Comment 5 Colin Guthrie 2013-04-23 11:28:51 CEST
[colin@jimmy initscripts (mga-41)]$ git grep alt_shift_toggle
[colin@jimmy initscripts (mga-41)]$
[colin@jimmy dracut (mga-025)]$ git grep alt_shift_toggle
[colin@jimmy dracut (mga-025)]$

Doesn't appear to be in any file in either dracut or initscripts.

Also if it's 2 years old (according to comment 1) then it predates dracut.

Does this happen on a fresh install or is it only on upgrades?
Comment 6 Sander Lepik 2013-04-23 11:36:41 CEST
# find /usr -name '*alt_shift*'
/usr/lib/kbd/keymaps/i386/include/alt_shift_toggle.map.gz
/usr/lib/kbd/keymaps/i386/include/alt_shift_toggle.inc

If that gives any clues..

CC: (none) => sander.lepik

Comment 7 Colin Guthrie 2013-04-23 11:48:09 CEST
OK, so a keymap is likely configured and somehow isn't loaded. I guess tracking down said configuration would be the first step... Perhaps it's not really 2 years old as comment 1 suggests and it's simply due to dracut not copying the keymap to the initrd.

Can you attach output of lsinitrd on a recently generated initrd?
Comment 8 Yuriy Vermenko 2013-04-24 10:29:17 CEST
Created attachment 3800 [details]
# lsinitrd > lsinitrd.txt
Comment 9 Yuriy Vermenko 2013-04-24 10:37:35 CEST
I attached boot.log file from mageia 3 beta 4. But now I install RC.
I write output lsinitrd in Mageia 3 RC. Maybe I need to attach boot.log again?
Comment 10 Colin Guthrie 2013-04-24 11:00:10 CEST
It seems the /usr/lib/kbd/keymaps/i386/include/alt_shift_toggle.inc file is included in the initrd, but not the .map.gz (or uncompressed version thereof).


On my system both the files seem to have the same content:

[colin@jimmy ~]$ cat /usr/lib/kbd/keymaps/i386/include/alt_shift_toggle.inc
# Alt+Shift or AltGr+Shift toggle modes
alt keycode  42 = AltGr_Lock
alt keycode  54 = AltGr_Lock
[colin@jimmy ~]$ zcat /usr/lib/kbd/keymaps/i386/include/alt_shift_toggle.map.gz 
# Alt+Shift or AltGr+Shift toggle modes
alt keycode  42 = AltGr_Lock
alt keycode  54 = AltGr_Lock


Perhaps just renaming the .inc file to .map would be sufficient here...

Actually hunting a bit further, I think I see why this is.

Your actual keyboard map (ru4.uni) does not include this other map, so it must be configured as an "Extra Map".

Now, unfortunately, when looking for maps the scanning code will find the .inc file before it finds the .map* file and thus it will use that in the initrd...

So the scanning code must be modified to favour other file endings before it considers .inc files.


Sadly doing the following on my machine:

$ find /usr/lib/kbd/keymaps -type f -name alt_shift_toggle -o -name alt_shift_toggle.\*


Seems to return the results in the correct order - can you do this on your machine and post the output? It's perhaps non-deterministic ordering. If the .inc comes first I think that's the problem.
Comment 11 Colin Guthrie 2013-04-24 11:01:53 CEST
Actually scratch that last request, I tried on a few more machines and indeed the order is different on other machines.


[colin@marley ~]$ find /usr/lib/kbd/keymaps -type f -name alt_shift_toggle -o -name alt_shift_toggle.\*
/usr/lib/kbd/keymaps/i386/include/alt_shift_toggle.inc
/usr/lib/kbd/keymaps/i386/include/alt_shift_toggle.map.gz


Here the .inc file is first, so it's included, but in the main search we actually want to include .map file itself.

I'll see if the command can be tweaked.
Comment 12 Colin Guthrie 2013-04-24 11:30:48 CEST
Created attachment 3802 [details]
Patch to fix the issue in dracut

This patch should fix the issue.

Can you apply it to your system?

Just run:

sudo patch /usr/lib/dracut/modules.d/10i18n/module-setup.sh < 0001-Match-.map-files-before-.inc-files-when-looking-for-.patch

(or run it as root without sudo).


Then regenerate your initrd (dracut -f) and test it.

Whether it works or not, can you supply output of lsinitrd again just to confirm.
Comment 13 Colin Guthrie 2013-05-03 21:48:50 CEST
The patch should work so I've included it in latest dracut.

Status: NEW => RESOLVED
Resolution: (none) => FIXED