Mageia Bugzilla – Attachment 8883 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 preven Empty or BIOS_GRUB partitions being counted as free space
0004-Don-t-treat-Empty-or-BIOS_GRUB-partitions-as-free-sp.patch (text/plain), 1.09 KB, created by
Martin Whitaker
on 2017-01-22 01:58:19 CET
(
hide
)
Description:
Patch to preven Empty or BIOS_GRUB partitions being counted as free space
Filename:
MIME Type:
Creator:
Martin Whitaker
Created:
2017-01-22 01:58:19 CET
Size:
1.09 KB
patch
obsolete
>From 766dd92e1ef0ba53f03d5d2cd321716d28bc1ec0 Mon Sep 17 00:00:00 2001 >From: Martin Whitaker <mageia@martin-whitaker.me.uk> >Date: Sat, 21 Jan 2017 20:33:43 +0000 >Subject: [PATCH 4/4] Don't treat Empty or BIOS_GRUB partitions as free space > (mga#20074). > >The subroutine isEmpty() is used to identify free space on the disk >(not DOS "Empty" partitions). Because we use a string to flag Empty >and BIOS_GRUB partitions, rather than a numeric value, the numeric >equality operator gives false positives. > >diff --git a/perl-install/fs/type.pm b/perl-install/fs/type.pm >index a6a53c8..abfdb04 100644 >--- a/perl-install/fs/type.pm >+++ b/perl-install/fs/type.pm >@@ -292,7 +292,7 @@ sub defaultFS() { 'ext4' } > > sub true_local_fs_types() { qw(btrfs ext3 ext2 ext4 reiserfs xfs jfs) } > >-sub isEmpty { !$_[0]{fs_type} && $_[0]{pt_type} == 0 } >+sub isEmpty { !$_[0]{fs_type} && !$_[0]{pt_type} } > sub isBIOS_GRUB { $_[0]{pt_type} eq 'BIOS_GRUB' } > sub isESP { $_[0]{pt_type} == 0xef && member($_[0]{fs_type}, qw(fat32 vfat)) } > sub isExtended { $_[0]{pt_type} == 5 || $_[0]{pt_type} == 0xf || $_[0]{pt_type} == 0x85 } >-- >2.10.2 >
From 766dd92e1ef0ba53f03d5d2cd321716d28bc1ec0 Mon Sep 17 00:00:00 2001 From: Martin Whitaker <mageia@martin-whitaker.me.uk> Date: Sat, 21 Jan 2017 20:33:43 +0000 Subject: [PATCH 4/4] Don't treat Empty or BIOS_GRUB partitions as free space (mga#20074). The subroutine isEmpty() is used to identify free space on the disk (not DOS "Empty" partitions). Because we use a string to flag Empty and BIOS_GRUB partitions, rather than a numeric value, the numeric equality operator gives false positives. diff --git a/perl-install/fs/type.pm b/perl-install/fs/type.pm index a6a53c8..abfdb04 100644 --- a/perl-install/fs/type.pm +++ b/perl-install/fs/type.pm @@ -292,7 +292,7 @@ sub defaultFS() { 'ext4' } sub true_local_fs_types() { qw(btrfs ext3 ext2 ext4 reiserfs xfs jfs) } -sub isEmpty { !$_[0]{fs_type} && $_[0]{pt_type} == 0 } +sub isEmpty { !$_[0]{fs_type} && !$_[0]{pt_type} } sub isBIOS_GRUB { $_[0]{pt_type} eq 'BIOS_GRUB' } sub isESP { $_[0]{pt_type} == 0xef && member($_[0]{fs_type}, qw(fat32 vfat)) } sub isExtended { $_[0]{pt_type} == 5 || $_[0]{pt_type} == 0xf || $_[0]{pt_type} == 0x85 } -- 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