Mageia Bugzilla – Attachment 1262 Details for
Bug 3654
drakx need to be ported to new udev
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
Patch to use udevadm info to get the serial
udev-175.patch (text/plain), 1.03 KB, created by
Colin Guthrie
on 2011-12-18 03:45:09 CET
(
hide
)
Description:
Patch to use udevadm info to get the serial
Filename:
MIME Type:
Creator:
Colin Guthrie
Created:
2011-12-18 03:45:09 CET
Size:
1.03 KB
patch
obsolete
>Index: lib/mouse.pm >=================================================================== >--- lib/mouse.pm (revision 2465) >+++ lib/mouse.pm (working copy) >@@ -193,8 +193,14 @@ > sub _input_entry_to_device_by_id { > my ($input) = @_; > >- my $ID_SERIAL = chomp_(run_program::get_stdout('usb_id', $input->{sysfs_path})); >- $ID_SERIAL =~ s/[^\w#+\-.:=@_]/_/g; #- udev do a further cleanup, eg: "Wacom_Co.,Ltd._MTE-450" => "Wacom_Co._Ltd._MTE-450". cf ALLOWED_CHARS udev.h >+ my $ID_SERIAL = ""; >+ for (split /^/, run_program::get_stdout('udevadm', 'info', '--query', 'env', '--path', $input->{sysfs_path})) { >+ if (/^ID_SERIAL=(.*)/) { >+ $ID_SERIAL = $1; >+ $ID_SERIAL =~ s/[^\w#+\-.:=@_]/_/g; #- udev do a further cleanup, eg: "Wacom_Co.,Ltd._MTE-450" => "Wacom_Co._Ltd._MTE-450". cf ALLOWED_CHARS udev.h >+ break; >+ } >+ } > my $sysfs_device = "input/by-id/usb-$ID_SERIAL-event-mouse"; #- from /etc/udev/rules.d/60-persistent-input.rules > if ($::isInstall || -e "/dev/$sysfs_device") { > $sysfs_device;
Index: lib/mouse.pm =================================================================== --- lib/mouse.pm (revision 2465) +++ lib/mouse.pm (working copy) @@ -193,8 +193,14 @@ sub _input_entry_to_device_by_id { my ($input) = @_; - my $ID_SERIAL = chomp_(run_program::get_stdout('usb_id', $input->{sysfs_path})); - $ID_SERIAL =~ s/[^\w#+\-.:=@_]/_/g; #- udev do a further cleanup, eg: "Wacom_Co.,Ltd._MTE-450" => "Wacom_Co._Ltd._MTE-450". cf ALLOWED_CHARS udev.h + my $ID_SERIAL = ""; + for (split /^/, run_program::get_stdout('udevadm', 'info', '--query', 'env', '--path', $input->{sysfs_path})) { + if (/^ID_SERIAL=(.*)/) { + $ID_SERIAL = $1; + $ID_SERIAL =~ s/[^\w#+\-.:=@_]/_/g; #- udev do a further cleanup, eg: "Wacom_Co.,Ltd._MTE-450" => "Wacom_Co._Ltd._MTE-450". cf ALLOWED_CHARS udev.h + break; + } + } my $sysfs_device = "input/by-id/usb-$ID_SERIAL-event-mouse"; #- from /etc/udev/rules.d/60-persistent-input.rules if ($::isInstall || -e "/dev/$sysfs_device") { $sysfs_device;
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 3654
: 1262