summaryrefslogtreecommitdiffstats
path: root/perl-install/partition_table
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/partition_table')
-rw-r--r--perl-install/partition_table/dos.pm8
-rw-r--r--perl-install/partition_table/raw.pm6
2 files changed, 14 insertions, 0 deletions
diff --git a/perl-install/partition_table/dos.pm b/perl-install/partition_table/dos.pm
index c56cdab31..69566aaa8 100644
--- a/perl-install/partition_table/dos.pm
+++ b/perl-install/partition_table/dos.pm
@@ -278,6 +278,14 @@ sub end_write {
close $F;
}
+sub need_to_tell_kernel {
+ my ($hd) = @_;
+ # If none of the partitions are mounted, the kernel will automatically rescan
+ # the partition table. If any partitions are mounted, this doesn't happen, so
+ # we need to tell the kernel what has changed.
+ return any { $_->{isMounted} } partition_table::get_normal_parts($hd);
+}
+
sub empty_raw { { raw => [ ({}) x $nb_primary ] } }
sub initialize {
diff --git a/perl-install/partition_table/raw.pm b/perl-install/partition_table/raw.pm
index e9b293b90..ebb20b179 100644
--- a/perl-install/partition_table/raw.pm
+++ b/perl-install/partition_table/raw.pm
@@ -238,6 +238,12 @@ sub zero_MBR_and_dirty {
fsedit::partition_table_clear_and_initialize([], $hd);
}
+#- by default, we assume the kernel doesn't automatically reread partition table:
+sub need_to_tell_kernel {
+ my ($_hd) = @_;
+ 1;
+}
+
sub read_primary {
my ($hd) = @_;