* Re: how to change mac address using udev
From: Sasha Alko @ 2011-10-18 9:49 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <CAMY8tishW7Dwn4ZMXw5te=3rX0Y+fLaBjuNkjM9ZAEGn-C79rw@mail.gmail.com>
Hi,
Does anybody have an example how to change MAC address using udev?
Kind regards,
S
2011/10/12 Sasha Alko <alkosasha@gmail.com>:
> Hi,
>
> I am trying to change mac address in this way:
>
> subsystem="usb", action="add", attrs{idvendor},
> attr{address}="00:11:22:33:44:55"
>
> But this generates the error "error opening
> ATTR{/sys/deivces/.../net/eth1/address} for writing: Permission denied
>
> I know that NetworkManager is able to change mac address and I guess
> NM uses udev to change mac.
>
> Could you please advice me how to change mac using udev.
>
> Kind regards,
> S
>
^ permalink raw reply
* Re: Samsung 90X3A Fn Keys
From: Ian Coleman @ 2011-10-18 7:48 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <CAD6YvxT8M6mR-2HuoetQ9BnowJgVSG2YXBRFhg-t1dAoR9TAyA@mail.gmail.com>
I ran xev and tested the kbdillumup and kbdillumdown hotkeys with the
cursor in the white box that appears, with no result (nothing
appears/changes in terminal). To confirm the 'white box' was working I
tried known-working hotkeys (eg volume) and they gave the expected
result in terminal.
Just to clarify, I am running xfce so the command "killall
gnome-settings-daemon" returned the message "no process found".
I've got 64 bit 11.10 xubuntu installed on the laptop.
$ uname -a
Linux xxxxxx-laptop 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:56:25
UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
Thanks,
Ian
On 18 October 2011 15:48, Martin Pitt <martin.pitt@ubuntu.com> wrote:
> Hello Ian,
>
> Ian Coleman [2011-10-17 15:10 +1100]:
>> I am trying to get the Fn+F7 and Fn+F8 keys working on my Samsung
>> laptop, model 90X3A. These map to 'keyboard illumination down' and
>> 'keyboard illumination up', which sets the brightness of the LEDs
>> behind the keyboard.
>
> Thanks for the data. I'll commit this to udev as soon as I get write
> permissions back.
>
>> I have managed to get the scan code (0x96 and 0x97) to respond with
>> the correct key code (kbdillumup and kbdillumdown) when I run
>> /lib/udev/keymap -i input/event4
>>
>> However the keyboard backlight level still does not change when these
>> buttons are pressed.
>
> I can't test these myself as I don't have an illuminated keyboard, but
> gnome-settings-daemon's "media-keys" plugin has code to react to
> these:
>
> http://git.gnome.org/browse/gnome-settings-daemon/tree/plugins/media-keys/gsd-media-keys-manager.c#n1549
>
> Can you please ensure that X.org actually knows about these? Please
> run "killall gnome-settings-daemon", then "xev", move the pointer into
> the white window and press Fn+F7/F8. Do you see keyboard events for
> XF86KbdBrightnessUp/XF86KbdBrightnessDown in the terminal?
>
> Martin
> --
> Martin Pitt | http://www.piware.de
> Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
>
^ permalink raw reply
* Re: Samsung 90X3A Fn Keys
From: Victor Engmark @ 2011-10-18 7:41 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <CAD6YvxT8M6mR-2HuoetQ9BnowJgVSG2YXBRFhg-t1dAoR9TAyA@mail.gmail.com>
On Tue, Oct 18, 2011 at 9:26 AM, Victor Engmark
<victor.engmark@gmail.com> wrote:
> On Tue, Oct 18, 2011 at 6:41 AM, Martin Pitt <martin.pitt@ubuntu.com> wrote:
>> Victor Engmark [2011-10-17 20:55 +0200]:
>>> > Are you using the proper kernel driver for this laptop (samsung-laptop)
>>> > that provides the ability to change the backlight levels?
>>> >
>>> > If not, the keys themselves are not going to do anything on their own,
>>> > sorry.
>>>
>>> Is there an Ubuntu package for this?
>>
>> No need for a package, that module just comes with the standard
>> kernel. It should autoload as it seems to have proper modaliases
>> (dmi*:svn*SAMSUNG...). Doesn't it appear in "lsmod | grep samsung"?
>
> Nope, nothing there. For reference, I'm running Ubuntu 11.10 64 bit
> (and was running 11.04 a week ago, with the same problem).
>
> $ uname -a
> Linux lup0 2.6.38-11-generic #50-Ubuntu SMP Mon Sep 12 21:18:14 UTC
> 2011 i686 i686 i386 GNU/Linux
Correction: Running Ubuntu 11.04 still (won't upgrade to the POS that
11.10 is after trying it on the desktop).
--
Victor Engmark
^ permalink raw reply
* Re: Samsung 90X3A Fn Keys
From: Victor Engmark @ 2011-10-18 7:26 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <CAD6YvxT8M6mR-2HuoetQ9BnowJgVSG2YXBRFhg-t1dAoR9TAyA@mail.gmail.com>
On Tue, Oct 18, 2011 at 6:41 AM, Martin Pitt <martin.pitt@ubuntu.com> wrote:
> Victor Engmark [2011-10-17 20:55 +0200]:
>> > Are you using the proper kernel driver for this laptop (samsung-laptop)
>> > that provides the ability to change the backlight levels?
>> >
>> > If not, the keys themselves are not going to do anything on their own,
>> > sorry.
>>
>> Is there an Ubuntu package for this?
>
> No need for a package, that module just comes with the standard
> kernel. It should autoload as it seems to have proper modaliases
> (dmi*:svn*SAMSUNG...). Doesn't it appear in "lsmod | grep samsung"?
Nope, nothing there. For reference, I'm running Ubuntu 11.10 64 bit
(and was running 11.04 a week ago, with the same problem).
$ uname -a
Linux lup0 2.6.38-11-generic #50-Ubuntu SMP Mon Sep 12 21:18:14 UTC
2011 i686 i686 i386 GNU/Linux
Cheers,
--
Victor Engmark
^ permalink raw reply
* Re: Samsung 90X3A Fn Keys
From: Martin Pitt @ 2011-10-18 4:48 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <CAD6YvxT8M6mR-2HuoetQ9BnowJgVSG2YXBRFhg-t1dAoR9TAyA@mail.gmail.com>
Hello Ian,
Ian Coleman [2011-10-17 15:10 +1100]:
> I am trying to get the Fn+F7 and Fn+F8 keys working on my Samsung
> laptop, model 90X3A. These map to 'keyboard illumination down' and
> 'keyboard illumination up', which sets the brightness of the LEDs
> behind the keyboard.
Thanks for the data. I'll commit this to udev as soon as I get write
permissions back.
> I have managed to get the scan code (0x96 and 0x97) to respond with
> the correct key code (kbdillumup and kbdillumdown) when I run
> /lib/udev/keymap -i input/event4
>
> However the keyboard backlight level still does not change when these
> buttons are pressed.
I can't test these myself as I don't have an illuminated keyboard, but
gnome-settings-daemon's "media-keys" plugin has code to react to
these:
http://git.gnome.org/browse/gnome-settings-daemon/tree/plugins/media-keys/gsd-media-keys-manager.c#n1549
Can you please ensure that X.org actually knows about these? Please
run "killall gnome-settings-daemon", then "xev", move the pointer into
the white window and press Fn+F7/F8. Do you see keyboard events for
XF86KbdBrightnessUp/XF86KbdBrightnessDown in the terminal?
Martin
--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
^ permalink raw reply
* Re: Samsung 90X3A Fn Keys
From: Martin Pitt @ 2011-10-18 4:41 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <CAD6YvxT8M6mR-2HuoetQ9BnowJgVSG2YXBRFhg-t1dAoR9TAyA@mail.gmail.com>
Victor Engmark [2011-10-17 20:55 +0200]:
> > Are you using the proper kernel driver for this laptop (samsung-laptop)
> > that provides the ability to change the backlight levels?
> >
> > If not, the keys themselves are not going to do anything on their own,
> > sorry.
>
> Is there an Ubuntu package for this?
No need for a package, that module just comes with the standard
kernel. It should autoload as it seems to have proper modaliases
(dmi*:svn*SAMSUNG...). Doesn't it appear in "lsmod | grep samsung"?
Martin
--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
^ permalink raw reply
* Re: Samsung 90X3A Fn Keys
From: Greg KH @ 2011-10-17 18:59 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <CAD6YvxT8M6mR-2HuoetQ9BnowJgVSG2YXBRFhg-t1dAoR9TAyA@mail.gmail.com>
On Mon, Oct 17, 2011 at 08:55:32PM +0200, Victor Engmark wrote:
> n Mon, Oct 17, 2011 at 8:00 PM, Greg KH <greg@kroah.com> wrote:
> > On Mon, Oct 17, 2011 at 03:10:45PM +1100, Ian Coleman wrote:
> >> I am trying to get the Fn+F7 and Fn+F8 keys working on my Samsung
> >> laptop, model 90X3A. These map to 'keyboard illumination down' and
> >> 'keyboard illumination up', which sets the brightness of the LEDs
> >> behind the keyboard.
> >>
> >> I have started a thread here
> >> http://ubuntuforums.org/showthread.php?t\x1751914 about this issue
> >>
> >> I have managed to get the scan code (0x96 and 0x97) to respond with
> >> the correct key code (kbdillumup and kbdillumdown) when I run
> >> /lib/udev/keymap -i input/event4
> >>
> >> However the keyboard backlight level still does not change when these
> >> buttons are pressed.
> >
> > Are you using the proper kernel driver for this laptop (samsung-laptop)
> > that provides the ability to change the backlight levels?
> >
> > If not, the keys themselves are not going to do anything on their own,
> > sorry.
>
> Is there an Ubuntu package for this?
It should be in your kernel already, if not, go bug the Ubuntu
developers to enable the configuration option.
greg k-h
^ permalink raw reply
* Re: Samsung 90X3A Fn Keys
From: Victor Engmark @ 2011-10-17 18:55 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <CAD6YvxT8M6mR-2HuoetQ9BnowJgVSG2YXBRFhg-t1dAoR9TAyA@mail.gmail.com>
n Mon, Oct 17, 2011 at 8:00 PM, Greg KH <greg@kroah.com> wrote:
> On Mon, Oct 17, 2011 at 03:10:45PM +1100, Ian Coleman wrote:
>> I am trying to get the Fn+F7 and Fn+F8 keys working on my Samsung
>> laptop, model 90X3A. These map to 'keyboard illumination down' and
>> 'keyboard illumination up', which sets the brightness of the LEDs
>> behind the keyboard.
>>
>> I have started a thread here
>> http://ubuntuforums.org/showthread.php?t\x1751914 about this issue
>>
>> I have managed to get the scan code (0x96 and 0x97) to respond with
>> the correct key code (kbdillumup and kbdillumdown) when I run
>> /lib/udev/keymap -i input/event4
>>
>> However the keyboard backlight level still does not change when these
>> buttons are pressed.
>
> Are you using the proper kernel driver for this laptop (samsung-laptop)
> that provides the ability to change the backlight levels?
>
> If not, the keys themselves are not going to do anything on their own,
> sorry.
Is there an Ubuntu package for this?
--
Victor Engmark
^ permalink raw reply
* Re: Samsung 90X3A Fn Keys
From: Greg KH @ 2011-10-17 18:00 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <CAD6YvxT8M6mR-2HuoetQ9BnowJgVSG2YXBRFhg-t1dAoR9TAyA@mail.gmail.com>
On Mon, Oct 17, 2011 at 03:10:45PM +1100, Ian Coleman wrote:
> I am trying to get the Fn+F7 and Fn+F8 keys working on my Samsung
> laptop, model 90X3A. These map to 'keyboard illumination down' and
> 'keyboard illumination up', which sets the brightness of the LEDs
> behind the keyboard.
>
> I have started a thread here
> http://ubuntuforums.org/showthread.php?t\x1751914 about this issue
>
> I have managed to get the scan code (0x96 and 0x97) to respond with
> the correct key code (kbdillumup and kbdillumdown) when I run
> /lib/udev/keymap -i input/event4
>
> However the keyboard backlight level still does not change when these
> buttons are pressed.
Are you using the proper kernel driver for this laptop (samsung-laptop)
that provides the ability to change the backlight levels?
If not, the keys themselves are not going to do anything on their own,
sorry.
greg k-h
^ permalink raw reply
* Samsung 90X3A Fn Keys
From: Ian Coleman @ 2011-10-17 4:10 UTC (permalink / raw)
To: linux-hotplug
I am trying to get the Fn+F7 and Fn+F8 keys working on my Samsung
laptop, model 90X3A. These map to 'keyboard illumination down' and
'keyboard illumination up', which sets the brightness of the LEDs
behind the keyboard.
I have started a thread here
http://ubuntuforums.org/showthread.php?t\x1751914 about this issue
I have managed to get the scan code (0x96 and 0x97) to respond with
the correct key code (kbdillumup and kbdillumdown) when I run
/lib/udev/keymap -i input/event4
However the keyboard backlight level still does not change when these
buttons are pressed.
According to /usr/share/doc/udev/README.keymap.txt.gz, step 6 says I
should email this list with some info as listed below.
> 6. Send the system vendor/product names, the key mapping from step 2,
> and /tmp/udev-db.txt from step 4 to the linux-hotplug@vger.kernel.org mailing
> list, so that they can be included in the next release.
== Vendor and product names =Vendor
SAMSUNG ELECTRONICS CO., LTD.
Product
90X3A
== Key mapping =
0x96 kbdillumup #Fn-F8
0x97 kbdillumdown #Fn-F7
== udev.db.txt =An extract only, assuming that this section contains the info that is
helpful. The full length of the file was >4000 lines so if there is
any other info from it that is useful please do ask.
obtained from running
udevadm info --export-db > /tmp/udev-db.txt
> P: /devices/platform/i8042/serio0/input/input4/event4
> N: input/event4
> S: input/by-path/platform-i8042-serio-0-event-kbd
> E: UDEV_LOG=3
> E: DEVPATH=/devices/platform/i8042/serio0/input/input4/event4
> E: MAJOR\x13
> E: MINORh
> E: DEVNAME=/dev/input/event4
> E: SUBSYSTEM=input
> E: ID_INPUT=1
> E: ID_INPUT_KEY=1
> E: ID_INPUT_KEYBOARD=1
> E: ID_SERIAL=noserial
> E: ID_PATH=platform-i8042-serio-0
> E: ID_PATH_TAG=platform-i8042-serio-0
> E: XKBMODEL=pc105
> E: XKBLAYOUT=us
> E: XKBVARIANT=colemak
> E: DEVLINKS=/dev/input/by-path/platform-i8042-serio-0-event-kbd
> E: DMI_VENDOR=SAMSUNG ELECTRONICS CO., LTD.
^ permalink raw reply
* [PATCH] Add mic mute keycode support for Lenovo Thinkpad USB
From: Jerone Young @ 2011-10-13 3:31 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <1318474465.3813.20.camel@Thinkpad-420s>
This patch adds mic mute keycode support for the Lenovo Thinkpad USB
keyboard. Support for this keycode was introduced upstream, and will be
defined in upcoming 3.1 Linux Kernel input.h header. See change set
below:
http://tinyurl.com/3bwmuqr
Signed-off-by: Jerone Young <jyoung@redhat.com>
diff --git a/extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint b/extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint
index bc91470..47e8846 100644
--- a/extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint
+++ b/extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint
@@ -10,4 +10,4 @@
0x90011 prog1 # Thinkvantage button
0x90015 camera # Fn+F6 headset/camera VoIP key ??
-# 0x90010 # Microphone mute button ??
+0x90010 micmute # Microphone mute button
^ permalink raw reply related
* [PATCH] Add mic mute keycode support for Lenovo Thinkpad USB
From: Jerone Young @ 2011-10-13 2:54 UTC (permalink / raw)
To: linux-hotplug
This patch adds mic mute keycode support for the Lenovo Thinkpad USB
keyboard. Support for this keycode was introduced upstream, and will be
in upcoming 3.1 Linux Kernel. See change set below:
http://tinyurl.com/3bwmuqr
Signed-off-by: Jerone Young <jyoung@redhat.com>
diff --git a/extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint b/extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint
index bc91470..47e8846 100644
--- a/extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint
+++ b/extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint
@@ -10,4 +10,4 @@
0x90011 prog1 # Thinkvantage button
0x90015 camera # Fn+F6 headset/camera VoIP key ??
-# 0x90010 # Microphone mute button ??
+0x90010 micmute # Microphone mute button
^ permalink raw reply related
* Need help with udev in CentOS 6.0 for SATA and eSATA HD
From: David Roth @ 2011-10-12 7:11 UTC (permalink / raw)
To: linux-hotplug
I've recently installed CentOS 6.0 X86_64.
I have a server with two internal SATA hard disk drives running a
software RAID 1. I'm adding two external eSATA hard disk drives which
will be mirrored in a software RAID 1 too.
Please kindly correct me if this information is wrong, but I was told
that the internal drives must be /dev/sda and /dev/sdb. And the eSATA
should be /dev/sdc and /dev/sdd.
During my testing, I connected just one LaCie eSATA drive and it's
getting assigned /dev/sdb while the internal drives are being
assigned /dev/sda and /dev/sdc.
I want the internal drives to be sda and sdb. This external eSATA for
testing to be /dev/sdc.
I've written some rules and placed them in /etc/udev/rules.d in a file
named 10-local.rules:
KERNEL="sd*",ATTRS{model}="LaCie d2Next-Q",NAME="sdc"
The above didn't work. I wondered if matching on KERNEL might be the
problem. So I tried this:
ATTRS{model}="LaCie d2Next-Q",NAME="sdc"
This didn't work either.
I've used udev successfully on CentOS 5 with USB drives to create
SYMLINKs. But this is the first time I've tried to work with SATA
drives where I want to force a renaming of the device. I don't think I
should be trying to do a SYMLINK, because I simply want the device
name itself changed.
By the way, I've also noticed that using udevadm it doesn't list the
serial number of the drive like it did with udevinfo, unless I'm doing
this wrong?
udevadm info -a -p $(udevadm info -q path -n /dev/sda)
Thanks in advance for your helpful suggestions!
David Roth
^ permalink raw reply
* how to change mac address using udev
From: Sasha Alko @ 2011-10-11 23:07 UTC (permalink / raw)
To: linux-hotplug
Hi,
I am trying to change mac address in this way:
subsystem="usb", action="add", attrs{idvendor},
attr{address}="00:11:22:33:44:55"
But this generates the error "error opening
ATTR{/sys/deivces/.../net/eth1/address} for writing: Permission denied
I know that NetworkManager is able to change mac address and I guess
NM uses udev to change mac.
Could you please advice me how to change mac using udev.
Kind regards,
S
^ permalink raw reply
* Re: Restarting udevd
From: Kay Sievers @ 2011-10-11 17:15 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <CAEik5nM5xRm3Uqtn9Qn0B=EY_ADWimkwrU4X0fOxcoDx6XUJ=g@mail.gmail.com>
On Tue, Oct 11, 2011 at 18:38, Dan McGee <dpmcgee@gmail.com> wrote:
> In trying to answer the question "What is the proper way to restart
> udevd on a running system?", the following questions came up:
>
> 1. I was informed something such as `killall udevd && udevd --daemon`
> was not safe, is this true?
You might not be able to start a new udevd while the old one is still running.
> 2. Is doing `udevadm control --exit && udevd --daemon` any better?
Unlike signals, --exit is sync and blocks properly.
You can only lose events between the stop and start that way - but
that has and can always happen in simple setups that do not support
socket activation.
> 3. Now that the decision [1] has been made to move udevd out of the
> system path, how is one supposed to even locate the binary to restart?
> 4. Should there be a `udevadm control --restart` command?
As mentioned in the NEWS of udev, for non-systemd systems create a
symlink in /sbin where udevd was located .
On systemd systems we can update and restart udevd without knowing any
details, calling parameters/sequence, install locations, and without
losing any event from the kernel or a tool talking to udevd during the
restart.
For older systems with the symlink in /sbin nothing should have changed.
Kay
^ permalink raw reply
* Restarting udevd
From: Dan McGee @ 2011-10-11 16:38 UTC (permalink / raw)
To: linux-hotplug
In trying to answer the question "What is the proper way to restart
udevd on a running system?", the following questions came up:
1. I was informed something such as `killall udevd && udevd --daemon`
was not safe, is this true?
2. Is doing `udevadm control --exit && udevd --daemon` any better?
3. Now that the decision [1] has been made to move udevd out of the
system path, how is one supposed to even locate the binary to restart?
4. Should there be a `udevadm control --restart` command?
-Dan McGee
[1] http://git.kernel.org/?p=linux/hotplug/udev.git;a=commit;hÙ64a4bfde57ad1b05d105edd5d078e1aac45da6
^ permalink raw reply
* USB stick unplug problem with udev-114 and linux-kernel-2.6.32
From: Longchao Dong @ 2011-10-11 8:31 UTC (permalink / raw)
To: linux-hotplug
Hi,
I am in trouble with one problem of USB stick unplug with udev-114 and
linux-kernel-2.6.32.
When I plug my USB stick,I can identify it with KERNEL="sd??" and
mount it with udev-rules,while when I unplug it,I can not receive the
KERNEL="sd??" event in my udev-rules,so I can not umount it.
I have check the variable KERNEL with plug and unplug.The only
different is that when unplug no "sd??" is received. I can receive all
other event when unplug but not "sd??".
So I want to know if this problem is from udev side or linux kernel
side?Maybe my udev/kernel version is too old?
Thanks a lot in advance.
--
Wish you happy.
Longchao Dong
^ permalink raw reply
* FT4232H semi-randomly fails to read EEPROM on cold reboot
From: Joakim Linde @ 2011-10-10 11:24 UTC (permalink / raw)
To: linux-hotplug
Hi,
I have a very odd problem with FT4242H devices, which I hope someone
recognizes.
The FT4242H uses an external EEPROM for things like vendor/product
strings and serial number. Without the external EEPROM the
vendor/product strings reverts to defaults and there is no support for a
serial number (which is the thing I'm really interested in). Typically I
keep 4 separate devices conneced (so a total of 16 ports). On a cold
reboot only about half of the FT4242H devices will read the EEPROM
contents. The rest of them will just report defaults when examined with
udevadm info. When one of the devices, which failed to report a serial
number, is unplugged and plugged back in it will always succeed in
reading the EEPROM contents, and will report the stored serial number.
I've seen this issue turn up in both kernel 2.6.32.26 and 2.6.40.4.
The problem does not seem to be tied to particular devices. For example,
if I swap a working and a non-working board the problem usually does not
move with the board. If anything, specific USB ports seems to work
better than others, but that's not the full explanation either. So far
I've not been able to spot any significant difference between a
successful and failed read in dmesg or messages.
Is there anyone here who is familiar with this type of problem?
As a workaround I've tried to use udevadm trigger to simulate unplug +
re-plug without any success. The default product string is 'Quad RS232-HS'
so I've tried
udevadm trigger --verbose --attr-match=interface=Quad*
which seems to match only they devices that have failed to read the EEPROM.
Unfortunately no combination of remove, add or change has successfully simulated
a unplug + re-plug. Is this entirely the wrong approach, or what am I doing wrong?
Best regards,
--
Joakim Linde
Tangiamo AB (formerly TouchTable AB)
mail : joakim.linde@touchtable.se
office : +46-(0)31 515730
mobile : +46-(0)730 790054
Skype : joakim_linde_at_work
^ permalink raw reply
* Re: tags in udev git repo
From: Kay Sievers @ 2011-10-10 11:00 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <20111010052112.GA12832@linux1>
On Mon, Oct 10, 2011 at 07:21, William Hubbs <w.d.hubbs@gmail.com> wrote:
> what happened to the tags in the udev git repository? I had to re-clone
> and used the following command:
>
> git clone git://git.kernel.org/pub/scm/linux/hotplug/udev.git
>
> The repository was cloned successfully, but the tags did not come down
> to my clone. Can someone look into this?
Should be there now.
Kay
^ permalink raw reply
* tags in udev git repo
From: William Hubbs @ 2011-10-10 5:21 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: text/plain, Size: 305 bytes --]
All,
what happened to the tags in the udev git repository? I had to re-clone
and used the following command:
git clone git://git.kernel.org/pub/scm/linux/hotplug/udev.git
The repository was cloned successfully, but the tags did not come down
to my clone. Can someone look into this?
Thanks,
William
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* Re: [PATCH] fix a race condition on udev worker shutdown
From: Kay Sievers @ 2011-10-09 2:56 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <20111008091408.GC26331@virgil.dodds.net>
On Sat, Oct 8, 2011 at 11:14, Steve Langasek
<steve.langasek@canonical.com> wrote:
> Subject: [PATCH] Process events before signals in worker
>
> When a worker receives both a signal and a udev event in the same epoll_wait
> run, the event must be processed first because the udev parent considers the
> event already dispatched. Â If we process the signal first and exit, udevd
> times out after 60 seconds waiting for a response from an already-dead
> worker.
Applied.
Thanks,
Kay
^ permalink raw reply
* [PATCH] fix a race condition on udev worker shutdown
From: Steve Langasek @ 2011-10-08 9:14 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: text/plain, Size: 3606 bytes --]
Hi there,
A race condition in udev has turned up in Ubuntu's initramfs, causing
60-second delays in the boot sequence because udevd loses track of one of
its workers: it's waiting for a pending event to be processed, but the
worker it was dispatched to has already exited because the event and signal
were received by the worker at the same time and the signal took precedence.
There are a few ways we could deal with this.
- Let udevd clear its list harder when a worker exits, since if the process
hasn't already sent back its information it's not going to do so from
beyond the grave and we might as well clean up the references to it.
This seems to be safe because fd_worker is processed before fd_signal in
the main event loop, so any last words will be duly recorded.
- Reorder the event loop so that signals and the control socket are
processed before the event queue. This way, udev would never dispatch a
new event to a worker after it's been told to exit, which is what happens
now. However, there may be reasons for the current order that I don't
see offhand; and anyway, I don't think the reordering is a guarantee that
the event and signal wouldn't arrive at the same time, it just makes it
orders of magnitude less likely.
- When a worker sees that an event has arrived, process it immediately.
This ensures everything udevd has delegated is finished before the worker
handles the signal (i.e., exits). This means the worker will take longer
to finish up in some cases, but probably not 60 seconds longer...
The below patch implements option three. Maybe one of the other options
should also be implemented, but in my testing #3 seems to be sufficient in
its own right to solve the problem.
An implicit assumption in this patch is that, when an event and signal
arrive together, the event is returned *first* from epoll_wait(). This has
been the case in my tests, but I haven't spotted any reason that it's
guaranteed to always be the case.
Cheers,
--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
slangasek@ubuntu.com vorlon@debian.org
From 84ead317ea041efa066b5134d5df0fd6fc075aa9 Mon Sep 17 00:00:00 2001
From: Steve Langasek <steve.langasek@canonical.com>
Date: Sat, 8 Oct 2011 01:34:32 -0700
Subject: [PATCH] Process events before signals in worker
When a worker receives both a signal and a udev event in the same epoll_wait
run, the event must be processed first because the udev parent considers the
event already dispatched. If we process the signal first and exit, udevd
times out after 60 seconds waiting for a response from an already-dead
worker.
Ref: https://bugs.launchpad.net/bugs/818177
Signed-off-by: Steve Langasek <steve.langasek@canonical.com>
---
udev/udevd.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/udev/udevd.c b/udev/udevd.c
index 77aec9d..b65b53f 100644
--- a/udev/udevd.c
+++ b/udev/udevd.c
@@ -347,6 +347,7 @@ static void worker_new(struct event *event)
for (i = 0; i < fdcount; i++) {
if (ev[i].data.fd == fd_monitor && ev[i].events & EPOLLIN) {
dev = udev_monitor_receive_device(worker_monitor);
+ break;
} else if (ev[i].data.fd == fd_signal && ev[i].events & EPOLLIN) {
struct signalfd_siginfo fdsi;
ssize_t size;
--
1.7.5.4
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply related
* Re: advice needed for gentoo bug involving lvm2/udev
From: Kay Sievers @ 2011-10-04 1:09 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <20111003164149.GA13439@linux1>
On Mon, Oct 3, 2011 at 18:41, William Hubbs <w.d.hubbs@gmail.com> wrote:
> we have the following bug posted in gentoo's bugzilla:
>
> http://bugs.gentoo.org/show_bug.cgi?id65227.
>
> The reporter is telling me that we should use --action=change instead of
> --actiond in the cold boot sequence when dev is devtmpfs. However,
> this doesn't seem to be the correct fix based on earlier discussions on
> this list.
>
> Does anyone else have any suggestions for fixing this? My thought is
> that the rules for lvm2 should be fixed. What does everyone else think?
--actiond is still the recommended and default way of doing coldplug.
It should only be done once after udevd is started though, and never
again. All later triggers should be change only.
Devtmpfs does not really matter here, it's the replay of the missed
events, which should be add and not change.
Kay
^ permalink raw reply
* advice needed for gentoo bug involving lvm2/udev
From: William Hubbs @ 2011-10-03 16:41 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: text/plain, Size: 488 bytes --]
All,
we have the following bug posted in gentoo's bugzilla:
http://bugs.gentoo.org/show_bug.cgi?id=365227.
The reporter is telling me that we should use --action=change instead of
--action=add in the cold boot sequence when dev is devtmpfs. However,
this doesn't seem to be the correct fix based on earlier discussions on
this list.
Does anyone else have any suggestions for fixing this? My thought is
that the rules for lvm2 should be fixed. What does everyone else think?
William
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* Re: drive removes and then re-adds itself causing udev rule to re-run
From: Kay Sievers @ 2011-10-03 12:30 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <41252.128.173.192.90.1317643658.squirrel@webmail.tuffmail.net>
On Mon, Oct 3, 2011 at 14:07, <brad@16systems.com> wrote:
> I have a udev rule to detect when drives are added to a system via an
> esata drive dock. Here is the rule:
>
> ACTION="add", KERNEL="sd?", RUN+="/bin/bash /home/rbt/Desktop/script.sh
> $kernel"
>
> I use the rule to get the kernel name of the device (sdc, sdd, sde, etc.)
> and write it to a file. I normally use this rule on a one slot esata drive
> dock and in that case, it works fine.
>
> However, when I use a multi-slot esata drive dock (4 drive slots) drives
> sometimes remove themselves and then immediately re-add themselves causing
> the rule to fire multiple times. The drives that do this have not been
> physically removed from the drive dock and have not powered down. When
> this occurs, it causes a bug in my program as that's not expected to
> occur.
>
> # udevadm --version = 157
>
> Could anyone on the list offer advice on how to prevent the re-firing of
> the rule? I'm going to try setting a env var to prevent firing of the
> rule:
>
> ACTION="add", KERNEL="sd?", ENV{status}!="done", ENV{status}="done",
> RUN+="/bin/bash /home/rbt/Desktop/script.sh $kernel"
>
> But I suspect that it won't work as udev thinks the device was removed
> (even though it wasn't and then re-added) so the variable won't be set.
> Here's a log I captured showing the removal and re-addition:
Your app needs to handle that. There is no way for udev to work around
that, the device was really removed from the kernel and is added back.
Kay
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox