| 63 | } |
| 64 | |
| 65 | int recover_APFS(const disk_t *disk, const nx_superblock_t *sb, partition_t *partition, const int verbose, const int dump_ind) |
| 66 | { |
| 67 | if(test_APFS(sb, partition)!=0) |
| 68 | return 1; |
| 69 | if(dump_ind!=0) |
| 70 | { |
| 71 | if(partition!=NULL && disk!=NULL) |
| 72 | log_info("\nAPFS magic value at %u/%u/%u\n", |
| 73 | offset2cylinder(disk,partition->part_offset), |
| 74 | offset2head(disk,partition->part_offset), |
| 75 | offset2sector(disk,partition->part_offset)); |
| 76 | /* There is a little offset ... */ |
| 77 | dump_log(sb,DEFAULT_SECTOR_SIZE); |
| 78 | } |
| 79 | if(partition==NULL) |
| 80 | return 0; |
| 81 | set_APFS_info(sb, partition); |
| 82 | partition->part_type_i386=P_LINUX; |
| 83 | partition->part_type_mac=PMAC_LINUX; |
| 84 | partition->part_type_sun=PSUN_LINUX; |
| 85 | partition->part_type_gpt=GPT_ENT_TYPE_MAC_APFS; |
| 86 | partition->part_size=le32(sb->nx_block_size) * le64(sb->nx_block_count); |
| 87 | guid_cpy(&partition->part_uuid, (const efi_guid_t *)&sb->nx_uuid); |
| 88 | if(verbose>0) |
| 89 | { |
| 90 | log_info("\n"); |
| 91 | } |
| 92 | partition->sborg_offset=0; |
| 93 | partition->sb_size=le32(sb->nx_block_size); |
| 94 | partition->sb_offset=0; |
| 95 | if(verbose>0) |
| 96 | { |
| 97 | log_info("recover_APFS: s_blocksize=%u\n", partition->blocksize); |
| 98 | log_info("recover_APFS: s_blocks_count %lu\n", (long unsigned int)le64(sb->nx_block_count)); |
| 99 | if(disk==NULL) |
| 100 | log_info("recover_APFS: part_size %lu\n", (long unsigned)(partition->part_size / DEFAULT_SECTOR_SIZE)); |
| 101 | else |
| 102 | log_info("recover_APFS: part_size %lu\n", (long unsigned)(partition->part_size / disk->sector_size)); |
| 103 | } |
| 104 | return 0; |
| 105 | } |
no test coverage detected