X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fubox.git;a=blobdiff_plain;f=block.c;h=edfa62759efe2ead96bf3d3dd5968ad17fb42126;hp=18c9299961a4b55aa12ae98521a3c65e9bb20bf5;hb=9103ce9551882ebcb1aa34f1bdd3e1b2e2a8d93c;hpb=28f9eaee93e5b0ae37aec6db80865de2e01e6419 diff --git a/block.c b/block.c index 18c9299..edfa627 100644 --- a/block.c +++ b/block.c @@ -327,7 +327,7 @@ static int _cache_load(const char *path) struct blkid_struct_probe *pr = malloc(sizeof(struct blkid_struct_probe)); memset(pr, 0, sizeof(struct blkid_struct_probe)); probe_block(gl.gl_pathv[j], pr); - if (pr->err) + if (pr->err || !pr->id) free(pr); else list_add_tail(&pr->list, &devices); @@ -344,6 +344,10 @@ 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/*"); } static int print_block_info(struct blkid_struct_probe *pr) @@ -377,7 +381,7 @@ static int print_block_uci(struct blkid_struct_probe *pr) if (pr->uuid[0]) printf("\toption\tuuid\t'%s'\n", pr->uuid); else - printf("\toption\tdevice\t'%s'\n", basename(pr->dev)); + printf("\toption\tdevice\t'%s'\n", pr->dev); printf("\toption\tenabled\t'0'\n\n"); return 0;