Since ramdisk-recovery.img is mounted on memory space and it also has
the same label with physical partition, the target partition could be
wrong if the ram-mounted partition is searched first. To resolve it,
this fixes partition search as excepting the devices including 'ram'
on its node name.
Change-Id: I15b6124eb202f0c5ddbe8ca518bfcc892309aa9a
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
if (!strncmp(type, "LABEL", 5) && !strncmp(value, label, strlen(label))) {
char *devname = strdup(blkid_dev_devname(dev));
+ /*
+ * To distinguish physical partition and ram mounted partition,
+ * continue to search the next entry if the devname includes
+ * 'ram'(eg. /dev/ram0).
+ */
+ if (strstr(devname, "ram")) {
+ free(devname);
+ continue;
+ }
+
blkid_tag_iterate_end(tag_iter);
blkid_dev_iterate_end(dev_iter);
blkid_put_cache(cache);