Mageia Bugzilla – Attachment 9082 Details for
Bug 20264
Using "clear all" in diskdrake or in installer partitioning on GPT disk results in "failed to del partition #1 on /dev/..." message
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
Ensure kernel is informed when a DOS partition table is cleared
0007-Ensure-kernel-is-informed-when-a-DOS-partition-table.patch (text/plain), 1.85 KB, created by
Martin Whitaker
on 2017-03-12 23:03:28 CET
(
hide
)
Description:
Ensure kernel is informed when a DOS partition table is cleared
Filename:
MIME Type:
Creator:
Martin Whitaker
Created:
2017-03-12 23:03:28 CET
Size:
1.85 KB
patch
obsolete
>From d40965342c6360df001356ba166c53568569bb29 Mon Sep 17 00:00:00 2001 >From: Martin Whitaker <mageia@martin-whitaker.me.uk> >Date: Sun, 12 Mar 2017 18:51:16 +0000 >Subject: [PATCH 7/7] Ensure kernel is informed when a DOS partition table is > cleared. > >diskdrake allows the user to clear all partitions even when some of those >partitions are currently mounted. partition_table::dos::need_to_tell_kernel() >must return true in this case, as the automatic reread of the partition table >triggered by udevd will fail. > >diff --git a/perl-install/partition_table/dos.pm b/perl-install/partition_table/dos.pm >index 135d022..a97fcf8 100644 >--- a/perl-install/partition_table/dos.pm >+++ b/perl-install/partition_table/dos.pm >@@ -288,13 +288,18 @@ sub need_to_tell_kernel { > # 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); >+ # diskdrake will not let the user delete an individual partition that is mounted, but will let the >+ # user clear all partitions. So initialize() records if any partitions were mounted and we take note >+ # of that here. >+ return ! -e '/usr/lib/udev/rules.d/60-block.rules' || delete $hd->{hadMountedPartitions} || any { $_->{isMounted} } partition_table::get_normal_parts($hd); > } > > sub empty_raw { { raw => [ ({}) x $nb_primary ] } } > > sub initialize { > my ($class, $hd) = @_; >+ # Remember whether any existing partitions are mounted, for use by need_to_tell_kernel(). >+ $hd->{hadMountedPartitions} = 1 if any { $_->{isMounted} } partition_table::get_normal_parts($hd); > $hd->{primary} = empty_raw(); > bless $hd, $class; > } >-- >2.10.2 >
From d40965342c6360df001356ba166c53568569bb29 Mon Sep 17 00:00:00 2001 From: Martin Whitaker <mageia@martin-whitaker.me.uk> Date: Sun, 12 Mar 2017 18:51:16 +0000 Subject: [PATCH 7/7] Ensure kernel is informed when a DOS partition table is cleared. diskdrake allows the user to clear all partitions even when some of those partitions are currently mounted. partition_table::dos::need_to_tell_kernel() must return true in this case, as the automatic reread of the partition table triggered by udevd will fail. diff --git a/perl-install/partition_table/dos.pm b/perl-install/partition_table/dos.pm index 135d022..a97fcf8 100644 --- a/perl-install/partition_table/dos.pm +++ b/perl-install/partition_table/dos.pm @@ -288,13 +288,18 @@ sub need_to_tell_kernel { # 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); + # diskdrake will not let the user delete an individual partition that is mounted, but will let the + # user clear all partitions. So initialize() records if any partitions were mounted and we take note + # of that here. + return ! -e '/usr/lib/udev/rules.d/60-block.rules' || delete $hd->{hadMountedPartitions} || any { $_->{isMounted} } partition_table::get_normal_parts($hd); } sub empty_raw { { raw => [ ({}) x $nb_primary ] } } sub initialize { my ($class, $hd) = @_; + # Remember whether any existing partitions are mounted, for use by need_to_tell_kernel(). + $hd->{hadMountedPartitions} = 1 if any { $_->{isMounted} } partition_table::get_normal_parts($hd); $hd->{primary} = empty_raw(); bless $hd, $class; } -- 2.10.2
View Attachment As Raw
Actions:
View
Attachments on
bug 20264
:
9028
|
9029
|
9030
|
9031
|
9037
|
9038
|
9039
|
9040
|
9041
|
9042
|
9043
|
9047
|
9054
|
9055
|
9060
| 9082