usbdump: Add support to scan maximum possible partitions

This change adds support to search for valid FAT32 partition
throughout the device during crashdump collection on USB,
despite encountering any invalid-partition on the loop.

Change-Id: Ic6bda03a2448c38f0e93d32214340c2ee896f385
Signed-off-by: Pavithra Palanisamy <pavip@codeaurora.org>
This commit is contained in:
Pavithra Palanisamy 2019-07-08 11:47:20 +05:30
parent 5cc17efe90
commit 06ceaec8fd

View file

@ -402,7 +402,8 @@ static int do_dumpqca_data(unsigned int dump_level)
#if defined(CONFIG_USB_STORAGE) && defined(CONFIG_FS_FAT)
static block_dev_desc_t *stor_dev;
disk_partition_t info;
int dev_indx, part_indx, max_dev_avail = 0, part = -1;
int dev_indx, max_dev_avail = 0;
int part_indx = 0, part = -1;
int fat_fs = 0;
char dev_str[3]; //dev_str = dev:part
@ -426,10 +427,6 @@ static int do_dumpqca_data(unsigned int dump_level)
snprintf(dev_str, sizeof(dev_str)+1, "%d:%d", dev_indx, part_indx);
part = get_device_and_partition("usb", dev_str, &stor_dev, &info, 1);
if (part < 0) {
printf("No valid partition available for device %d\n", dev_indx);
break;
}
if (fat_set_blk_dev(stor_dev, &info) == 0) {
fat_fs = 1;
@ -438,6 +435,9 @@ static int do_dumpqca_data(unsigned int dump_level)
break;
}
}
if (part < 0)
printf("No valid partition available for device %d\n", dev_indx);
}
if (fat_fs == 1)