support UBI blocks (volumes)
authorRafał Miłecki <zajec5@gmail.com>
Wed, 17 Dec 2014 17:47:04 +0000 (18:47 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 6 Jan 2015 10:51:52 +0000 (11:51 +0100)
We already had ubifs idinfo, so only /dev/ubiN_M support was missing.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
block.c
libblkid-tiny/libblkid-tiny.c

diff --git a/block.c b/block.c
index bba68c2824388641e37ade4ea4531e283c0ed1c6..68cfd5a5a89207a7e03b438dff4ae0cfbd242521 100644 (file)
--- a/block.c
+++ b/block.c
@@ -481,6 +481,7 @@ static void cache_load(int mtd)
        if (mtd) {
                _cache_load("/dev/mtdblock*");
                _cache_load("/dev/ubiblock*");
+               _cache_load("/dev/ubi?*_?*");
        }
        _cache_load("/dev/mmcblk*");
        _cache_load("/dev/sd*");
index a01a43e9ed4eafa43eef46ab274975f7e691d565..1e641f7d38ec5cd5bf54d7f9d682d70bce996514 100644 (file)
@@ -174,7 +174,7 @@ int probe_block(char *block, struct blkid_struct_probe *pr)
        struct stat s;
        int i;
 
-       if (stat(block, &s) || (!S_ISBLK(s.st_mode) && !S_ISREG(s.st_mode)))
+       if (stat(block, &s) || (!S_ISBLK(s.st_mode) && !S_ISREG(s.st_mode) && !strncmp(block, "ubi", 3)))
                return -1;
 
        pr->err = -1;