summaryrefslogtreecommitdiffstats
path: root/discover
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>2015-08-14 15:25:14 +1000
committerSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>2015-08-18 15:30:50 +1000
commit185676316b4bd3192131a5419604a6a9cfd1d3d1 (patch)
treed299a9ad5f1df38588892a13c893da59bf0e4c8e /discover
parentacc5ace6e58db2f3dceb1f7a27d0fc1fb29c4a27 (diff)
downloadtalos-petitboot-185676316b4bd3192131a5419604a6a9cfd1d3d1.tar.gz
talos-petitboot-185676316b4bd3192131a5419604a6a9cfd1d3d1.zip
discover/devmapper: Disable libdm udev sync support
Certain userspace environments that Petitboot is packaged with include a libdm built with udev sync support which hung with the previous approach. Relying on udev to properly process dm device creation makes some assumptions about the flavour of udev available - until that is certain disable udev sync support and have device-mapper control device creation itself. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Diffstat (limited to 'discover')
-rw-r--r--discover/devmapper.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/discover/devmapper.c b/discover/devmapper.c
index b363932..1fd1215 100644
--- a/discover/devmapper.c
+++ b/discover/devmapper.c
@@ -40,12 +40,21 @@ static unsigned int get_block_sectors(struct discover_device *device)
return sectors;
}
-/* Petitboot's libdm isn't compiled with --enable-udev_sync, so we set
- * empty cookie and flags unconditionally */
+/*
+ * The system's libdm may or may not have udev sync support. Tell libdm
+ * to manage the creation of device nodes itself rather than waiting on udev
+ * to do it
+ */
static inline int set_cookie(struct dm_task *task, uint32_t *cookie)
{
+ uint16_t udev_rules = 0;
*cookie = 0;
- return dm_task_set_cookie(task, cookie, 0);
+
+ dm_udev_set_sync_support(0);
+ udev_rules |= DM_UDEV_DISABLE_DM_RULES_FLAG |
+ DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG;
+
+ return dm_task_set_cookie(task, cookie, udev_rules);
}
static bool snapshot_merge_complete(const char *dm_name)
OpenPOWER on IntegriCloud