summaryrefslogtreecommitdiffstats
path: root/udev
Commit message (Collapse)AuthorAgeFilesLines
* pvscan: add --activate ay option (autoactivate)Peter Rajnoha2012-06-281-1/+1
| | | | | | | | | | | Define auto_activation_handler that activates VGs/LVs automatically based on the activation/auto_activation_volume_list (activating all volumes by default if the list is not defined). The autoactivation is done within the pvscan call in 69-dm-lvmetad.rules that watches for udev events (device appearance/removal). For now, this works for non-clustered and complete VGs only.
* udev: udev rules cleanupPeter Rajnoha2012-06-275-27/+30
| | | | | | | | | | | | | | | | Remove executable path detection in udev rules and use sbindir that is configured, but still provide the original functionality by means of 'configure --enable-udev-rule-exec-detection'. Normally, the exec path for the tools called in udev rules should not differ from the sbindir used, however, there are cases this is necessary. For example different environments could be assembled in a way that these path differ for some reason (distribution installer, initrd ...). This functionality is kept for compatibility only. Any environment moving the binaries around and using different paths should be fixed eventually!
* Detect the lvm binary path in lvmetad udev rules.Peter Rajnoha2012-03-121-1/+6
| | | | | | | | | | We can't use 'DM_SBIN_PATH'. This one is set only for DM devices but not for all block devices - the pvscan is run on all relevant block devices! This LVM_SBIN_PATH (as well as DM_SBIN_PATH) detection should be removed eventually but for upstream solution, we still have to do that as there are known cases where the binaries are put either in /sbin or /usr/sbin (some installation systems, initrd systems etc.).
* Switch pvscan --cache major:minor to --major --minor.Alasdair Kergon2012-03-061-1/+1
|
* Change pvscan --lvmetad to pvscan --cache.Alasdair Kergon2012-03-021-1/+1
|
* Add skeleton for lvmetad udev rules - 69-dm-lvm-metad.rules.Peter Rajnoha2012-02-242-0/+29
| | | | | | | | | | | | | | | | | | | | Why using the order 69: - Storage processing in general happens in 60-persistent-storage.rules, including the blkid call that adds some usable information we can use for filtering and speedup (these rules are part of upstream udev and the order is preserved on most distros) - There's still some other storage-related processing done after 60-persistent-storage.rules in general. These might add some detailed storage-related information we might use to filter devices effectively (e.g. MD udev rules, ...). - We need lvmetad rules to be processed before any consumers can use the output - so the metadata cache is ready soon enough (e.g. udisks rules). - There's no official (upstream udev) document about assigning the order, so this number is chosen in best belief it will suit all scenarios.
* Clean intermediate files.Peter Rajnoha2012-02-231-1/+1
|
* Call built-in blkid conditionaly (udev version >= 176), call standard blkidPeter Rajnoha2012-02-202-2/+8
| | | | with full path otherwise.
* Switch to using built-in blkid in 13-dm-disk.rules.Peter Rajnoha2012-02-161-1/+1
| | | | Available in udev since version 176.
* typoPeter Rajnoha2012-02-151-1/+1
|
* Add watch rule to 13-dm-disk.rules.Peter Rajnoha2012-02-151-0/+11
| | | | | | | | We don't have anything better yet... The problems the watch rule caused when removing devices should be covered now with the "retry remove" logic. It's also better to have this maintained by us, rather than having this rule anywhere else without proper control.
* Update udev rules to skip DM flags decoding for removed devicesZdenek Kabelac2011-08-111-6/+6
| | | | | | | | | Skip decoding of DM flags when device is removed. We currently need DM flags only for add|change events. So forking dmsetup process for removed devices is a waste of CPU time. Udev is already quite slow, so make it just a tiny bit faster.
* Set DM_UDEV_DISABLE_OTHER_RULES_FLAG for suspended DM devices in udev rules.Peter Rajnoha2011-01-281-0/+5
| | | | | | | | | | | | | This is to avoid any scanning and processing of DM devices while they are in suspended state (e.g. a rename while the device is suspended - a CHANGE event is generated!). Otherwise, any scanning in the rules could end up with locking the calling process until the device is resumed and so we don't receive a notification about udev rules completion until then (and that effectively locks out the process awaiting the notification!). However, we still keep 'disk' and any 'subsystem' related udev rules running. We trust these and these should check themselves whether a device is suspended or not, not trying to run any scanning if it is.
* Fix udev rules to support udev database content generated by older rules.Peter Rajnoha2010-08-121-2/+5
| | | | | | | | | | | | | | | | | | | | | | This can happen with older rules (without support for synthesized events) that are still part of initrd while using new udev rules in the system itself. The consequence was that new udev rules incorrectly assumed that not having DM_UDEV_PRIMARY_SOURCE_FLAG set always means the uevent is synthesized and inappropriate (device is still not properly activated) and so it should be ignored. However, initrd is not updated automatically while updating the libdevmapper/udev rules in the system and so we end up with the rules not detecting and setting crucial parts in the initrd environment and the rules in the system that rely on the information that should have been stored in udev db (which is incorrect in this configuration, of course). The overall consequence is that the update of libdevmapper/lvm2 without regenerating the initrd could end up with a boot failure! Ignoring the event means removing any existing symlinks in /dev! To fix this, increase udev rules version to make a difference. So from now on, mark rules without proper support for synthesized events as DM_UDEV_RULES_VSN="1" and 2 (or higher) if that support is included.
* Reinstate detection of inappropriate uevent with DISK_RO set and suppress it.Peter Rajnoha2010-08-121-0/+3
| | | | | | | | We still need to detect this one! We're not so strict with CHANGE events as with the ADD events while applying filters in the rules so this one would pass and it would process the rules prematurely (because it appears *before* the actual CHANGE event used when resuming a DM device while setting read-only state at the same time).
* Use "nowatch" udev rule for known inappropriate devices.Peter Rajnoha2010-07-072-0/+2
| | | | | | | | | | | | | For now, this is just a precaution. Normally, all the other (non-dm) rules should check DM_UDEV_DISABLE_OTHER_RULES_FLAG and therefore avoid setting any inotify watches as well. But let's make sure. Support for final assignment of the "nowatch" rule (the use of ":=") will appear in next udev release, v160. This should also work in previous udev versions but the setting won't be sealed so any further OPTIONS="watch" will always prevail there. We may want to add more specific "nowatch" rules later if needed.
* Fix udev rules to handle spurious events properly.Peter Rajnoha2010-06-231-18/+24
| | | | | | | | | | | | We can use DM_UDEV_PRIMARY_SOURCE_FLAG to identify the spurious events and use it as an indication that the device has already been activated before (and hence we can find this property in udev database). WARNING: This change requires udev startup script to preserve udev database from initrd. All the information stored there during activation of devices is important for the initial "udevadm trigger --action=add" call that is used in udev startup script. If not done this way, udev startup script needs to define DM_UDEV_PRIMARY_SOURCE_FLAG=1 property for any ADD events it uses.
* Add support for new IMPORT{db} udev rule.Peter Rajnoha2010-04-281-0/+22
| | | | | | | | | | This rule appeared in udev v152 and it helps us to support spurious events where we didn't have any flags set (events originated in udevadm trigger or the watch rule). These flags are important to direct the rule application. Now, with the help of this rule, we can regenerate old udev db content. To implement this correctly, we need to flag all proper DM udev events with DM_UDEV_PRIMARY_SOURCE_FLAG. That happens automatically for all ioctls generating events originated in libdevmapper.
* Update install rules for udev.Zdenek Kabelac2010-04-091-18/+7
| | | | | | | | | | | | Fix unwanted modification of $(top_builddir)/make.tmpl. Using dependency rules to install rules for udev. There is minor problem, with concurent usage of builddir and srcdir could lead to missuse of 10-dm.rules which could be found in VPATH from different builddir. However current solution uses intermediate target so the generated 10-dm.rules exists only for short period of time during make install execution.
* Use vpath instead of VPATH.Zdenek Kabelac2010-04-091-1/+2
| | | | | | | | | | | | | | | Usage of VPATH makes troubles when used within $(builddir). Not only source files are being found through VPATH, but targets as well. (make --debug=v) Thus if user builds the code in $(srcdir) and also in some $(builddir) he gets mangled results as some generated files (i.e. .export.sym) are 'reused' from $(srcdir) instead of $(builddir). This patch switches to use vpath were we could explicitly name suffixes that should be looked via vpath - we must take care, we do not generate files with these suffixes: .c, .in, .po, .exported_symbols
* Install generated 10-dm.rules from builddir.Zdenek Kabelac2010-03-311-1/+2
| | | | | Patch just check whether file is generated in builddir otherwise srcdir file is used.
* Use $(top_builddir) for inclusion of make.tmpl in Makefiles.Zdenek Kabelac2010-03-041-1/+1
|
* Remove hard-coded rule to skip _mimage devices in 11-dm-lvm.rules.Peter Rajnoha2010-02-151-1/+1
| | | | | | | There's a tiny period of time when the _mimage device is visible during downconversion from mirror to linear. Since it is visible, we need to create the symlinks, otherwise warning messages will be issued about udev not creating those symlinks. We have to rely on udev flags completely.
* Always set environment variables for an LVM2 device in 11-dm-lvm.rules.Peter Rajnoha2010-01-071-1/+2
| | | | | This way we can still use DM_LV_NAME, DM_VG_NAME and DM_LV_LAYER in all the other rules.
* Disable udev rules on change event with DISK_RO=1.Peter Rajnoha2009-12-071-0/+7
| | | | | | | | | | | | | | There's a new change udev event generated since kernel 2.6.32 that notifies userspace about a change in read-only attribute for block devices (with DISK_RO=1 environment variable set). We need to detect this and disable the rule application so the meaning of this change event is not interchanged with the regular change event used while resuming/renaming DM devices. If there's anybody awaiting this notification in foreign rules, he can still check for this env var and do the appropriate actions separately.
* Remove 'last_rule' from udev rules.Peter Rajnoha2009-11-131-13/+4
| | | | | | | | 'last_rule' option has been removed from udev (version >= 147). From now on, we require foreign rules to check and honor ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG} instead. Foreign rules should be skipped totally when this flag is set.
* More cleanup in udev rules:Peter Rajnoha2009-11-013-8/+11
| | | | | | | | | | | | | - add copyright notice for 10-dm.rules.in, - set DM_UDEV_DISABLE_{DISK, OTHER}_RULES_FLAG in 11-dm-lvm.rules directly for inappropriate and non-top-level subdevices in case we use older kernels where DM_COOKIE is not used (and therefore there are no flags passed from the LVM process itself). This applies for older kernels (version < 2.6.31), - remove unnecessary filters in 95-dm-notify.rules - the DM_COOKIE env var itself is set for change/remove udev events and for DM devices only so there's no need to double-check this.
* add copyright linesAlasdair Kergon2009-10-264-0/+16
|
* Cleanup of previous commit with latest changes in udev support code.Peter Rajnoha2009-10-261-1/+1
|
* Several changes to udev support code:Peter Rajnoha2009-10-264-13/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | - we have these levels when the udev rules are processed: 10-dm.rules --> [11-dm-<subsystem>.rules] --> [12-dm-permissions.rules] --> 13-dm-disk.rules --> [...all the other foreign rules...] --> 95-dm-notify.rules - each level can be disabled now by DM_UDEV_DISABLE_{DM, SUBSYSTEM, DISK, OTHER}_RULES_FLAG - add DM_UDEV_DISABLE_DM_RULES_FLAG to disable 10-dm.rules - add DM_UDEV_DISABLE_OTHER_RULES_FLAG to disable all the other (non-dm) rules. We cutoff these rules by using the 'last_rule', so this one should really be used with great care and in well-founded situations. We use this for lvm's hidden and layer devices now. - add a parameter for add_dev_node, rm_dev_node and rename_dev_node so it's possible to switch on/off udev checks - use DM_UDEV_DISABLE_DM_RULES_FLAG and DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG if there's no cookie set and we have resume, remove and rename ioctl. This could happen when someone uses the libdevmapper that is compiled with udev_sync but the software does not make use of it. This way we can switch off the rules and fallback to libdevmapper node creation so there's no udev/libdevmapper race.
* Rename 11-lvm.rules to 11-dm-lvm.rules and 12-dm-disk.rules to 13-dm-disk.rules.Peter Rajnoha2009-10-262-0/+0
|
* Use udev flags in the rules and cleanup the rules:Peter Rajnoha2009-10-225-26/+17
| | | | | | | - remove default permissions set in 95-dm-notify.rules (and add a hint in 12-dm-permissions.rules to set it by the user directly) - add multipath DM_ACTION=="PATH_FAILED" filter - remove unnecessary filters in the headers of the rules (we can simply use DM_UDEV_RULES_VSN instead) - fix symlink priorities in /dev/disk/ (snapshot volumes have low priority for FS UUID symlinks so it will not overwrite symlinks for the origin)
* Allow for a build directory separate from the source.Alasdair Kergon2009-10-021-6/+7
|
* Add more hints in 12-dm-permissions.rules. Add 'dmsetup splitname' and ↵Peter Rajnoha2009-09-231-2/+51
| | | | 'y|--yes' to dmsetup manpage.
* Add some advisory comments for users in 12-dm-permissions.rules.Peter Rajnoha2009-09-221-3/+9
|
* Several changes in udev rules:Peter Rajnoha2009-09-115-8/+37
| | | | | | | | | | | - add DM_UDEV_RULES_VSN to provide a variable to be checked for in the other rules (e.g. to check that DM rules are actually installed, we can alternate functionality in the other rules based on this information, also we have versioning support for the rules) - set proper sbin path for dmsetup and blkid, /sbin first, then /usr/sbin. This is necessary for anaconda to work properly. - add 'last_rule' for cryptsetup's temporary devices (symlinks in /dev/mapper only)
* Use new blkid instead of vol_id in udev rules.Peter Rajnoha2009-08-141-1/+1
| | | | Thanks to Daniel Mierswa for reminding us.
* Remove 11-dm-permissions.rules (is now in 12-dm-permissions.rules).Peter Rajnoha2009-08-061-18/+0
|
* Rename template rule file 11-dm-permissions.rules to 12-dm-permissions.rules.Peter Rajnoha2009-08-061-0/+18
|
* Fix a typo in udev rule (splitname, NOT namesplit)Peter Rajnoha2009-08-042-2/+2
|
* Add default udev rules.Alasdair Kergon2009-08-036-0/+169
| | | | Update dm-ioctl.h comments.
* dummy makefile for now to keep builds happyAlasdair Kergon2009-07-311-0/+16