block: support extroot and overlay mounts by device
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 6 Nov 2013 12:54:16 +0000 (12:54 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 7 Nov 2013 17:03:02 +0000 (17:03 +0000)
block.c

diff --git a/block.c b/block.c
index aa37e24c55698a01dd7751f3c99740c6731ecb5e..74e4d96c3fb900ff0b1c292bf362fa198b46a809 100644 (file)
--- a/block.c
+++ b/block.c
@@ -525,7 +525,7 @@ static struct blkid_struct_probe* find_block_info(char *uuid, char *label, char
 
        if (path)
                list_for_each_entry(pr, &devices, list)
-                       if (!strcmp(pr->dev, path))
+                       if (!strcmp(basename(pr->dev), basename(path)))
                                return pr;
 
        return NULL;
@@ -872,14 +872,14 @@ static int mount_extroot(char *cfg)
        if (!m || !m->extroot)
                return -1;
 
-       pr = find_block_info(m->uuid, m->label, NULL);
+       pr = find_block_info(m->uuid, m->label, m->device);
 
        if (!pr && delay_root){
                fprintf(stderr, "extroot: is not ready yet, retrying in %u seconds\n", delay_root);
                sleep(delay_root);
                mkblkdev();
                cache_load(0);
-               pr = find_block_info(m->uuid, m->label, NULL);
+               pr = find_block_info(m->uuid, m->label, m->device);
        }
        if (pr) {
                if (strncmp(pr->id->name, "ext", 3)) {