Mageia Bugzilla – Attachment 8882 Details for
Bug 20074
Partitions with Type: Empty corrupt the partition table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
Patch to preserve Empty partitions rather than treating them as free space
0003-Preserve-DOS-Empty-partitions-instead-of-treating-th.patch (text/plain), 1.62 KB, created by
Martin Whitaker
on 2017-01-22 01:57:15 CET
(
hide
)
Description:
Patch to preserve Empty partitions rather than treating them as free space
Filename:
MIME Type:
Creator:
Martin Whitaker
Created:
2017-01-22 01:57:15 CET
Size:
1.62 KB
patch
obsolete
>From 5c624d0d86a8ec70f647593138da89b5f2b29ba6 Mon Sep 17 00:00:00 2001 >From: Martin Whitaker <mageia@martin-whitaker.me.uk> >Date: Sat, 21 Jan 2017 20:23:18 +0000 >Subject: [PATCH 3/4] Preserve DOS "Empty" partitions instead of treating them > as free space (mga#20074). > >To minimise the changes this close to mga6 release (and until we fix >the bug in partition auto-allocation that mistakenly creates BIOS boot >partitions non-GPT disks), reuse the BIOS_GRUB flag for flagging Empty >partitions, as the real partition ID (0x00) is used to flag free space. > >diff --git a/perl-install/fs/type.pm b/perl-install/fs/type.pm >index ad84738..a6a53c8 100644 >--- a/perl-install/fs/type.pm >+++ b/perl-install/fs/type.pm >@@ -26,7 +26,7 @@ my (%type_name2pt_type, %type_name2fs_type, %fs_type2pt_type, %pt_type2fs_type, > 0x83 => 'btrfs', 'Journalised FS: Btrfs', > (is_uefi() ? > (0xef => 'vfat', 'EFI System Partition') : >- ('BIOS_GRUB' => 'BIOS_GRUB', 'BIOS boot partition'), >+ ('BIOS_GRUB' => 'BIOS_GRUB', 'BIOS boot or Empty partition') > ), > if_(arch() =~ /i.86|x86_64/, > 0x83 => 'xfs', 'Journalised FS: XFS', >diff --git a/perl-install/partition_table/dos.pm b/perl-install/partition_table/dos.pm >index 6833324..1123826 100644 >--- a/perl-install/partition_table/dos.pm >+++ b/perl-install/partition_table/dos.pm >@@ -212,6 +212,7 @@ sub read_one { > sysread $F, $tmp, psizeof($format) or die "error while reading partition table in sector $sector"; > my %h; > @h{@fields} = unpack $format, $tmp; >+ $h{pt_type} = 'BIOS_GRUB' if $h{pt_type} == 0 && $h{size} > 0; > fs::type::set_pt_type(\%h, $h{pt_type}); > \%h; > } (1..$nb_primary); >-- >2.10.2 >
From 5c624d0d86a8ec70f647593138da89b5f2b29ba6 Mon Sep 17 00:00:00 2001 From: Martin Whitaker <mageia@martin-whitaker.me.uk> Date: Sat, 21 Jan 2017 20:23:18 +0000 Subject: [PATCH 3/4] Preserve DOS "Empty" partitions instead of treating them as free space (mga#20074). To minimise the changes this close to mga6 release (and until we fix the bug in partition auto-allocation that mistakenly creates BIOS boot partitions non-GPT disks), reuse the BIOS_GRUB flag for flagging Empty partitions, as the real partition ID (0x00) is used to flag free space. diff --git a/perl-install/fs/type.pm b/perl-install/fs/type.pm index ad84738..a6a53c8 100644 --- a/perl-install/fs/type.pm +++ b/perl-install/fs/type.pm @@ -26,7 +26,7 @@ my (%type_name2pt_type, %type_name2fs_type, %fs_type2pt_type, %pt_type2fs_type, 0x83 => 'btrfs', 'Journalised FS: Btrfs', (is_uefi() ? (0xef => 'vfat', 'EFI System Partition') : - ('BIOS_GRUB' => 'BIOS_GRUB', 'BIOS boot partition'), + ('BIOS_GRUB' => 'BIOS_GRUB', 'BIOS boot or Empty partition') ), if_(arch() =~ /i.86|x86_64/, 0x83 => 'xfs', 'Journalised FS: XFS', diff --git a/perl-install/partition_table/dos.pm b/perl-install/partition_table/dos.pm index 6833324..1123826 100644 --- a/perl-install/partition_table/dos.pm +++ b/perl-install/partition_table/dos.pm @@ -212,6 +212,7 @@ sub read_one { sysread $F, $tmp, psizeof($format) or die "error while reading partition table in sector $sector"; my %h; @h{@fields} = unpack $format, $tmp; + $h{pt_type} = 'BIOS_GRUB' if $h{pt_type} == 0 && $h{size} > 0; fs::type::set_pt_type(\%h, $h{pt_type}); \%h; } (1..$nb_primary); -- 2.10.2
View Attachment As Raw
Actions:
View
Attachments on
bug 20074
:
8880
|
8881
| 8882 |
8883
|
8901
|
8906
|
8907
|
8908
|
8909
|
8926
|
8927
|
8972