summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2016-07-08 11:44:16 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2016-07-12 14:14:00 +0200
commit532fd1d60df306e204bae79c5158ca2302739966 (patch)
tree04431846aaa923fe0a372bb722a8fa8979d67ffb /perl-install
parentc0d5615fd3e1f76304cd2b53e6625a7b7f94e602 (diff)
downloaddrakx-532fd1d60df306e204bae79c5158ca2302739966.tar
drakx-532fd1d60df306e204bae79c5158ca2302739966.tar.gz
drakx-532fd1d60df306e204bae79c5158ca2302739966.tar.bz2
drakx-532fd1d60df306e204bae79c5158ca2302739966.tar.xz
drakx-532fd1d60df306e204bae79c5158ca2302739966.zip
sync libparted view with diskdrake one
in order to prevent overlapping errors when adding partitions: (b/c libparted doesn't know that diskdrake already removed the partitions in its memory view) "failed to add partition #1 on /dev/vda" "Error: Can't have overlapping partitions." "add_partition failed"
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/NEWS1
-rw-r--r--perl-install/install/NEWS1
-rw-r--r--perl-install/partition_table/gpt.pm5
3 files changed, 7 insertions, 0 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS
index fdc2ac150..09c4e0214 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -1,5 +1,6 @@
- diskdrake:
o don't offer to format RAID or BIOS boot partition
+ o fix clearing an already filled GPT disk
o make clear a BIOS boot partition cannot have a mount point
Version 17.50 - 8 July 2016
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index 82390140a..c1373fc7e 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -1,5 +1,6 @@
- fix starting spice-vdagentd
- partionning:
+ o auto_inst: fix clearing an already filled GPT disk
o don't offer to format RAID or BIOS boot partition
o make clear a BIOS boot partition cannot have a mount point
diff --git a/perl-install/partition_table/gpt.pm b/perl-install/partition_table/gpt.pm
index c5af99275..47cfa842e 100644
--- a/perl-install/partition_table/gpt.pm
+++ b/perl-install/partition_table/gpt.pm
@@ -79,6 +79,9 @@ sub write {
$partitions_killed = 1;
}
+ # sync libparted view with diskdrake one in order to prevent overlapping errors when adding partitions:
+ c::disk_delete_all($hd->{file}) if delete $hd->{sync_with_libparted};
+
foreach (@{$hd->{will_tell_kernel}}) {
my ($action, $part_number, $o_start, $o_size) = @$_;
my ($part) = grep { $_->{start} == $o_start && $_->{size} == $o_size } @$pt;
@@ -113,6 +116,8 @@ sub write {
sub initialize {
my ($class, $hd) = @_;
+ # sync libparted view with diskdrake one in order to prevent overlapping errors when adding partitions:
+ $hd->{sync_with_libparted} = 1;
# part_number starts at 1
my @raw = map { +{ part_number => $_ + 1 } } 0..$nb_primary-2;
$hd->{primary} = { raw => \@raw };