summaryrefslogtreecommitdiffstats
path: root/baseudev.py
Commit message (Collapse)AuthorAgeFilesLines
* Fixed the problem with string to list properties (#560262)Martin Gracik2010-02-021-1/+0
| | | | | Some udev properties which should be a string were wrongly converted to a list of words.
* pyudev: explicitly specify all return value and argument types (#559394)Hans de Goede2010-02-011-1/+1
| | | | | | | | | | | | | | | | | We were relying on the ctypes behavior to default to int as return type for all functions. But most of the functions in question are not returning int's but pointers, which are 64 bit on s390x (and ppc64 and x86_64). Due to the fact that we were getting virtual addresses below 4G + the C calling conventions on x86_64 making it not matter when passing in an 32 bit int instead of a 64 bit one, as long as the 32 bit one represent the correct number, we got away with this on x86_64 (unfortunately really). This patch very likely also fixes #560035. Note I also threw in a traceback fix in the same codepath, baseudev assumes that devices always have a DEVLINKS property, which is not true for for example network devices.
* Remove /sys prefix in udev_enumerate_devices()Hans de Goede2010-01-281-4/+7
| | | | | | | | | | | | | | | | The recent base_udev.py changes to switch over to global_udev.enumerate_devices(), move the removing of the /sys prefix to udev_get_device(). But in various places in the devicetree we call udev_get_device() (through udev_get_block_device) to get information from parents which are not yet in the tree (ie when we scan a partition before its disk). All these calls are broken now, as all those pass in a path without /sys at the front and the new udev_get_device() wants it with /sys in front. This patch makes udev_enumerate_devices() return paths without the /sys prefix, and reverses the changes to udev_get_device() to expect a full path, so that we use sysfs paths without /sys in front consistently everywhere.
* Use libudev's enumerate_devices function (#559394)Martin Gracik2010-01-281-14/+4
| | | | | Do not list the directories in sys, but use the libudev's enumerate_devices function to get the sysfs paths.
* iutil.execWithRedirect() hasn't used searchPath= since 2006. Take it out.Peter Jones2010-01-151-2/+2
| | | | | iutil.execWithRedirect() stopped doing anything with searchPath in 2006 when clumens committed d0dec24. Remove these silly vestigal bits.
* Rework udev_settle timeout handling (#544177)Hans de Goede2009-12-101-5/+6
| | | | | | | | | | | | | | | | | | 1) centralize the setting of the timeout parameter inside the udev_settle function. I do realize that the time needed for initially scanning all disks is much larger, then the time for scanning a single new partition when we are creating partitions. But since this is a timeout, and udevadm settle will exit as soon as the scanning is done, I see no reason not to have a single place to configure the timeout assuming the worst case scenario (the initial disk scan). This way we won't have these magic values sprinkled all over the code. 2) Given that in the past we've had bugs filed about anaconda taking many minutes to scan hardware on big iron machine and that our initial udev settle call will scan all disks, I think that udevadm's default timeout of 1 minutes is too low, so this patch sets the timeout to 5 minutes.
* Added the libudev python bindingsMartin Gracik2009-11-181-48/+12
| | | | | Also rewrote the baseudev.py to use the bindings instead of parsing the udev db file
* Remove unused attr_nomatch keyword argument from baseudev.udev_trigger.David Lehman2009-10-301-4/+1
|
* Expand udev_trigger to allow attr filtering and action specification.David Lehman2009-10-221-2/+5
|
* Make all sysfs path's be _without_ /sys prefix (#516168)Hans de Goede2009-08-071-5/+4
| | | | | | | | | | | | | | | | | Most sysfs path handling code expects / uses sysfs path's without the /sys prefix (as udev does internally). There were 4 functions which were exceptions to this: udev_enumerate_devices udev_enumerate_block_devices udev_get_device udev_get_block_device These expected resp. returned sysfs path's with /sys prefix. This inconsistency causes the backtrace in bug 516168. Rather then applying a simple fix for this, this patch makes the sysfs path usage consistent everywhere, to avoid issues like this in the future. This patch adjust the above 4 functions and all callers.
* Move basic udev methods out of the storage module (#514592).Chris Lumens2009-08-041-0/+136
The udev code can be used for more than just storage - it can be used for networking as well. Moving these methods out makes that a little more clear.