Ignore:
Timestamp:
Apr 7, 2016, 3:47:44 AM (4 years ago)
Author:
Bruno Cornec
Message:

Help Fix #790

  • Fix perl functions to handle disk type (MBR vs GPT) on RHEL7 and unify output format
  • Adds perl function to list all disks on the system
  • Adds perl program to unit test these functions
  • which_partition_format now uses mr-disk-type
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mondo/src/common/libmondo-devices.c

    r3539 r3553  
    33163316{
    33173317    char *output = NULL;
    3318     char *tmp = NULL;
    33193318    char *command = NULL;
    3320     mr_asprintf(command, "mr-parted2fdisk -l %s 2>/dev/null | grep 'EFI GPT'", drive);
    3321     mr_asprintf(tmp, "%s", call_program_and_get_last_line_of_output(command));
     3319    mr_asprintf(command, "mr-disk-type %s", drive);
     3320    mr_asprintf(output, "%s", call_program_and_get_last_line_of_output(command));
    33223321    mr_free(command);
    3323 
    3324     if (strstr(tmp, "GPT") == NULL) {
    3325         mr_asprintf(output, "%s", "MBR");
    3326     } else {
    3327         mr_asprintf(output, "%s", "GPT");
    3328     }
    3329     mr_free(tmp);
    33303322
    33313323    log_msg(0, "Found %s partition table format type on %s", output, drive);
Note: See TracChangeset for help on using the changeset viewer.