Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 555204 - >=sys-apps/hwids-20150417 please add compatibility keyboard mapping for older udev
Summary: >=sys-apps/hwids-20150417 please add compatibility keyboard mapping for older...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Diego Elio Pettenò (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 555210
  Show dependency tree
 
Reported: 2015-07-17 16:45 UTC by Ian Stakenvicius (RETIRED)
Modified: 2016-05-05 10:56 UTC (History)
2 users (show)

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


Attachments
Ebuild with codeblock pasted above included. (hwids-20150417-r1.ebuild,2.03 KB, text/plain)
2015-07-17 16:46 UTC, Ian Stakenvicius (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Stakenvicius (RETIRED) gentoo-dev 2015-07-17 16:45:05 UTC
Current systemd (and udev) upstream hasn't provided a good stable candidate as of yet that includes the ability to parse the new evdev-style 60-keyboard.hwdb but ~sys-fs/eudev-3.1.2 (which does use the new evdev-style) was just stabilized.  Eudev would like to get 20150417 or above stabilized to match, however this would break stable udev/systemd users.

The following addition to hwdb ebuilds re-maps the evdev-style 60-keyboard.hwdb into a keyboard-style 61-old-keyboard.hwdb.  I've done some testing on both newer and older (e)udev's and each one appropriately ignores the hwdb entries it doesn't understand, so there seems to be no conflicts as a result.  

Permission to carry this ebuild addition in sys-apps/hwids until older udev's are removed from the portage tree?



--- hwids-20150417.ebuild  2015-04-19 09:25:52.000000000 -0400
+++ hwids-20150417-r1.ebuild    2015-07-17 11:31:12.000000000 -0400
@@ -46,6 +46,16 @@
 
 src_compile() {
    _emake
+
+   # Create a rules file compatible with older udev.
+   sed \
+       -e 's/evdev:name/keyboard:name/' \
+       -e 's/evdev:atkbd:dmi/keyboard:dmi/' \
+       -e 's/evdev:input:b\([^v]*\)v\([^p]*\)p\([^e]*\)\(e.*\)\?/keyboard:usb:v\2p\3/' \
+       -e 's/keyboard:usb:v046DpC52D\*/keyboard:usb:v046DpC52Dd*dc*dsc*dp*ic*isc*ip*in00*/' \
+       -e 's/keyboard:usb:v0458p0708\*/keyboard:usb:v0458p0708d*dc*dsc*dp*ic*isc*ip*in01*/' \
+       "${S}"/udev/60-keyboard.hwdb \
+       >"${S}"/udev/61-oldkeyboard.hwdb
 }
 
 src_install() {
Comment 1 Ian Stakenvicius (RETIRED) gentoo-dev 2015-07-17 16:46:22 UTC
Created attachment 407018 [details]
Ebuild with codeblock pasted above included.
Comment 2 Mike Gilbert gentoo-dev 2015-07-18 00:51:43 UTC
I guess this is the commit which causes the issue:

https://github.com/systemd/systemd/commit/51c0c2869845a058268d54c3111d55d0dd485704

I think your sed could be reduced to this:

sed -e "s/^evdev:/keyboard:/" udev/60-keyboard.rules > udev/61-keyboard.rules

Is there a case where that would not work?
Comment 3 Mike Gilbert gentoo-dev 2015-07-18 01:36:09 UTC
(In reply to Mike Gilbert from comment #2)

Nevermind; I see that produces different results.
Comment 4 Ian Stakenvicius (RETIRED) gentoo-dev 2015-07-18 15:16:25 UTC
(In reply to Mike Gilbert from comment #3)
> (In reply to Mike Gilbert from comment #2)
> 
> Nevermind; I see that produces different results.

Yeah, the mapping is nearly the same bot not as trivial as that.  The sed's take care of all the generic mappings and then map a couple of matches that are too generic back to what they used to be.
Comment 5 Mike Gilbert gentoo-dev 2015-07-18 16:56:57 UTC
+*hwids-20150421-r1 (18 Jul 2015)
+*hwids-20150717-r1 (18 Jul 2015)
+
+  18 Jul 2015; Mike Gilbert <floppym@gentoo.org> +hwids-20150421-r1.ebuild,
+  +hwids-20150717-r1.ebuild, hwids-99999999.ebuild, metadata.xml:
+  Add workaround for mapping change in 60-keyboard.hwdb, bug 555204, patch by
+  axs.

I added this to 20150421, and 20150717. Can you give the latter a try with an older version of [e]udev?
Comment 6 Ian Stakenvicius (RETIRED) gentoo-dev 2015-11-14 01:04:49 UTC
Sorry for such a long ping timeout -- all seems fine with eudev; i don't have a sys-fs/udev system to confirm with.

Since there's an eudev-1.x that will remain in the tree for certain old kernel compatibility, it would be good to keep this patch in place for a while even if there's a new enough sys-fs/udev and systemd in the stable tree that support the new format.
Comment 7 Pacho Ramos gentoo-dev 2016-05-05 10:56:53 UTC
looks like all stable versions are now ok