add support for patched rootfs
authorJohn Crispin <blogic@openwrt.org>
Mon, 7 Oct 2013 15:46:45 +0000 (17:46 +0200)
committerJohn Crispin <blogic@openwrt.org>
Sat, 26 Oct 2013 09:25:28 +0000 (11:25 +0200)
Signed-off-by: John Crispin <blogic@openwrt.org>
mount_root.c

index f1474f0a2beee89ea9722a009baf3ba4dbe7df7d..8ebd64eead3556d2cbfa7704083cefa7c3c01274 100644 (file)
@@ -423,6 +423,9 @@ static int switch2jffs(void)
 {
        char mtd[32];
 
+       if (!find_mtd_block("rootfs_patches", mtd, sizeof(mtd)))
+               return 0;
+
        if (find_mtd_block("rootfs_data", mtd, sizeof(mtd))) {
                ERROR("no rootfs_data was found\n");
                return -1;
@@ -763,7 +766,9 @@ int main(int argc, char **argv)
        if (!getenv("PREINIT"))
                return -1;
 
-       if (find_mtd_char("rootfs_data", mtd, sizeof(mtd))) {
+       if (!find_mtd_block("rootfs_patches", mtd, sizeof(mtd))) {
+               ramoverlay();
+       } else if (find_mtd_char("rootfs_data", mtd, sizeof(mtd))) {
                if (!find_mtd_char("rootfs", mtd, sizeof(mtd)))
                        mtd_unlock(mtd);
                LOG("mounting /dev/root\n");