diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2015-03-24 10:47:13 -0400 |
---|---|---|
committer | Thierry Vignaud <thierry.vignaud@gmail.com> | 2015-03-25 19:55:50 +0100 |
commit | ee22664bcb1fdedece15e07d047ba86f3d791ee6 (patch) | |
tree | cffb13ac5187db2920dc75c07d9e353e092e4421 /perl-install/c | |
parent | b2df46a676b8511523ab6859f5393680316e1b1f (diff) | |
download | drakx-ee22664bcb1fdedece15e07d047ba86f3d791ee6.tar drakx-ee22664bcb1fdedece15e07d047ba86f3d791ee6.tar.gz drakx-ee22664bcb1fdedece15e07d047ba86f3d791ee6.tar.bz2 drakx-ee22664bcb1fdedece15e07d047ba86f3d791ee6.tar.xz drakx-ee22664bcb1fdedece15e07d047ba86f3d791ee6.zip |
fix retrieving ESP partition type
ESP are the only partitions we're detecting through their pt_type
(modulo 0x12 which was Compaq Diagnostic & unlikely to be found on
GPT...)
However GPT has no equivalent to pt_type
But we can test for ESP flag
Diffstat (limited to 'perl-install/c')
-rwxr-xr-x | perl-install/c/stuff.xs.pl | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/perl-install/c/stuff.xs.pl b/perl-install/c/stuff.xs.pl index 631271a1e..c6adf9a68 100755 --- a/perl-install/c/stuff.xs.pl +++ b/perl-install/c/stuff.xs.pl @@ -576,6 +576,27 @@ get_iso_volume_ids(int fd) print ' +int +is_partition_ESP(char * device_path, int part_number) + CODE: + PedDevice *dev = ped_device_get(device_path); + RETVAL = 0; + if(dev) { + PedDisk* disk = ped_disk_new(dev); + if(disk) { + PedPartition* part = ped_disk_get_partition(disk, part_number); + if (!part) { + printf("is_partition_ESP: failed to find partition\n"); + } else { + RETVAL=ped_partition_get_flag(part, PED_PARTITION_ESP); + } + ped_disk_destroy(disk); + } + } + OUTPUT: + RETVAL + + const char * get_disk_type(char * device_path) CODE: |