make sure to also scan for leading and ending " when looking for mtd devices
authorJohn Crispin <blogic@openwrt.org>
Thu, 9 Apr 2015 20:53:59 +0000 (22:53 +0200)
committerJohn Crispin <blogic@openwrt.org>
Thu, 9 Apr 2015 20:53:59 +0000 (22:53 +0200)
Signed-off-by: John Crispin <blogic@openwrt.org>
block.c

diff --git a/block.c b/block.c
index a3db87bc936d782d5e8892f8be930e5a867299a2..aecf36669c5c3b38db6d4a4a78c842a13d291371 100644 (file)
--- a/block.c
+++ b/block.c
@@ -969,7 +969,7 @@ static int check_extroot(char *path)
        char devpath[32];
 
 #ifdef UBIFS_EXTROOT
-       if (find_block_mtd("rootfs", devpath, sizeof(devpath))) {
+       if (find_block_mtd("\"rootfs\"", devpath, sizeof(devpath))) {
                int err = -1;
                libubi_t libubi;
 
@@ -980,7 +980,7 @@ static int check_extroot(char *path)
                        return -1;
        }
 #else
-       if (find_block_mtd("rootfs", devpath, sizeof(devpath))) {
+       if (find_block_mtd("\"rootfs\"", devpath, sizeof(devpath))) {
                if (find_root_dev(devpath, sizeof(devpath))) {
                        ULOG_ERR("extroot: unable to determine root device\n");
                        return -1;
@@ -1142,7 +1142,7 @@ static int main_extroot(int argc, char **argv)
         */
 
        /* Start with looking for MTD partition */
-       find_block_mtd("rootfs_data", blkdev_path, sizeof(blkdev_path));
+       find_block_mtd("\"rootfs_data\"", blkdev_path, sizeof(blkdev_path));
        if (blkdev_path[0]) {
                pr = find_block_info(NULL, NULL, blkdev_path);
                if (pr && !strcmp(pr->id->name, "jffs2")) {