diff options
Diffstat (limited to 'urpm')
-rw-r--r-- | urpm/media.pm | 14 | ||||
-rw-r--r-- | urpm/util.pm | 11 |
2 files changed, 23 insertions, 2 deletions
diff --git a/urpm/media.pm b/urpm/media.pm index 62a5d5d3..cadfc173 100644 --- a/urpm/media.pm +++ b/urpm/media.pm @@ -4,7 +4,7 @@ package urpm::media; use strict; use urpm qw(file_from_local_medium is_local_medium); use urpm::msg; -use urpm::util qw(any append_to_file basename cat_ difference2 dirname intersection member output_safe begins_with copy_and_own file_size offset_pathname reduce_pathname); +use urpm::util qw(any append_to_file basename cat_ difference2 dirname intersection member output_safe begins_with copy_and_own file_size offset_pathname reduce_pathname uefi_type); use urpm::removable; use urpm::lock; use urpm::md5sum; @@ -784,13 +784,13 @@ sub is_media_to_add_by_default { my $add_by_default = !$distribconf->getvalue($medium, 'noauto'); my @media_types = split(':', $distribconf->getvalue($medium, 'media_type')); return $add_by_default if !@media_types; + my $non_regular_medium = intersection(\@media_types, [ qw(backports debug source testing) ]); if ($product_id->{product} eq 'Free') { if (member('non-free', @media_types)) { $urpm->{log}(N("ignoring non-free medium `%s'", $medium)); $add_by_default = 0; } } else { - my $non_regular_medium = intersection(\@media_types, [ qw(backports debug source testing) ]); if (!$add_by_default && !$non_regular_medium) { my $medium_name = $distribconf->getvalue($medium, 'name') || ''; # Don't enable 32-bit media by default on 64-bit systems (mga#24376). '32bit' only appears @@ -805,6 +805,16 @@ sub is_media_to_add_by_default { } } } + if ($distribconf->getvalue('media_info', 'arch') eq 'x86_64' && uefi_type() eq 'ia32') { + if (!$add_by_default && !$non_regular_medium) { + my $medium_name = $distribconf->getvalue($medium, 'name') || ''; + # Enable 32-bit media by default to allow 32-bit grub2-efi to be installed/updated. + if ($medium_name =~ /Core/ && $medium_name =~ /32bit/) { + $add_by_default = 1; + $urpm->{log}(N("un-ignoring 32bit medium `%s' b/c system is 32-bit EFI", $medium_name)); + } + } + } $add_by_default; } diff --git a/urpm/util.pm b/urpm/util.pm index c786227b..4dbad1cc 100644 --- a/urpm/util.pm +++ b/urpm/util.pm @@ -30,6 +30,7 @@ our @EXPORT = qw(add2hash_ reduce_pathname remove_internal_name same_size_and_mtime + uefi_type uniq uniq_ unquotespace @@ -215,6 +216,16 @@ sub append_to_file { 1; } +#- return the UEFI machine type short name +sub uefi_type() { + if (-e '/sys/firmware/efi/fw_platform_size') { + # No support for ARM yet + cat_('/sys/firmware/efi/fw_platform_size') =~ /32/ ? 'ia32' : 'x64'; + } else { + 'none'; + } +} + 1; |