Mageia Bugzilla – Attachment 9039 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
[patch]
Remove some code made redundant by the first patch
0003-Remove-redundant-code-when-initialising-a-partition-.patch (text/plain), 2.64 KB, created by
Thierry Vignaud
on 2017-03-07 21:51:35 CET
(
hide
)
Description:
Remove some code made redundant by the first patch
Filename:
MIME Type:
Creator:
Thierry Vignaud
Created:
2017-03-07 21:51:35 CET
Size:
2.64 KB
patch
obsolete
>From b50cb7fedaf75e94776286a8bbd6f65566cf5873 Mon Sep 17 00:00:00 2001 >From: Martin Whitaker <mageia@martin-whitaker.me.uk> >Date: Sat, 4 Mar 2017 12:34:09 +0000 >Subject: [PATCH 3/4] Remove redundant code when initialising a partition > table. > >Now we force the kernel to reread the partition table when we initialise >it, there's no need to also inform it that we've deleted all the existing >partitions. >--- > perl-install/fsedit.pm | 19 +++---------------- > perl-install/partition_table/raw.pm | 6 ------ > 2 files changed, 3 insertions(+), 22 deletions(-) > >diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm >index cfde46d..2fcd1f1 100644 >--- a/perl-install/fsedit.pm >+++ b/perl-install/fsedit.pm >@@ -209,7 +209,7 @@ sub get_hds { > > if ($flags->{clearall} || member($hd->{device}, @{$flags->{clear} || []})) { > my $lvms = []; #- temporary one, will be re-created later in get_hds() >- partition_table_initialize($lvms, $hd, $o_in); >+ partition_table_clear_and_initialize($lvms, $hd, $o_in); > } else { > my $handle_die_and_cdie = sub { > if (my $type = fs::type::type_subpart_from_magic($hd)) { >@@ -628,25 +628,12 @@ sub change_type { > > =item partition_table_clear_and_initialize($lvms, $hd, $o_in, $o_type, $b_warn) = @_; > >-wrapper around partition_table::initialize(). >- >-=cut >- >-sub partition_table_clear_and_initialize { >- my ($lvms, $hd, $o_in, $o_type, $b_warn) = @_; >- $hd->clear_existing; >- partition_table_initialize($lvms, $hd, $o_in, $o_type, $b_warn); >-} >- >-=item partition_table_initialize($lvms, $hd, $o_in, $o_type, $b_warn) = @_; >- >-wrapper around partition_table::initialize() like >-partition_table_clear_and_initialize() but which also create a singleton VG >+wrapper around partition_table::initialize() but which also create a singleton VG > automatically (so that it's easier for the user) > > =cut > >-sub partition_table_initialize { >+sub partition_table_clear_and_initialize { > my ($lvms, $hd, $o_in, $o_type, $b_warn) = @_; > partition_table::initialize($hd, $o_type); > if ($hd->isa('partition_table::lvm')) { >diff --git a/perl-install/partition_table/raw.pm b/perl-install/partition_table/raw.pm >index ebb20b1..8ea1ddb 100644 >--- a/perl-install/partition_table/raw.pm >+++ b/perl-install/partition_table/raw.pm >@@ -226,12 +226,6 @@ sub raw_add { > > sub zero_MBR { &partition_table::initialize } #- deprecated > >-sub clear_existing { >- my ($hd) = @_; >- my @parts = (partition_table::get_normal_parts($hd), if_($hd->{primary}{extended}, $hd->{primary}{extended})); >- partition_table::will_tell_kernel($hd, del => $_) foreach @parts; >-} >- > #- deprecated > sub zero_MBR_and_dirty { > my ($hd) = @_; >-- >2.10.2 >
From b50cb7fedaf75e94776286a8bbd6f65566cf5873 Mon Sep 17 00:00:00 2001 From: Martin Whitaker <mageia@martin-whitaker.me.uk> Date: Sat, 4 Mar 2017 12:34:09 +0000 Subject: [PATCH 3/4] Remove redundant code when initialising a partition table. Now we force the kernel to reread the partition table when we initialise it, there's no need to also inform it that we've deleted all the existing partitions. --- perl-install/fsedit.pm | 19 +++---------------- perl-install/partition_table/raw.pm | 6 ------ 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm index cfde46d..2fcd1f1 100644 --- a/perl-install/fsedit.pm +++ b/perl-install/fsedit.pm @@ -209,7 +209,7 @@ sub get_hds { if ($flags->{clearall} || member($hd->{device}, @{$flags->{clear} || []})) { my $lvms = []; #- temporary one, will be re-created later in get_hds() - partition_table_initialize($lvms, $hd, $o_in); + partition_table_clear_and_initialize($lvms, $hd, $o_in); } else { my $handle_die_and_cdie = sub { if (my $type = fs::type::type_subpart_from_magic($hd)) { @@ -628,25 +628,12 @@ sub change_type { =item partition_table_clear_and_initialize($lvms, $hd, $o_in, $o_type, $b_warn) = @_; -wrapper around partition_table::initialize(). - -=cut - -sub partition_table_clear_and_initialize { - my ($lvms, $hd, $o_in, $o_type, $b_warn) = @_; - $hd->clear_existing; - partition_table_initialize($lvms, $hd, $o_in, $o_type, $b_warn); -} - -=item partition_table_initialize($lvms, $hd, $o_in, $o_type, $b_warn) = @_; - -wrapper around partition_table::initialize() like -partition_table_clear_and_initialize() but which also create a singleton VG +wrapper around partition_table::initialize() but which also create a singleton VG automatically (so that it's easier for the user) =cut -sub partition_table_initialize { +sub partition_table_clear_and_initialize { my ($lvms, $hd, $o_in, $o_type, $b_warn) = @_; partition_table::initialize($hd, $o_type); if ($hd->isa('partition_table::lvm')) { diff --git a/perl-install/partition_table/raw.pm b/perl-install/partition_table/raw.pm index ebb20b1..8ea1ddb 100644 --- a/perl-install/partition_table/raw.pm +++ b/perl-install/partition_table/raw.pm @@ -226,12 +226,6 @@ sub raw_add { sub zero_MBR { &partition_table::initialize } #- deprecated -sub clear_existing { - my ($hd) = @_; - my @parts = (partition_table::get_normal_parts($hd), if_($hd->{primary}{extended}, $hd->{primary}{extended})); - partition_table::will_tell_kernel($hd, del => $_) foreach @parts; -} - #- deprecated sub zero_MBR_and_dirty { my ($hd) = @_; -- 2.10.2
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 20264
:
9028
|
9029
|
9030
|
9031
|
9037
|
9038
| 9039 |
9040
|
9041
|
9042
|
9043
|
9047
|
9054
|
9055
|
9060
|
9082