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.pm12
1 files changed, 8 insertions, 4 deletions
diff --git a/perl-install/partition_table/dos.pm b/perl-install/partition_table/dos.pm
index 4e8dbf1f2..135d02208 100644
--- a/perl-install/partition_table/dos.pm
+++ b/perl-install/partition_table/dos.pm
@@ -281,10 +281,14 @@ sub end_write {
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);
+ # Whenever udevd receives a change event for a raw disk device it is watching, it asks the kernel to
+ # rescan the partition table on that device by calling the BLKRRPART ioctl. This is only successful
+ # if none of the partitions on that device are currently mounted. So if any partitions are mounted,
+ # we need to tell the kernel what has changed ourselves.
+ # The udev/rules.d/60-block.rules file causes the raw disk devices to be watched by udev. This file is
+ # not present in the cut-down system used to run the classic installer, so we always need to tell the
+ # kernel in that case.
+ return ! -e '/usr/lib/udev/rules.d/60-block.rules' || any { $_->{isMounted} } partition_table::get_normal_parts($hd);
}
sub empty_raw { { raw => [ ({}) x $nb_primary ] } }