@@ -200,6 +200,8 @@
#define UBI_IOCVOLCRBLK _IOW(UBI_VOL_IOC_MAGIC, 7, struct ubi_blkcreate_req)
/* Remove the R/O block device */
#define UBI_IOCVOLRMBLK _IO(UBI_VOL_IOC_MAGIC, 8)
+/* Dump LEB header */
+#define UBI_IOCEBDUMP _IOW(UBI_VOL_IOC_MAGIC, 9, struct ubi_ebdump_req)
/* Maximum MTD device name length supported by UBI */
#define MAX_UBI_MTD_NAME_LEN 127
@@ -437,4 +439,17 @@ struct ubi_blkcreate_req {
int8_t padding[128];
} __attribute__((packed));
+/**
+ * struct ubi_ebdump_req - a data structure used in dump eraseblock header.
+ * @lnum: logical eraseblock num to dump
+ * @ec_hdr: ec_hdr to set
+ * @vid_hdr: vid_hdr to set
+ */
+struct ubi_ebdump_req {
+ int32_t lnum;
+ int32_t pnum;
+ char ec_hdr[64];
+ char vid_hdr[64];
+} __attribute__((packed));
+
#endif /* __UBI_USER_H__ */
@@ -1123,6 +1123,14 @@ int ubi_vol_block_remove(int fd)
return ioctl(fd, UBI_IOCVOLRMBLK);
}
+int ubi_leb_dump_header(libubi_t desc, int fd, struct ubi_ebdump_req *request)
+{
+ desc = desc;
+ if (ioctl(fd, UBI_IOCEBDUMP, request))
+ return -1;
+ return 0;
+}
+
int ubi_update_start(libubi_t desc, int fd, long long bytes)
{
desc = desc;
Add same ioctl in user space. Signed-off-by: hujianyang <hujianyang@huawei.com> --- include/mtd/ubi-user.h | 15 +++++++++++++++ ubi-utils/libubi.c | 8 ++++++++ 2 files changed, 23 insertions(+)