Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 79354 - hotplug/udev runs script before creating device node.
Summary: hotplug/udev runs script before creating device node.
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High critical
Assignee: Greg Kroah-Hartman (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-24 09:57 UTC by Bjarke Istrup Pedersen (RETIRED)
Modified: 2005-02-04 23:53 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2005-01-24 09:57:15 UTC
Starting a while ago, my script for uploading firmware to my printer stopped working when I inserted the USB cable, and had to be run manually afterwards.
Tried modifying the script, so it appends "ls -la /dev/usb" to a file (/var/log/usbdebug) .
When I inserted the cable, it didn't add anything to the file (= /dev/usb did not exist).

Then afterwards I ran the script manually, and this time /dev/usb and /dev/usb/lp0 showed up in the file.

It seems like udev / hotplug runs the script prior to making the device node.

Is this a bug, or have I missed a config option I can set to make it create the device node first?

Reproducible: Always
Steps to Reproduce:




Here is the script for uploading the firmware: (Is there another way to get 
hotplug/udev to do this)?

jupiter ~ # cat /etc/hotplug/usb/hplj1000
#!/bin/bash
# This script was written to auto-load the HP Laserjet 1000 drivers.

echo -n `date` >> /var/log/usbprinter
echo -n " HP Laserjet 1000 USB Firmware loading...        " 
>> /var/log/usbprinter
cat /lib/firmware/sihp1000.dl > /dev/usb/lp0 && echo "[   OK   ]" 
>> /var/log/usbprinter && exit;
echo "[ FAILED ]" >> /var/log/usbprinter
Comment 1 Greg Kroah-Hartman (RETIRED) gentoo-dev 2005-01-24 21:47:47 UTC
Use dev.d for your script, not the hotplug location.  See the udev documentation for how dev.d works for what you need to do for this.  Putting this file in the hotplug directory tree almost guarantees that this will not work properly, as those scripts do not know when the device node is created, only when the device is seen by the kernel (two different things).
Comment 2 Bjarke Istrup Pedersen (RETIRED) gentoo-dev 2005-01-24 23:31:56 UTC
It might be a stupid question .... but how exactly do I do this?
Comment 3 Greg Kroah-Hartman (RETIRED) gentoo-dev 2005-02-04 23:53:54 UTC
Read the /usr/share/doc/udev-051/RFC-dev.d.gz file for details.