X-Git-Url: http://git.archive.openwrt.org/?p=project%2Ffstools.git;a=blobdiff_plain;f=block.c;h=843d40292a016146292dd9ae27df80aead9f7e14;hp=2e95c033b53ba23b091498e396e2db41e9f0141a;hb=bb2239de848e7289856068ba0952bb4492c395d8;hpb=f9ad6bacd7efa578369427e7e75f0177bd3cf290 diff --git a/block.c b/block.c index 2e95c03..843d402 100644 --- a/block.c +++ b/block.c @@ -518,6 +518,7 @@ static void cache_load(int mtd) _cache_load("/dev/ubiblock*"); _cache_load("/dev/ubi[0-9]*"); } + _cache_load("/dev/loop*"); _cache_load("/dev/mmcblk*"); _cache_load("/dev/sd*"); _cache_load("/dev/hd*"); @@ -526,25 +527,6 @@ static void cache_load(int mtd) _cache_load("/dev/mapper/*"); } -static int print_block_info(struct blkid_struct_probe *pr) -{ - printf("%s:", pr->dev); - if (pr->uuid[0]) - printf(" UUID=\"%s\"", pr->uuid); - - if (pr->label[0]) - printf(" LABEL=\"%s\"", pr->label); - - if (pr->name[0]) - printf(" NAME=\"%s\"", pr->name); - - if (pr->version[0]) - printf(" VERSION=\"%s\"", pr->version); - - printf(" TYPE=\"%s\"\n", pr->id->name); - - return 0; -} static int print_block_uci(struct blkid_struct_probe *pr) { @@ -676,6 +658,34 @@ static char* find_mount_point(char *block) return point; } +static int print_block_info(struct blkid_struct_probe *pr) +{ + static char *mp; + + mp = find_mount_point(pr->dev); + printf("%s:", pr->dev); + if (pr->uuid[0]) + printf(" UUID=\"%s\"", pr->uuid); + + if (pr->label[0]) + printf(" LABEL=\"%s\"", pr->label); + + if (pr->name[0]) + printf(" NAME=\"%s\"", pr->name); + + if (pr->version[0]) + printf(" VERSION=\"%s\"", pr->version); + + if (mp) { + printf(" MOUNT=\"%s\"", mp); + free(mp); + } + + printf(" TYPE=\"%s\"\n", pr->id->name); + + return 0; +} + static void mkdir_p(char *dir) { char *l = strrchr(dir, '/');