Changeset 88 in MondoRescue for branches/2.04_berlios/mondo
- Timestamp:
- Oct 27, 2005, 10:35:13 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.04_berlios/mondo/mondo/mondorestore/mondo-prep.c
r85 r88 1681 1681 sprintf(program, "parted2fdisk %s >> %s 2>> %s", drive, MONDO_LOGFILE, MONDO_LOGFILE); 1682 1682 1683 /* BERLIOS: shoould not be called each time */ 1684 part_table_fmt = which_partition_format(drive); 1683 1685 output[0] = '\0'; 1684 1686 /* make it a primary/extended/logical */ … … 1686 1688 sprintf(output + strlen(output), "n\np\n%d\n", partno); 1687 1689 } else { 1688 if (partno == 5) { 1689 part_table_fmt = which_partition_format(drive); 1690 /* MBR needs an extended partition if more than 4 partitions */ 1691 if (strcmp(part_table_fmt,"MBR") == 0) { 1692 if (partno == 5) { 1693 if (prev_partno >= 4) { 1694 log_to_screen("You need to leave at least one partition free, for 'extended/logical'"); 1695 paranoid_free(program); 1696 paranoid_free(partition_name); 1697 paranoid_free(tmp); 1698 paranoid_free(logfile); 1699 paranoid_free(output); 1700 return (1); 1701 } else { 1702 sprintf(output + strlen(output), "n\ne\n%d\n\n\n", prev_partno + 1); 1703 } 1704 } 1705 strcat(output + strlen(output), "n\nl\n"); 1706 } else { 1690 1707 /* GPT allows more than 4 primary partitions */ 1691 if ((prev_partno >= 4) && (strcmp(part_table_fmt,"MBR") == 0)) { 1692 log_to_screen("You need to leave at least one partition free, for 'extended/logical'"); 1693 paranoid_free(program); 1694 paranoid_free(partition_name); 1695 paranoid_free(tmp); 1696 paranoid_free(logfile); 1697 paranoid_free(output); 1698 return (1); 1699 } else { 1700 sprintf(output + strlen(output), "n\ne\n%d\n\n\n", prev_partno + 1); 1701 } 1702 } 1703 strcat(output + strlen(output), "n\nl\n"); 1708 sprintf(output + strlen(output), "n\np\n%d\n", partno); 1709 } 1704 1710 } 1705 1711 strcat(output + strlen(output), "\n"); /*start block (ENTER for next free blk */
Note:
See TracChangeset
for help on using the changeset viewer.