Mageia Bugzilla – Attachment 8896 Details for
Bug 20161
On non-GPT disk an empty partition is created when diskdrake does the partitioning, because it mistakenly thinks a BIOS boot partition is needed.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
alternative scheme for auto-allocating BIOS boot partitions
auto_allocate_bios_boot_parts.diff (text/plain), 1.77 KB, created by
Martin Whitaker
on 2017-01-25 23:19:51 CET
(
hide
)
Description:
alternative scheme for auto-allocating BIOS boot partitions
Filename:
MIME Type:
Creator:
Martin Whitaker
Created:
2017-01-25 23:19:51 CET
Size:
1.77 KB
patch
obsolete
>diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm >index 114039b..87fc5d2 100644 >--- a/perl-install/fsedit.pm >+++ b/perl-install/fsedit.pm >@@ -56,9 +56,6 @@ sub init_mntpnt_suggestions { > if (!any { isESP($_) } @$fstab) { > $mntpoint = { mntpoint => "/boot/EFI", size => MB(100), pt_type => 0xef, ratio => 1, maxsize => MB(300) }; > } >- } elsif (fs::any::is_boot_bios_part_needed($all_hds, $fstab)) { >- # suggests a Boot BIOS partition if none is present and if needed (aka !UEFI but disk is GPT partitionned) >- $mntpoint = { mntpoint => "", size => MB(1), pt_type => 'BIOS_BOOT', ratio => 1, maxsize => MB(2) }; > } > return if !$mntpoint; > foreach (keys %suggestions) { >@@ -518,6 +515,8 @@ sub auto_allocate { > my ($all_hds, $o_suggestions, $o_target) = @_; > my $before = listlength(fs::get::fstab($all_hds)); > >+ auto_allocate_bios_boot_parts($all_hds); >+ > my $suggestions = $o_suggestions || $suggestions{simple}; > allocatePartitions($all_hds, $suggestions, $o_target); > >@@ -545,6 +544,22 @@ sub auto_allocate { > fs::mount_point::suggest_mount_points_always(\@fstab); > } > >+sub auto_allocate_bios_boot_parts { >+ my ($all_hds) = @_; >+ foreach my $hd (@$all_hds)) { >+ # skip LVMs >+ next if isLVM($hd); >+ # skip non-GPT disks >+ next if (c::get_disk_type($hd->{device}) || partition_table::default_type($hd)) ne 'gpt'; >+ # check if a BIOS boot partition already exists >+ my @parts = map { partition_table::get_normal_parts($_) } $hd; >+ next if any { isBIOS_GRUB($_) } @parts; >+ # try to allocate a BIOS boot partition >+ $suggest = { mntpoint => "", size => MB(1), pt_type => 'BIOS_GRUB', ratio => 1, maxsize => MB(2) }; >+ allocatePartitions($all_hds, [ $suggest ], $hd); >+ } >+} >+ > sub auto_allocate_raids { > my ($all_hds, $suggestions) = @_; >
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm index 114039b..87fc5d2 100644 --- a/perl-install/fsedit.pm +++ b/perl-install/fsedit.pm @@ -56,9 +56,6 @@ sub init_mntpnt_suggestions { if (!any { isESP($_) } @$fstab) { $mntpoint = { mntpoint => "/boot/EFI", size => MB(100), pt_type => 0xef, ratio => 1, maxsize => MB(300) }; } - } elsif (fs::any::is_boot_bios_part_needed($all_hds, $fstab)) { - # suggests a Boot BIOS partition if none is present and if needed (aka !UEFI but disk is GPT partitionned) - $mntpoint = { mntpoint => "", size => MB(1), pt_type => 'BIOS_BOOT', ratio => 1, maxsize => MB(2) }; } return if !$mntpoint; foreach (keys %suggestions) { @@ -518,6 +515,8 @@ sub auto_allocate { my ($all_hds, $o_suggestions, $o_target) = @_; my $before = listlength(fs::get::fstab($all_hds)); + auto_allocate_bios_boot_parts($all_hds); + my $suggestions = $o_suggestions || $suggestions{simple}; allocatePartitions($all_hds, $suggestions, $o_target); @@ -545,6 +544,22 @@ sub auto_allocate { fs::mount_point::suggest_mount_points_always(\@fstab); } +sub auto_allocate_bios_boot_parts { + my ($all_hds) = @_; + foreach my $hd (@$all_hds)) { + # skip LVMs + next if isLVM($hd); + # skip non-GPT disks + next if (c::get_disk_type($hd->{device}) || partition_table::default_type($hd)) ne 'gpt'; + # check if a BIOS boot partition already exists + my @parts = map { partition_table::get_normal_parts($_) } $hd; + next if any { isBIOS_GRUB($_) } @parts; + # try to allocate a BIOS boot partition + $suggest = { mntpoint => "", size => MB(1), pt_type => 'BIOS_GRUB', ratio => 1, maxsize => MB(2) }; + allocatePartitions($all_hds, [ $suggest ], $hd); + } +} + sub auto_allocate_raids { my ($all_hds, $suggestions) = @_;
View Attachment As Raw
Actions:
View
Attachments on
bug 20161
:
8884
|
8885
|
8896
|
8897
|
8929
|
8930
|
8931
|
8932
|
8956
|
8957