+ struct volume *v;
+ int ch, yes = 0, reset = 0;
+ while ((ch = getopt(argc, argv, "yr")) != -1) {
+ switch(ch) {
+ case 'y':
+ yes = 1;
+ break;
+ case 'r':
+ reset = 1;
+ break;
+ }
+
+ }
+
+ if (!yes && ask_user())
+ return -1;
+
+ /*
+ * TODO: Currently this only checks if kernel supports OverlayFS. We
+ * should check if there is a mount point using it with rootfs_data
+ * as upperdir.
+ */
+ if (find_filesystem("overlay")) {
+ ULOG_ERR("overlayfs not supported by kernel\n");
+ return -1;
+ }
+
+ v = volume_find("rootfs_data");
+ if (!v) {
+ ULOG_ERR("MTD partition 'rootfs_data' not found\n");
+ return -1;
+ }
+
+ volume_init(v);