| 66 | } |
| 67 | |
| 68 | static int test_sun_i386(const disk_t *disk_car, const sun_partition_i386 *sunlabel, const partition_t *partition, const int verbose) |
| 69 | { |
| 70 | if ((le16(sunlabel->magic) != SUN_LABEL_MAGIC) || |
| 71 | (le32(sunlabel->magic_start) != SUN_LABEL_MAGIC_START)) |
| 72 | return 1; |
| 73 | if(verbose>0) |
| 74 | log_info("\nSUN Marker at %u/%u/%u\n", |
| 75 | offset2cylinder(disk_car,partition->part_offset), |
| 76 | offset2head(disk_car,partition->part_offset), |
| 77 | offset2sector(disk_car,partition->part_offset)); |
| 78 | #if !defined(SINGLE_PARTITION_TYPE) || defined(SINGLE_PARTITION_SUN) |
| 79 | { |
| 80 | int i; |
| 81 | partition_t *new_partition=partition_new(NULL); |
| 82 | for(i=0;i<16;i++) |
| 83 | { |
| 84 | if (sunlabel->partitions[i].num_sectors > 0 |
| 85 | && sunlabel->partitions[i].id > 0) |
| 86 | // && sunlabel->partitions[i].id != WHOLE_DISK) |
| 87 | { |
| 88 | partition_reset(new_partition, &arch_sun); |
| 89 | new_partition->order=i; |
| 90 | new_partition->part_type_sun=sunlabel->partitions[i].id; |
| 91 | new_partition->part_offset=partition->part_offset+(uint64_t)le32(sunlabel->partitions[i].start_sector) * le16(sunlabel->sector_size); |
| 92 | new_partition->part_size=(uint64_t)le32(sunlabel->partitions[i].num_sectors) * le16(sunlabel->sector_size); |
| 93 | new_partition->status=STATUS_PRIM; |
| 94 | log_partition(disk_car,new_partition); |
| 95 | } |
| 96 | } |
| 97 | free(new_partition); |
| 98 | } |
| 99 | #endif |
| 100 | return 0; |
| 101 | } |
| 102 | |
| 103 | int recover_sun_i386(const disk_t *disk_car, const sun_partition_i386 *sunlabel, partition_t *partition,const int verbose, const int dump_ind) |
| 104 | { |
no test coverage detected