projects
/
project
/
fstools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
jffs2reset: support fristboot on unmounted UBI overlay
[project/fstools.git]
/
jffs2reset.c
diff --git
a/jffs2reset.c
b/jffs2reset.c
index 2236e380bd82b9fd5e2c7171549b27cbb3e3ec5c..acff913409da7a7dd271cd16c6f76848905fdc53 100644
(file)
--- a/
jffs2reset.c
+++ b/
jffs2reset.c
@@
-19,12
+19,14
@@
#include <fcntl.h>
#include <dirent.h>
#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 <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"
#include "libfstools/libfstools.h"
#include "libfstools/volume.h"
@@
-79,6
+81,13
@@
static int jffs2_mark(struct volume *v)
return -1;
}
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);
sz = write(fd, &deadc0de, sizeof(deadc0de));
close(fd);