aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ubi-utils/TODO8
-rw-r--r--ubi-utils/src/libubi.c12
-rw-r--r--ubi-utils/tests/README.udev10
3 files changed, 26 insertions, 4 deletions
diff --git a/ubi-utils/TODO b/ubi-utils/TODO
index 885a76f..a604170 100644
--- a/ubi-utils/TODO
+++ b/ubi-utils/TODO
@@ -6,5 +6,9 @@ TODO
* Remove the above misterious statement or make it understandable
* doc/ directory contains a file which refers images from /home/frank/
- please fix this or remove the whole doc/ altogether.
- * the scripts/ directory should live in mit-utils/tests/ubi-tests/scripts
- and it would be nice to have a short description of the tests
+ * the tests from the scripts/ directory should live in
+ mit-utils/tests/ubi-tests/ and it would be nice to have a short
+ description of the tests
+ * the stuff from the perl/ directory should go to the scripts/
+ * May we pleas split UBI-related stuff and pure NAND-related stuff and
+ not to keep this all in one.
diff --git a/ubi-utils/src/libubi.c b/ubi-utils/src/libubi.c
index a028fc6..4d2b725 100644
--- a/ubi-utils/src/libubi.c
+++ b/ubi-utils/src/libubi.c
@@ -276,6 +276,12 @@ int ubi_mkvol(libubi_t desc, const char *node, struct ubi_mkvol_request *req)
req->vol_id = r.vol_id;
close(fd);
+
+#ifdef UDEV_SETTLE_HACK
+ if (system("udevsettle") == -1)
+ return -1;
+#endif
+
return ret;
}
@@ -290,6 +296,12 @@ int ubi_rmvol(libubi_t desc, const char *node, int vol_id)
ret = ioctl(fd, UBI_IOCRMVOL, &vol_id);
close(fd);
+
+#ifdef UDEV_SETTLE_HACK
+ if (system("udevsettle") == -1)
+ return -1;
+#endif
+
return ret;
}
diff --git a/ubi-utils/tests/README.udev b/ubi-utils/tests/README.udev
index 6c12277..06e71d3 100644
--- a/ubi-utils/tests/README.udev
+++ b/ubi-utils/tests/README.udev
@@ -15,5 +15,11 @@ In our Ubuntu distribution we put that to new file:
/etc/udev/rules.d/50-local.rules
Another possibility is to call udevsettle utility in libubi after the volume
-has been created See src/libubi.c - the call is there but is commented out.
-This is anyway an ugly hack, but works, although makes the tests slower.
+has been created See src/libubi.c - the call is compiled in only if
+UDEV_SETTLE_HACK is defined. This is anyway an ugly hack, but works, although
+makes the tests slower. Suggestions are welcome.
+
+So, if you have udevsettel unility in your system, you do not have to do
+anyting, and the tests should work, because we compile libubi with
+UDEV_SETTLE_HACK. Otherwise, you should remove -D UDEV_SETTLE_HACK
+from the makefile and pre-create UBI device nodes.