aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libubi.c29
-rw-r--r--tests/ubi-tests/README.udev25
2 files changed, 0 insertions, 54 deletions
diff --git a/lib/libubi.c b/lib/libubi.c
index 758d351..99022dd 100644
--- a/lib/libubi.c
+++ b/lib/libubi.c
@@ -700,11 +700,6 @@ static int do_attach(const char *node, const struct ubi_attach_req *r)
if (ret == -1)
return -1;
-#ifdef UDEV_SETTLE_HACK
-// if (system("udevsettle") == -1)
-// return -1;
- usleep(100000);
-#endif
return ret;
}
@@ -850,12 +845,6 @@ int ubi_remove_dev(libubi_t desc, const char *node, int ubi_dev)
if (ret == -1)
goto out_close;
-#ifdef UDEV_SETTLE_HACK
-// if (system("udevsettle") == -1)
-// return -1;
- usleep(100000);
-#endif
-
out_close:
close(fd);
return ret;
@@ -1034,12 +1023,6 @@ int ubi_mkvol(libubi_t desc, const char *node, struct ubi_mkvol_request *req)
close(fd);
req->vol_id = r.vol_id;
-#ifdef UDEV_SETTLE_HACK
-// if (system("udevsettle") == -1)
-// return -1;
- usleep(100000);
-#endif
-
return 0;
}
@@ -1060,12 +1043,6 @@ int ubi_rmvol(libubi_t desc, const char *node, int vol_id)
close(fd);
-#ifdef UDEV_SETTLE_HACK
-// if (system("udevsettle") == -1)
-// return -1;
- usleep(100000);
-#endif
-
return 0;
}
@@ -1086,12 +1063,6 @@ int ubi_rnvols(libubi_t desc, const char *node, struct ubi_rnvol_req *rnvol)
close(fd);
-#ifdef UDEV_SETTLE_HACK
-// if (system("udevsettle") == -1)
-// return -1;
- usleep(100000);
-#endif
-
return 0;
}
diff --git a/tests/ubi-tests/README.udev b/tests/ubi-tests/README.udev
deleted file mode 100644
index 06e71d3..0000000
--- a/tests/ubi-tests/README.udev
+++ /dev/null
@@ -1,25 +0,0 @@
-There is a problem with udev: when a volume is created, there is a delay
-before corresponding /dev/ubiX_Y device node is created by udev, so some
-tests fail because of this. The symptom is error messages like
-"cannot open /dev/ubi0_0".
-
-One possible solution of this problem is to pre-create UBI device and volume
-nodes. There is even a script which may be used for this in ubi-utils/scripts/.
-But this is not enough because udev will still remove and re-create the nodes
-and tests will still fail. So you need to stop removing device nodes using
-the following udev rule:
-
- KERNEL=="ubi*_*", ACTION=="remove", OPTIONS+="ignore_device"
-
-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 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.