summaryrefslogtreecommitdiff
path: root/udev-add.c
AgeCommit message (Collapse)Author
2005-04-26[PATCH] udev use new libsysfs header file locationpatmans@us.ibm.com
Use the new location of libsysfs header files.
2005-04-26[PATCH] fix up bug created for udevtest in previous partition creation patch.greg@kroah.com
2005-04-26[PATCH] udev - create all partitions of blockdevicekay.sievers@vrfy.org
Here is the first try to create all partitons of a blockdevice, since removable media devices may need to acces the expected partition to revalidate the media. It uses the attribute syntax introduced with the last %s{file} patch. I'm using this with my multi-slot-flash-card-reader: SYSFS{model}="USB Storage-SMC ", NAME{all_partitions}="smartmedia" SYSFS{model}="USB Storage-CFC ", NAME{all_partitions}="compactflash" SYSFS{model}="USB Storage-MSC ", NAME{all_partitions}="memorystick" SYSFS{model}="USB Storage-MMC ", NAME{all_partitions}="multimedia" and I get: tree /udev/ /udev/ |-- memorystick |-- memorystick1 |-- memorystick10 |-- memorystick11 |-- memorystick12 |-- memorystick13 |-- memorystick14 |-- memorystick15 |-- memorystick2 |-- memorystick3 |-- memorystick4 |-- memorystick5 |-- memorystick6 |-- memorystick7 |-- memorystick8 |-- memorystick9 |-- multimedia |-- multimedia1 |-- multimedia10 |-- multimedia11 |-- multimedia12 |-- multimedia13 |-- multimedia14 |-- multimedia15 |-- multimedia2 |-- multimedia3 |-- multimedia4 |-- multimedia5 |-- multimedia6 |-- multimedia7 |-- multimedia8 |-- multimedia9 ... If needed, we can make the number of partions to create adjustable with the attribute?
2005-04-26[PATCH] add udevtest program to buildgreg@kroah.com
Also fix up some other dependancy issues in the Makefile. Thanks to Olaf Hering <olh@suse.de> for pointing them out.
2005-04-26[PATCH] remove some more KLIBC fixups that are no longer needed.greg@kroah.com
2005-04-26[PATCH] udev - fix "ignore method"kay.sievers@vrfy.org
On Sun, Feb 08, 2004 at 04:36:01PM +0100, Kay Sievers wrote: > We don't handle NAME="" the right way. Thanks to Emil None <emil71se@yahoo.com> > for pointing this out. Here is a fix for it and a trivial style cleanup. Changed the ignore dbg() to info().
2005-04-26[PATCH] set default owner/group in db - updatekay.sievers@vrfy.org
I've edited the man page today, so this is alreay included :) Also a few more trivials: o added the defaults to udev.conf.in o removed class_dev from get_default_mode(), to match with Hanna's o changed size of mode_str to MODE_SIZE o changed a few char compares from from 0x00 to '\0'
2005-04-26[PATCH] add udev logging to info logkay.sievers@vrfy.org
On Thu, Jan 15, 2004 at 05:14:16AM +0100, Kay Sievers wrote: > On Wed, Jan 14, 2004 at 01:10:43PM -0800, Greg KH wrote: > > On Wed, Jan 14, 2004 at 02:34:26PM -0600, Clay Haapala wrote: > > > On Wed, 14 Jan 2004, Chris Friesen spake thusly: > > > > > > > > Maybe for ones with a matching rule, you could print something like: > > > > > > > > > > > Is the act of printing/syslogging a rule in an of itself? > > > > No, as currently the only way stuff ends up in the syslog is if > > DEBUG=true is used on the build line. > > > > But it's sounding like we might want to change that... :) > > How about this in the syslog after connect/disconnect? > > Jan 15 05:07:45 pim udev[28007]: configured rule in '/etc/udev/udev.rules' at line 17 applied, 'video*' becomes 'video/webcam%n' > Jan 15 05:07:45 pim udev[28007]: creating device node '/udev/video/webcam0' > Jan 15 05:07:47 pim udev[28015]: removing device node '/udev/video/webcam0' Here is a slightly better version. I've created a logging.h file and moved the debug macros from udev.h in there. If you type: 'make' - you will get a binary that prints one or two lines to syslog if a device node is created or deleted 'make LOG=false' - you get a binary that prints asolutely nothing 'make DEBUG=true' - the same as today, it will print all debug lines
2005-04-26[PATCH] make symlink work properly if there is already a file in its placeazarah@nosferatu.za.org
If a file that is not a symlink (node, socket, fifo, etc) already exist where udev need to create a symlink, symlink() fails. This patch basically test for an existing file, and unlink it.
2005-04-26[PATCH] check for empty symlink stringkay.sievers@vrfy.org
Attached is a patch for udev-add.c to ignore empty symlink string parts. Issue was brought up by ide-devfs.sh with only one symlink returned, while two are expected.
2005-04-26[PATCH] libsysfs 0.4.0 patchdsteklof@us.ibm.com
Ananth released sysfsutils 0.4.0 last night, I'm sure you saw the email. Here's a patch with the latest changes from the pre-patch I already gave you. It includes sysfs_get_device_parent(), which you said you needed. I've run your test scripts and I've built scsi_id. Please play around with this and check it out. There are quite a few changes. Please do not access structure pointers, like sysfs_device's parent, directly like dev->parent. Please use the "get" function to retrieve. The functions load things on demand and refresh views under the covers.
2005-04-26[PATCH] pre-libsysfs-0.4.0 patchdsteklof@us.ibm.com
I am sending you a pre-release patch. It's everything that's in our current CVS tree. It adds the functionality you've been looking for. Please play with this before checking it into your tree, I'd like to know if it's ok with you or if you find problems. I have tested this out with test.all and the perl regression test. Let me know what you think. Still need to do more testing for our work and add some more functions related to the changes. I've gone into namedev.c and udev-add.c to make the necessary changes in line with the library. I have not gone and edited any of the "extras". Changes: 1) Libsysfs object structures work more as handles now, their included directories or devices are labeled private. If you need attributes from a sysfs_class_device, call the available function and don't access the directory directly. Same holds true for a sysfs_class_device sysfs_device. Do not access the link directly but call the function sysfs_get_classdev_device() instead. We only populate entries upon request, makes things faster and uses less memory. 2) Added sysfs_get_classdev_parent() as requested. 3) Changed getpagesize to sysconf. 4) Added sysfs_refresh_attributes function for refreshing views of attribute lists. We still need to add refresh for links and subdirs. All udev needs to do is keep calling sysfs_get_classdev_attr() and that will internally call the refresh routine.
2005-04-26[PATCH] allow multiple symlinkskay.sievers@vrfy.org
Here is a patch to allow the creation of multiple symlinks. The names must be separated by a space character. REPLACE, KERNEL="ttyUSB0", NAME="visor", SYMLINK="first-%n second-%n third-%n" results in: Dec 9 05:28:51 pim udev[12019]: create_node: mknod(udev-root/visor, 020666, 188, 0) Dec 9 05:28:51 pim udev[12019]: create_node: symlink 'udev-root/first-0' to node 'visor' requested Dec 9 05:28:51 pim udev[12019]: create_node: symlink(./visor, udev-root/first-0) Dec 9 05:28:51 pim udev[12019]: create_node: symlink 'udev-root/second-0' to node 'visor' requested Dec 9 05:28:51 pim udev[12019]: create_node: symlink(./visor, udev-root/second-0) Dec 9 05:28:51 pim udev[12019]: create_node: symlink 'udev-root/third-0' to node 'visor' requested Dec 9 05:28:51 pim udev[12019]: create_node: symlink(./visor, udev-root/third-0)
2005-04-26[PATCH] cleanup man & remove symlink commentkay.sievers@vrfy.org
remove "want symlinks" text from udev-add.c mention SYMLINK in man page man page format cleanup man page example for SYMLINK
2005-04-26[PATCH] move all of the DBUS logic into one file and remove all of the ↵greg@kroah.com
#ifdef crud from the main code.
2005-04-26[PATCH] D-BUS patch for udev-008david@fubar.dk
Attached is a patch against udev-008 to send out a D-BUS message when a device node is added or removed. Using D-BUS lingo, udev acquires the org.kernel.udev service and sends out a NodeCreated or NodeDeleted signal on the org.kernel.udev.NodeMonitor interface. Each signal carries two parameters: the node in question and the corresponding sysfs path. [Note: the D-BUS concepts of service, interface, object can be a bit confusing at first glance] An example program listening for these messages looks like this #!/usr/bin/python import dbus import gtk def udev_signal_received(dbus_iface, member, service, object_path, message): [filename, sysfs_path] = message.get_args_list() if member=='NodeCreated': print 'Node %s created for %s'%(filename, sysfs_path) elif member=='NodeDeleted': print 'Node %s deleted for %s'%(filename, sysfs_path) def main(): bus = dbus.Bus(dbus.Bus.TYPE_SYSTEM) bus.add_signal_receiver(udev_signal_received, 'org.kernel.udev.NodeMonitor', # interface 'org.kernel.udev', # service '/org/kernel/udev/NodeMonitor') # object gtk.mainloop() if __name__ == '__main__': main() and this is the output when hot-plugging some usb-storage. [david@laptop udev-008]$ ~/node_monitor.py Node /udev/sda created for /block/sda Node /udev/sda1 created for /block/sda/sda1 Node /udev/sda1 deleted for /block/sda/sda1 Node /udev/sda deleted for /block/sda The patch requires D-BUS 0.20 or later while the python example program requires D-BUS from CVS as I only recently applied a patch against the python bindings.
2005-04-26[PATCH] experimental (very simple) SYMLINK creationkay.sievers@vrfy.org
> > here is a experimental symlink creation patch - for discussion, > > in which direction we should go. > > It is possible now to define SYMLINK= after the NAME= in udev.rules. > > The link is relative to the node, but the path is not optimized now > > if the node and the link are in the same nested directory. > > Only one link is supported, cause i need to sleep now :) > > > > 06-simple-symlink-creation.diff > > simple symlink creation > > reorganized udev-remove to have access to the symlink field > > subdir creation/removal are functions now > > udev-test.pl tests for link creation/removal Here is a new version with relative link target path optimization an better tests in udev-test.pl: LABEL, BUS="scsi", vendor="IBM-ESXS", NAME="1/2/a/b/node", SYMLINK="1/2/c/d/symlink" Dec 7 06:48:34 pim udev[13789]: create_node: symlink 'udev-root/1/2/c/d/symlink' to node '1/2/a/b/node' requested Dec 7 06:48:34 pim udev[13789]: create_path: created 'udev-root/1/2/c' Dec 7 06:48:34 pim udev[13789]: create_path: created 'udev-root/1/2/c/d' Dec 7 06:48:34 pim udev[13789]: create_node: symlink(../../a/b/node, udev-root/1/2/c/d/symlink)
2005-04-26[PATCH] overall whitespace + debug text conditioningkay.sievers@vrfy.org
01-overall-whitespace+debug-text-conditioning.diff o cleanup whitespace o clarify a few comments o enclose all printed debug string values in ''
2005-04-26[PATCH] added ability to put format specifiers in the CALLOUT program string.greg@kroah.com
2005-04-26[PATCH] add support for string group and string user names in udev.permissions.greg@kroah.com
This only works if you are using glibc. Patch based on patch from Marco d'Itri <md@Linux.IT>
2005-04-26[PATCH] fix permissions to work properly now.greg@kroah.com
Forgot about umask in mknod...
2005-04-26[PATCH] get the major/minor number before we name the device.greg@kroah.com
Will come in handy later...
2005-04-26[PATCH] fix udev-add.c to build properly with older versions of gcc.greg@kroah.com
2005-04-26[PATCH] add support for subdirskay.sievers@vrfy.org
support subdirectory creation/removal for NAME="/devfs/is/crazy/video0" create parent subdirs for device node if needed remove subdirs when last node is removed
2005-04-26[PATCH] add uid/gid to nodeskay.sievers@vrfy.org
set uid/gid of node specified in udev.permissions only numeric id's are supported cause we can't resolve with klibc or libc before real /etc is mounted
2005-04-26[PATCH] udev: sleep_for_dev() bitsrml@tech9.net
OK, I fixed that bug you hinted at earlier in my previous sleep_for_dev() patch. I am sure you fixed it, but here we go nonetheless, just in case. I actually changed it up a bit. It is probably faster to count down from SECONDS_TO_WAIT_FOR_DEV than count up. I also made the lone 'path' argument const, since it can be. Some other misc. bits, too.
2005-04-26[PATCH] klibc specific tweaksgreg@kroah.com
2005-04-26[PATCH] udev-add build cleanups for other libc versions.greg@kroah.com
2005-04-26[PATCH] got rid of struct device_attrgreg@kroah.com
namedev.c is still a mess, that's up next after testing...
2005-04-26[PATCH] udev: another canidate for staticrml@tech9.net
Another one of those "trivial patches so everything must be good" sleep_for_dev() isn't exported or defined in a header, so it can be marked 'static'
2005-04-26[PATCH] Fix bug causing udev to sleep forever waiting for dev file to show up.greg@kroah.com
Now we will timeout properly.
2005-04-26[PATCH] make config files, sysfs root, and udev root configurable from ↵greg@kroah.com
config variables This will make running tests a lot simpler.
2005-04-26[PATCH] major database cleanupsgreg@kroah.com
Now we standardise on a struct udevice to pass around, and store in the database. This cleaned up the database code a lot.
2005-04-26[PATCH] don't sleep if 'dev' file is already present on device add.greg@kroah.com
instead sleep for up to 10 seconds waiting for it to show up.
2005-04-26[PATCH] fix comment about how the "dev" file is made up.greg@kroah.com
2005-04-26[PATCH] udev: mode should be mode_trml@tech9.net
Unix file modes should be stored in a mode_t, not a standard type. At the moment it is actually unsigned, in fact, not a signed integer. Attached patch does an s/int mode/mode_t mode/ and cleans up the results.
2005-04-26[PATCH] udev: trivial trivialitiesrml@tech9.net
Yah yah, really trivial stuff... - get_class_device() doesn't need to be exported; it should be static - white space cleanup
2005-04-26[PATCH] got "remove of named devices" working.greg@kroah.com
database code still needs some major cleanup.
2005-04-26[PATCH] fix segfaults when dealing with partitions.greg@kroah.com
2005-04-26[PATCH] tell the user what mknod() we are trying to do.greg@kroah.com
2005-04-26[PATCH] merge tdb into the build process.greg@kroah.com
2005-04-26[PATCH] udevdb prototypedsteklof@us.ibm.com
Here's an "idea" of what I had in mind for udevdb. Let me preface the code with a few remarks: 1) I was expecting to write this udevdb for udev to keep track of devices. I was planning an external package that depends upon udev to provide an external API to the udevdb database. The calls for the interface would be read only access. Not sure how you want to do packaging, if having a separate package is ok or having it included in udev. 2) I created it as it is because udev isn't a daemon. So, the open database call doesn't take any parameters. My plan was to create a udevdb_init function that took arguments for initializing the db to start, where you could specify in memory only or a file location. This can all be filled in. 3) I hacked the Makefile to get it to work. Not sure how you'd want that in the future. 4) This assumes TDB has been installed elsewhere, you would need to edit your Makefile and point it to the header and library locations. How do you want to do TDB in udev? Do you want to just reference it and make udev dependent on that package being installed. Or should we do what samba does and include a limited tdb version in udev? 5) Again, I hacked udev into your existing code. In the future, I'd probably make a function around the filling out the udevice before calling the store command. Didn't know if you wanted to change your add device function to use struct udevice rather than having everything separate. 6) Not sure what we should include in the udevice structure that's stored by udev. I made a stab at a first shot - we can add and remove of course, this was a first pass. I've come to realize - with you including libsysfs in udev, the "external" interface that references udevdb could make use of getting information from through libsysfs from sysfs and doesn't need to be in udevdb. 7) I could write a namedevdb for namedev's device management if you wanted.
2005-04-26[PATCH] minor cleanups.greg@kroah.com
2005-04-26[PATCH] cleanup the mknod code a bit.greg@kroah.com
2005-04-26[PATCH] remove mknod calloutgreg@kroah.com
Patch from "Guo, Min" <min.guo@intel.com>
2005-04-26[PATCH] handle new major:minor format of dev files that showed up in ↵greg@kroah.com
2.6.0-test2-bk3 or so.
2005-04-26[PATCH] split udev main logic into udev-add and udev-remove.greg@kroah.com