summaryrefslogtreecommitdiff
path: root/ubi-utils
diff options
context:
space:
mode:
Diffstat (limited to 'ubi-utils')
-rw-r--r--ubi-utils/libubi.c4
-rw-r--r--ubi-utils/libubi_int.h3
2 files changed, 5 insertions, 2 deletions
diff --git a/ubi-utils/libubi.c b/ubi-utils/libubi.c
index 97c0434..758d351 100644
--- a/ubi-utils/libubi.c
+++ b/ubi-utils/libubi.c
@@ -524,7 +524,7 @@ libubi_t libubi_open(void)
if (!lib)
return NULL;
- lib->sysfs_ctrl = mkpath("/sys", SYSFS_CTRL);
+ lib->sysfs_ctrl = mkpath(SYSFS_ROOT, SYSFS_CTRL);
if (!lib->sysfs_ctrl)
goto out_error;
@@ -532,7 +532,7 @@ libubi_t libubi_open(void)
if (!lib->ctrl_dev)
goto out_error;
- lib->sysfs_ubi = mkpath("/sys", SYSFS_UBI);
+ lib->sysfs_ubi = mkpath(SYSFS_ROOT, SYSFS_UBI);
if (!lib->sysfs_ubi)
goto out_error;
diff --git a/ubi-utils/libubi_int.h b/ubi-utils/libubi_int.h
index c3aa37a..86ce18a 100644
--- a/ubi-utils/libubi_int.h
+++ b/ubi-utils/libubi_int.h
@@ -36,6 +36,9 @@ extern "C" {
* directories to '/sys/class/ubi/'. For now libubi assumes old layout.
*/
+#ifndef SYSFS_ROOT
+#define SYSFS_ROOT "/sys"
+#endif
#define SYSFS_UBI "class/ubi"
#define SYSFS_CTRL "class/misc/ubi_ctrl/"