summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2017-01-21 20:23:18 +0000
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2017-02-12 11:54:53 +0000
commit631a08ffe0557b1df214a9d08c7c01745eb18107 (patch)
treeb79fc49650c6f94aac3f85a473cd6fbe117df82c
parent9f3a801d1c0904340249138ed4926e0ca6cee95a (diff)
downloaddrakx-631a08ffe0557b1df214a9d08c7c01745eb18107.tar
drakx-631a08ffe0557b1df214a9d08c7c01745eb18107.tar.gz
drakx-631a08ffe0557b1df214a9d08c7c01745eb18107.tar.bz2
drakx-631a08ffe0557b1df214a9d08c7c01745eb18107.tar.xz
drakx-631a08ffe0557b1df214a9d08c7c01745eb18107.zip
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.
-rw-r--r--perl-install/fs/type.pm2
-rw-r--r--perl-install/partition_table/dos.pm1
2 files changed, 2 insertions, 1 deletions
diff --git a/perl-install/fs/type.pm b/perl-install/fs/type.pm
index ad84738f7..a6a53c83e 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 69566aaa8..4e8dbf1f2 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);