return -1;
}
- mp = find_mount_point(v->blk, "jffs2");
+ mp = find_mount_point(v->blk, 1);
if (mp) {
fprintf(stderr, "%s is mounted as %s, only erasing files\n", v->blk, mp);
foreachdir(mp, handle_rmdir);
}
char*
-find_mount_point(char *block, char *fs)
+find_mount_point(char *block, int mtd_only)
{
FILE *fp = fopen("/proc/mounts", "r");
static char line[256];
*t = '\0';
t++;
- if (fs && strncmp(t, fs, strlen(fs))) {
+ if (mtd_only &&
+ strncmp(t, "jffs2", 6) &&
+ strncmp(t, "ubifs", 6)) {
fclose(fp);
fprintf(stderr, "block is mounted with wrong fs\n");
return NULL;
}
v = volume_find("rootfs_data");
- mp = find_mount_point(v->blk, NULL);
+ mp = find_mount_point(v->blk, 0);
if (mp) {
fprintf(stderr, "rootfs_data:%s is already mounted as %s\n", v->blk, mp);
return -1;
if (!v)
return -1;
- mp = find_mount_point(v->blk, NULL);
+ mp = find_mount_point(v->blk, 0);
if (mp) {
fprintf(stderr, "rootfs_data:%s is already mounted as %s\n", v->blk, mp);
return -1;
extern int find_overlay_mount(char *overlay);
extern char* find_mount(char *mp);
-extern char* find_mount_point(char *block, char *fs);
+extern char* find_mount_point(char *block, int mtd_only);
extern int find_filesystem(char *fs);
extern int find_mtd_block(char *name, char *part, int plen);
extern int find_mtd_char(char *name, char *part, int plen);
}
v = volume_find("rootfs_data");
- mp = find_mount_point(v->blk, NULL);
+ mp = find_mount_point(v->blk, 0);
if (mp) {
fprintf(stderr, "rootfs_data:%s is already mounted as %s\n", v->blk, mp);
return -1;
if (!v)
return -1;
- mp = find_mount_point(v->blk, NULL);
+ mp = find_mount_point(v->blk, 0);
if (mp) {
fprintf(stderr, "rootfs_data:%s is already mounted as %s\n", v->blk, mp);
return -1;