Ignore:
Timestamp:
Oct 27, 2005, 10:35:13 PM (19 years ago)
Author:
bcornec
Message:

ia64:

  • corrects units issues in parted2fdisk.pl (cyl vs MB)
  • add -n option to parted2fdisk.pl
  • improve GPT support during partition restoration
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.04_berlios/mondo/mondo/mondorestore/mondo-prep.c

    r85 r88  
    16811681    sprintf(program, "parted2fdisk %s >> %s 2>> %s", drive, MONDO_LOGFILE, MONDO_LOGFILE);
    16821682
     1683    /* BERLIOS: shoould not be called each time */
     1684    part_table_fmt = which_partition_format(drive);
    16831685    output[0] = '\0';
    16841686    /* make it a primary/extended/logical */
     
    16861688        sprintf(output + strlen(output), "n\np\n%d\n", partno);
    16871689    } 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 {
    16901707            /* 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        }
    17041710    }
    17051711    strcat(output + strlen(output), "\n");  /*start block (ENTER for next free blk */
Note: See TracChangeset for help on using the changeset viewer.