diff options
author | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2019-08-10 20:40:46 +0100 |
---|---|---|
committer | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2020-02-29 15:01:28 +0000 |
commit | e8f3026f210a8de175242658304c8fe83729cf5a (patch) | |
tree | b312fb605dc23288d19f0da0234a38bd656286e8 | |
parent | f9a43be6ee23983c7be107a5d6a0abf5fe239aba (diff) | |
download | drakx-e8f3026f210a8de175242658304c8fe83729cf5a.tar drakx-e8f3026f210a8de175242658304c8fe83729cf5a.tar.gz drakx-e8f3026f210a8de175242658304c8fe83729cf5a.tar.bz2 drakx-e8f3026f210a8de175242658304c8fe83729cf5a.tar.xz drakx-e8f3026f210a8de175242658304c8fe83729cf5a.zip |
diskdrake: support adding partitions to Live ISOs on USB sticks (mga#25224)
-rw-r--r-- | perl-install/NEWS | 1 | ||||
-rw-r--r-- | perl-install/fs/type.pm | 2 | ||||
-rw-r--r-- | perl-install/partition_table.pm | 6 | ||||
-rw-r--r-- | perl-install/partition_table/raw.pm | 3 |
4 files changed, 8 insertions, 4 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS index df083c195..1304240f2 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -2,6 +2,7 @@ - recognize new kernel 5.2 - 5.4 drivers - diskdrake: o make reformating nilfs2 fses to work + o support adding partitions to Live ISOs on USB sticks (mga#25224) - drakfont: o don't crash when fonts.cache-1 to delete doesn't exist anymore (mga#21086) - drakboot: initial support for setting up uefi on aarch64 diff --git a/perl-install/fs/type.pm b/perl-install/fs/type.pm index b9f4b48d6..697b8c9d9 100644 --- a/perl-install/fs/type.pm +++ b/perl-install/fs/type.pm @@ -280,7 +280,7 @@ sub type_subpart_from_magic { } if ($p) { - $p->{fs_type} = '' if $part->{pt_type} eq 'BIOS_GRUB'; + $p->{fs_type} = '' if $part->{pt_type} eq 'BIOS_GRUB' && $p->{fs_type} ne 'iso9660'; $part->{fs_type_from_magic} = $p->{fs_type}; $p->{device_LABEL} = $ids->{ID_FS_LABEL} if $ids->{ID_FS_LABEL}; $p->{device_UUID} = $ids->{ID_FS_UUID} if $ids->{ID_FS_UUID}; diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm index 230cdc6a3..6ab40174b 100644 --- a/perl-install/partition_table.pm +++ b/perl-install/partition_table.pm @@ -106,8 +106,10 @@ sub verifyParts { verifyParts_(get_normal_parts($hd)); } sub verifyPrimary { - my ($pt) = @_; - $_->{start} > 0 || die "partition must NOT start at sector 0" foreach @{$pt->{normal}}; + my ($pt, $o_is_hybrid_iso) = @_; + if (!$o_is_hybrid_iso) { + $_->{start} > 0 || die "partition must NOT start at sector 0" foreach @{$pt->{normal}}; + } verifyParts_(@{$pt->{normal}}, $pt->{extended}); } diff --git a/perl-install/partition_table/raw.pm b/perl-install/partition_table/raw.pm index 8ea1ddb1d..4fca26de4 100644 --- a/perl-install/partition_table/raw.pm +++ b/perl-install/partition_table/raw.pm @@ -246,7 +246,8 @@ sub read_primary { my $primary = partition_table::raw::pt_info_to_primary($hd, $pt, $info); $hd->{primary} = $primary; undef $hd->{extended}; - partition_table::verifyPrimary($primary); + my $is_hybrid_iso = $hd->{current_pt_table_type} eq 'dos' && $hd->{fs_type_from_magic} eq 'iso9660'; + partition_table::verifyPrimary($primary, $is_hybrid_iso); 1; } |