mirror of
https://github.com/thead-yocto-mirror/meta-openembedded
synced 2026-08-15 17:28:04 +02:00
* add more hacks to compile * binaries tested on Zaurus poodle/corgi (with patched kernel) * bump PR * NOTES * strange behavior wrt getopt for at least ubiformat: * you should pass the options first, i.e. * ubiformat -O 512 /dev/mtd3 *works* * ubiformat /dev/mtd3 -O 512 *fails* Signed-off-by: Andrea Adami <andrea.adami@gmail.com> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
83 lines
2.0 KiB
Diff
83 lines
2.0 KiB
Diff
--- a/ubi-utils/libubi.c 2012-05-01 01:57:51.000000000 +0200
|
|
+++ b/ubi-utils/libubi.c 2012-05-01 01:55:14.000000000 +0200
|
|
@@ -36,6 +36,26 @@
|
|
#include "libubi_int.h"
|
|
#include "common.h"
|
|
|
|
+/* parts of mtd/ubi-user.h */
|
|
+
|
|
+/* Set an UBI volume property */
|
|
+#define UBI_IOCSETPROP _IOW(UBI_VOL_IOC_MAGIC, 6, struct ubi_set_prop_req)
|
|
+
|
|
+/**
|
|
+ * struct ubi_set_prop_req - a data structure used to set an ubi volume
|
|
+ * property.
|
|
+ * @property: property to set (%UBI_PROP_DIRECT_WRITE)
|
|
+ * @padding: reserved for future, not used, has to be zeroed
|
|
+ * @value: value to set
|
|
+ */
|
|
+struct ubi_set_prop_req {
|
|
+ uint8_t property;
|
|
+ uint8_t padding[7];
|
|
+ uint64_t value;
|
|
+} __attribute__ ((packed));
|
|
+
|
|
+/* end parts of mtd/ubi-user.h */
|
|
+
|
|
/**
|
|
* mkpath - compose full path from 2 given components.
|
|
* @path: the first component
|
|
@@ -382,8 +402,8 @@
|
|
return errmsg("\"%s\" is not a character device", node);
|
|
}
|
|
|
|
- major = major(st.st_rdev);
|
|
- minor = minor(st.st_rdev);
|
|
+ major = __major(st.st_rdev);
|
|
+ minor = __minor(st.st_rdev);
|
|
|
|
if (minor == 0) {
|
|
errno = EINVAL;
|
|
@@ -448,8 +468,8 @@
|
|
return errmsg("\"%s\" is not a character device", node);
|
|
}
|
|
|
|
- major = major(st.st_rdev);
|
|
- minor = minor(st.st_rdev);
|
|
+ major = __major(st.st_rdev);
|
|
+ minor = __minor(st.st_rdev);
|
|
|
|
if (minor != 0) {
|
|
errno = EINVAL;
|
|
@@ -686,7 +706,7 @@
|
|
* success and %-1 in case of failure. @r->ubi_num contains newly created UBI
|
|
* device number.
|
|
*/
|
|
-static int do_attach(const char *node, const struct ubi_attach_req *r)
|
|
+static int do_attach(const char *node, struct ubi_attach_req *r)
|
|
{
|
|
int fd, ret;
|
|
|
|
@@ -757,8 +777,8 @@
|
|
mtd_dev_node);
|
|
}
|
|
|
|
- major = major(sb.st_rdev);
|
|
- minor = minor(sb.st_rdev);
|
|
+ major = __major(sb.st_rdev);
|
|
+ minor = __minor(sb.st_rdev);
|
|
|
|
if (major != MTD_CHAR_MAJOR) {
|
|
errno = EINVAL;
|
|
@@ -866,8 +886,8 @@
|
|
return -1;
|
|
}
|
|
|
|
- major = major(st.st_rdev);
|
|
- minor = minor(st.st_rdev);
|
|
+ major = __major(st.st_rdev);
|
|
+ minor = __minor(st.st_rdev);
|
|
|
|
if (ubi_get_info((libubi_t *)lib, &info))
|
|
return -1;
|