From ca43ff9c8b9a53cb1d4d68173794556519bac257 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Mon, 20 Feb 2017 21:42:27 +0000 Subject: Always tell the kernel about partition table changes when running the classic installer (mga#20074). The automatic rescan of the partition table is triggered by udevd. The udev rule that causes this is not present on the cut-down system that runs the classic installer. --- perl-install/partition_table/dos.pm | 12 ++++++++---- 1 file 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 ] } } -- cgit v1.2.1