summaryrefslogtreecommitdiffstats
path: root/perl-install/partition_table
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2015-03-25 04:54:11 -0400
committerThierry Vignaud <thierry.vignaud@gmail.com>2015-03-25 19:55:51 +0100
commit14f3a580a02af53896d98ac559ec0788642996a6 (patch)
tree7e82957188a445b1b66aeeeebac3c94133177956 /perl-install/partition_table
parentee22664bcb1fdedece15e07d047ba86f3d791ee6 (diff)
downloaddrakx-14f3a580a02af53896d98ac559ec0788642996a6.tar
drakx-14f3a580a02af53896d98ac559ec0788642996a6.tar.gz
drakx-14f3a580a02af53896d98ac559ec0788642996a6.tar.bz2
drakx-14f3a580a02af53896d98ac559ec0788642996a6.tar.xz
drakx-14f3a580a02af53896d98ac559ec0788642996a6.zip
set proper GUID to ESP partitions with GPT layout
Diffstat (limited to 'perl-install/partition_table')
-rw-r--r--perl-install/partition_table/gpt.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/perl-install/partition_table/gpt.pm b/perl-install/partition_table/gpt.pm
index fdcad1e85..c6dd20f8f 100644
--- a/perl-install/partition_table/gpt.pm
+++ b/perl-install/partition_table/gpt.pm
@@ -6,6 +6,7 @@ use vars qw(@ISA);
@ISA = qw(partition_table::raw);
+use fs::type;
use partition_table::raw;
use c;
@@ -110,7 +111,7 @@ sub read_one {
# FIXME: just use '@pt = map { ... } c::...' if part_numbers are always linear:
foreach (c::get_disk_partitions($hd->{file})) {
# fix detecting ESP (special case are they're detected through pt_type):
- if (c::is_partition_ESP($hd->{file}, $_->{part_number}) {
+ if (c::is_partition_ESP($hd->{file}, $_->{part_number})) {
$_->{pt_type} = 0xef;
}
@pt[$_->{part_number}-1] = $_;
@@ -141,6 +142,10 @@ sub write {
print "($action, $part_number, $o_start, $o_size)\n";
if ($action eq 'add') {
c::disk_add_partition($hd->{file}, $o_start, $o_size, $part->{fs_type}) or die "failed to add partition";
+ if (isESP($part)) {
+ c::set_partition_flag($hd->{file}, $part_number, 'ESP')
+ or die "failed to set type for $part->{file} on $part->{mntpoint}";
+ }
} elsif ($action eq 'del' and !$partitions_killed) {
c::disk_del_partition($hd->{file}, $part_number) or die "failed to del partition";
}