+ /* select the specified disk partition */
+ if (block0_is_bpb(boot_block)) {
+ device_error(device_instance_device(raw_disk), "Unimplemented BPB");
+ }
+ else if (block0_is_fdisk(boot_block)) {
+ /* return an instance */
+ ppcboot_partition_t *partition_table = (ppcboot_partition_t*) &boot_block[446];
+ ppcboot_partition_t *partition_entry;
+ disklabel *label;
+ if (partition > 4)
+ device_error(device_instance_device(raw_disk),
+ "Only FDISK partitions 1..4 supported");
+ partition_entry = &partition_table[partition - 1];
+ label = ZALLOC(disklabel);
+ label->raw_disk = raw_disk;
+ label->pos = 0;
+ label->sector_begin = 512 * sector2uw(partition_entry->sector_begin);
+ label->sector_length = 512 * sector2uw(partition_entry->sector_length);
+ PTRACE(disklabel, ("partition %ld, sector-begin %ld, length %ld\n",
+ (long)partition,
+ (long)label->sector_begin,
+ (long)label->sector_length));
+ if (filename != NULL)
+ device_error(device_instance_device(raw_disk),
+ "FDISK file names not yet supported");
+ return device_create_instance_from(NULL, raw_disk,
+ label,
+ NULL, args,
+ &package_disklabel_callbacks);
+ }
+ else if (block0_is_mac_disk(boot_block)) {
+ device_error(device_instance_device(raw_disk), "Unimplemented MAC DISK");
+ }
+ else {
+ device_error(device_instance_device(raw_disk),
+ "Unreconized bootblock");
+ }