1
#! /bin/sh /usr/share/dpatch/dpatch-run
3
## 06_run_udevsettle.dpatch
4
## by Reinhard Tartler <siretart@ubuntu.com>
6
## All lines beginning with `## DP:' are a description of the patch.
7
## DP: run udevsettle after dm device creation
8
## DP: See https://bugs.launchpad.net/bugs/132373
11
diff -urNad cryptsetup-1.0.6~pre1~/lib/libdevmapper.c cryptsetup-1.0.6~pre1/lib/libdevmapper.c
12
--- cryptsetup-1.0.6~pre1~/lib/libdevmapper.c 2007-10-25 09:11:19.000000000 +0200
13
+++ cryptsetup-1.0.6~pre1/lib/libdevmapper.c 2007-12-04 13:29:05.000000000 +0100
16
#define CRYPT_TARGET "crypt"
18
-#define UDEVSETTLE "/sbin/udevsettle"
20
-static void run_udevsettle(void)
25
static void set_dm_error(int level, const char *file, int line,
30
options->flags |= CRYPT_FLAG_READONLY;
32
- /* run udevsettle to avoid a race in libdevmapper causing busy dm devices */
36
+ * patch inspired from
37
+ * https://bugzilla.novell.com/show_bug.cgi?id=285478
39
+ * At this point, it is quite likely that there are currently
40
+ * devmapper events being processed. In order to avoid
41
+ * workarounds (which involve calling udevsettle at the
42
+ * 'right' places in scripts integrating cryptsetup), we are
43
+ * checking here if udevsettle is available and call it if it
46
+ if (0 == access("/sbin/udevsettle", X_OK)) {
47
+ system("/sbin/udevsettle");