udev bugfix [Long]

Zbigniew Łuszpiński zbiggy at o2.pl
Tue Jul 5 21:56:45 UTC 2005


> On Mon, Jul 04, 2005 at 06:49:37PM +0200, Zbigniew ?uszpi?ski wrote:
> > Hi!
>
> Hello,
>
> > I have just uploaded to svn new udev-60.patch which fixes bug in udev
> > configuration of hotplug devices (e.g. USB modems). Without this patch
> > udev-059 and later versions will not allow to autoconfigure or autoupload
> > firmware to such devices making them useless.
> >
> > So if some of your hotplug devices do not work after updating to udev-059
> > or udev-60 recently, this patch is for you.
> >
> > I made it for my SpeedTouch 330 ADSL USB modem, but this patch is
> > universal and work with other hotplug hardware (not only modems).
>
> Can you explain this a little more or point to where you got information
> for this, please? To sign off the module, I need a little more info.

Battle arena: my room, take 1: How I was fighting with modem
Camera start!

I recently did lunar update.( I do lunar update very often, thanks to this 
there is always only few modules to update so can easy track changes). With 
recent update new udev 0.59 appeared along with nestu's message on mail list 
and lunar-linux.org. So updated modules and everything was OK. On the 
following day booted computer again. Can not connect to the Internet: 
'Service temporary unavailabe'. Checked windowsXP (on the same machine) - 
everything OK. Going back to lunar - no Internet, on Windows still OK. So 
read udev 059-060 changelog - nothing special and updated udev module from 
059 to 060 - maybe they had bug with 059? Nothing changed, sent updated 060 
module to svn. Went back to udev-058 using lin -w - everything works. Googled 
Internet - nothing found. OK digging logs. Found! usb 1-1: No stage 1 
firmware found! Without uploaded firmware modem is useless. Looking for new 
hotplug packge on Internet - nothing new. So something happened with new 
udev. But in 059-060 changelog there was no big changes. So reading changelog 
058-059 - Found some interesting things!:
Kay Sievers:
  prepare RELEASE-NOTES
  Makefile: remove dev.d/ hotplug.d/ from install target
  udev: move dev.d/ handling to external helper

OK so reading release-notes (pasted here most important parts)
(...)udev 059
========
Major changes happened with this release.(...)

(...)
o /etc/dev.d/ + /etc/hotplug.d/ directory multiplexing is completely
  removed from udev itself and must be emulated by calling small
  helper binaries provided in the extras folder:
    make EXTRAS=extras/run_directory/
  will build udev_run_devd and udev_run_hotplugd, which can be called
  from a rule if needed:
    RUN+="/sbin/udev_run_hotplugd"
  The recommended way to handle this is to convert all the calls from
  the directories to explicit udev rules and get completely rid of the
  multiplexing. (To catch a ttyUSB event, you now no longer need to
  fork and exit 300 tty script instances you are not interested in, it
  is just one rule that matches exactly the device.)
(...)

The example of udev configuration, suitable for lunar (and probably SMGL, 
Eric) I found in etc/udev/gentoo/udev.rules

Now I only had to patch lunar configuration. Done. After reboot lunar had for 
me few good messages:

usb 1-1: found stage 1 firmware speedtch-1.bin
usb 1-1: found stage 2 firmware speedtch-2.bin
ADSL line is synchronising
ADSL line is up (160 Kib/s down | 96 Kib/s up)

And my modem woke up :-) Then applied my patch to zlocal/udev (which was 
updated to 060 before).

As usual tested 3 times my module (lin udev, reboot). Always compiled and 
installed fine so sent it to svn. And mailing list because including to 
moonbase takes some time and people if have the same troubles like I had can 
not wait.

> > For those who do not have access to svn I included patch which will
> > update udev to 060 version and enable hotplug. If udev-60 is already
> > installed, edit this patch and remove everything below  ) > $C_FIFO 2>&1
> > line and then patch udev.
>
> If the patch needs some previous editing, then I would say the patch is
> missing something, right?

Nothing is missing. When I was fighting with modem, the current udev in 
moonbase was udev-059. I built local udev-060 module in zlocal ASAP as its 
availability was announced on lunar mailing list. Then applied bugfix to 
zlocal/udev (which is 060). Finally made diff against udev from moonbase 
(which was 059 at that time), tested 3 times if it works - works so done svn 
ci to commit bugfix to previously sent udev-060.

Thus my patch will update udev-059 to udev-060+bugfix.

Later done lunar update to notice that suprisingly fast my udev-060 was 
included in moonbase. I did not want to make mess so not sent bugfix alone.
I only told to remove lines below ) $C_FIFO 2>&1:

--- udev/DETAILS        2005-07-01 18:31:46.000000000 +0200
+++ udev/DETAILS        2005-07-04 15:02:59.000000000 +0200
(...)

because udev-060 was already in moonbase.

If someone would try to patch udev-060 with udev-060.patch with bugfix, a 
*.rej file could appear because there is 060 version already.

> Personally, I find this double submission of the patch a little weird.

Yes this is weird. Now I know that should sent bugfixed udev-060 once than
sending original udev-060 and later bugfixed udev-060.

This would not happen if this !@#$%^ (let say human) who sent udev-059 update 
read documentation provided with udev-059 and changed lunar config than 
blindly updating version number, date and sha1sum. What a pity I do not 
remember who was that.

People read changelogs and release-notes before updating modules!

> I  would have waited for it to get into moonbase...

My machine works, have patched udev in zlocal so do not need this in moonbase. 
If other people do not use hotplug devices so do not have troubles I think we 
can drop this patch.

> TIA,
> nestu ;)

greets,
Zbigniew 'zbiggy' Luszpinski


More information about the Lunar mailing list