summaryrefslogtreecommitdiffstats
path: root/perl-install/partition_table.pm
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2017-03-05 19:08:06 +0000
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2017-03-14 22:22:31 +0000
commit679ea1e5ab5c570b461cf3dacfe0fb61a04e9d79 (patch)
tree945126699b6e1a52ce809ec3fc2efb61795e13bf /perl-install/partition_table.pm
parent56c31ccc4deb378276afeff4780b59c16e77ce80 (diff)
downloaddrakx-679ea1e5ab5c570b461cf3dacfe0fb61a04e9d79.tar
drakx-679ea1e5ab5c570b461cf3dacfe0fb61a04e9d79.tar.gz
drakx-679ea1e5ab5c570b461cf3dacfe0fb61a04e9d79.tar.bz2
drakx-679ea1e5ab5c570b461cf3dacfe0fb61a04e9d79.tar.xz
drakx-679ea1e5ab5c570b461cf3dacfe0fb61a04e9d79.zip
When writing a GPT partition table, merge all actions into a single commit.
This avoids unnecessary udev events, which in some cases were causing udevd to trigger a kernel partition table reread, causing the kernel to get out of sync with drakx. In order to do so, the libparted bindings are enhanced so that we manipulate a 'ped_disk' object: - disk_open() returns such an object - set_disk_type() is removed - disk_commit() writes back the partition table and tell the kernel about it if we fails to write the partition table, we let partition_table::write() fire an exceptionc if we only have succeed in writing the partition table, we let partition_table::write() try harder (umounting partitions before trying againt to tell the kernel again) - need_to_tell_kernel() is overrided The last change is needed because we now tell the kernel about the new partition layout in partition_table::gpt::write() when calling disk_commit() while previously we were deferring that to partition_table::write() which after having called the gpt's write() calls tell_kernel() -> c::tell_kernel_to_reread_partition_table() So we must tell partition_table::write() that telling the kernel to reread the partition_table is not needed if we already succeeded in that.
Diffstat (limited to 'perl-install/partition_table.pm')
-rw-r--r--perl-install/partition_table.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm
index 20d6a2bce..791e8254b 100644
--- a/perl-install/partition_table.pm
+++ b/perl-install/partition_table.pm
@@ -435,7 +435,7 @@ sub tell_kernel {
my $F = partition_table::raw::openit($hd);
- my $force_reboot = any { $_->[0] eq 'init' } @$tell_kernel;
+ my $force_reboot = $hd->{rebootNeeded} || any { $_->[0] eq 'init' } @$tell_kernel;
if (!$force_reboot) {
foreach (@$tell_kernel) {
my ($action, $part_number, $o_start, $o_size) = @$_;