diff options
author | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2017-02-20 21:42:27 +0000 |
---|---|---|
committer | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2017-02-20 23:08:36 +0000 |
commit | ca43ff9c8b9a53cb1d4d68173794556519bac257 (patch) | |
tree | dc20d4cb74c1e3081ce4f6f45b0a1350214da031 | |
parent | 48cef68d42e5d1076b2f3bed4b59be150de48694 (diff) | |
download | drakx-user/martinw/mga6.tar drakx-user/martinw/mga6.tar.gz drakx-user/martinw/mga6.tar.bz2 drakx-user/martinw/mga6.tar.xz drakx-user/martinw/mga6.zip |
Always tell the kernel about partition table changes when running the classic installer (mga#20074).user/martinw/mga6
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.
-rw-r--r-- | perl-install/partition_table/dos.pm | 12 |
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 ] } } |