To erase the overlay partitions on systems using UBIFS overlay,
instead of writing the jffs2-marker, truncating the UBI volume to 0
has the desired effect.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
#include <fcntl.h>
#include <dirent.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <getopt.h>
+#include <mtd/ubi-user.h>
#include "libfstools/libfstools.h"
#include "libfstools/volume.h"
return -1;
}
+ if (volume_identify(v) == FS_UBIFS) {
+ uint64_t llz = 0;
+ int ret = ioctl(fd, UBI_IOCVOLUP, &llz);
+ close(fd);
+ return ret;
+ }
+
sz = write(fd, &deadc0de, sizeof(deadc0de));
close(fd);