Ejemplo n.º 1
0
void print_partion_info(void)
{
	block_dev_desc_t *dev_desc;
	disk_partition_t info;
	int pnum = 0;
	int i;
	unsigned long long start;
	unsigned long long size;

	dev_desc = get_dev("mmc", CONFIG_FASTBOOT_FLASH_MMC_DEV);
	if (!dev_desc || dev_desc->type == DEV_TYPE_UNKNOWN) {
		error("invalid mmc device\n");
		fastboot_fail("invalid mmc device");
		return;
	}
	pnum = get_partition_num(dev_desc);
	for (i = 1; i <= pnum; i++) {
		if (get_partition_info(dev_desc, i, &info))
			break;
		start = (unsigned long long)info.start * info.blksz;
		size = (unsigned long long)info.size * info.blksz;
		printf("part %3d::%12s\t start 0x%08llx, size 0x%08llx\n",
		       i, info.name, start, size);
	}
}
Ejemplo n.º 2
0
static struct partition_package *alloc_partition_package(struct gendisk *disk, int *len)
{
    struct partition_package *package;

    *len = sizeof(*package) + get_partition_num(disk) * sizeof(struct part_t);
    package = kzalloc(*len, GFP_KERNEL);    
    if (!package) {
        return NULL;
    }

    package->signature = 0x1;
    package->version = 0x1;
    package->nr_parts = get_partition_num(disk);
    package->sizeof_partition = sizeof(struct part_t);

    return package;
}