kmodloader: allow /etc/modules.d/ files to pass options
[project/ubox.git] / block.c
diff --git a/block.c b/block.c
index 941e4b825944aec08ff2667b9937cf1c48b5a7f4..7a55461a0da006ababa8a2c20ddaf6e68bfab388 100644 (file)
--- a/block.c
+++ b/block.c
@@ -466,7 +466,6 @@ static void cache_load(int mtd)
                _cache_load("/dev/mtdblock*");
        _cache_load("/dev/mmcblk*");
        _cache_load("/dev/sd*");
-       _cache_load("/dev/sdc*");
        _cache_load("/dev/hd*");
        _cache_load("/dev/md*");
        _cache_load("/dev/mapper/*");
@@ -520,12 +519,12 @@ static struct blkid_struct_probe* find_block_info(char *uuid, char *label, char
 
        if (label)
                list_for_each_entry(pr, &devices, list)
-                       if (strcmp(pr->label, label))
+                       if (!strcmp(pr->label, label))
                                return pr;
 
        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 +871,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)) {