diff options
author | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2017-01-04 11:31:45 +0000 |
---|---|---|
committer | Pascal Terjan <pterjan@gmail.com> | 2017-01-17 23:58:13 +0000 |
commit | 480b568b1a5dac5bcab2590d81fdcad0a9f6f4f4 (patch) | |
tree | 8d5ba49b6177b3f1e3eae84fb9fe66235a44c610 | |
parent | 61e40f875c58086fcb0fdb9c71f56cd6a1e42664 (diff) | |
download | drakx-480b568b1a5dac5bcab2590d81fdcad0a9f6f4f4.tar drakx-480b568b1a5dac5bcab2590d81fdcad0a9f6f4f4.tar.gz drakx-480b568b1a5dac5bcab2590d81fdcad0a9f6f4f4.tar.bz2 drakx-480b568b1a5dac5bcab2590d81fdcad0a9f6f4f4.tar.xz drakx-480b568b1a5dac5bcab2590d81fdcad0a9f6f4f4.zip |
Renumber existing partitions before adding a new one (mga#19935).
-rw-r--r-- | perl-install/partition_table.pm | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm index 294e18052..5cd0ec228 100644 --- a/perl-install/partition_table.pm +++ b/perl-install/partition_table.pm @@ -360,15 +360,17 @@ sub will_tell_kernel { push @{$hd->{'will_tell_kernel' . ($o_delay || '')} ||= []}, [ $action, @para ]; } - if (!$o_delay) { - foreach my $delay ('delay_del', 'delay_add') { - my $l = delete $hd->{"will_tell_kernel$delay"} or next; - push @{$hd->{will_tell_kernel} ||= []}, @$l; - } - } $hd->{isDirty} = 1; } +sub will_tell_kernel_delayed { + my ($hd) = @_; + foreach my $delay ('delay_del', 'delay_add') { + my $l = delete $hd->{"will_tell_kernel$delay"} or next; + push @{$hd->{will_tell_kernel} ||= []}, @$l; + } +} + sub tell_kernel { my ($hd, $tell_kernel) = @_; @@ -493,6 +495,8 @@ sub remove { assign_device_numbers($hd); will_tell_kernel($hd, del => $part); + #- schedule renumbering after deleting the partition + will_tell_kernel_delayed($hd); return 1; } 0; @@ -584,6 +588,8 @@ sub add { } success: assign_device_numbers($hd); + #- schedule renumbering before adding the partition + will_tell_kernel_delayed($hd); will_tell_kernel($hd, add => $part); } |