summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2019-05-25 11:42:54 +0100
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2019-10-19 16:46:41 +0100
commitfff037e098cda8a7590435146baceaf674b7dcf2 (patch)
tree3711e1f838ad15017d1c51e0b6b16ea6e08b0da6
parent935beef3db2c7603c2c1e55b431e99b74c3dd146 (diff)
downloadurpmi-fff037e098cda8a7590435146baceaf674b7dcf2.tar
urpmi-fff037e098cda8a7590435146baceaf674b7dcf2.tar.gz
urpmi-fff037e098cda8a7590435146baceaf674b7dcf2.tar.bz2
urpmi-fff037e098cda8a7590435146baceaf674b7dcf2.tar.xz
urpmi-fff037e098cda8a7590435146baceaf674b7dcf2.zip
On systems with 32-bit EFI, enable the Core 32bit media by default.
(cherry picked from commit 95b705797d4f5eb3c3102633baa87e72d3affd34)
-rw-r--r--NEWS2
-rw-r--r--urpm/media.pm14
-rw-r--r--urpm/util.pm11
3 files changed, 25 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 272b3c16..0d0f2749 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,6 @@
- don't enable 32-bit media by default on 64-bit systems (mga#24376)
+ o except on systems with 32-bit EFI, where we need the Core 32bit
+ media for the bootloader
Version 8.110 - 13 July 2017
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 931a0bc0..e19df263 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;