Changeset 3553 in MondoRescue for branches/3.2/mindi/mr-parted2fdisk


Ignore:
Timestamp:
Apr 7, 2016, 3:47:44 AM (8 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/mindi/mr-parted2fdisk

    r3383 r3553  
    241241$type = mr_disk_type($device);
    242242# Replacement code only for GPT disks
    243 if ((($v == 1) || (($v == 2) && ($maj < 22))) && ($type ne "msdos")) {
     243if ((($v == 1) || (($v == 2) && ($maj < 22))) && ($type ne "MBR")) {
    244244    pb_log(1,"This distribution uses an old fdisk, activating replacement code for GPT disk label...\n");
    245245    my $parted = pb_check_req("parted",0);
     
    258258            } elsif ($i =~ /^n$/) {
    259259                fdisk_list($device,undef,\%start,\%end, 0);
    260                 if ($type ne "gpt") {
     260                if ($type ne "GPT") {
    261261                    pb_log(1,"Forcing GPT type of disk label\n");
    262262                    pb_log(1,"mklabel gpt\n");
    263263                    pb_system("$parted -s $device mklabel gpt\n") if ($fake == 0);
    264                     $type = "gpt";
     264                    $type = "GPT";
    265265                }
    266266                $l = <STDIN>;
Note: See TracChangeset for help on using the changeset viewer.