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-05-27 10:55:22 +0100
commit95b705797d4f5eb3c3102633baa87e72d3affd34 (patch)
tree035ed097ae6eea2c6e22f0d3b6dfdfc656c98db1
parent3dfb4c7f7cb5d33cbc15f12041dc5d3ef4153294 (diff)
downloadurpmi-95b705797d4f5eb3c3102633baa87e72d3affd34.tar
urpmi-95b705797d4f5eb3c3102633baa87e72d3affd34.tar.gz
urpmi-95b705797d4f5eb3c3102633baa87e72d3affd34.tar.bz2
urpmi-95b705797d4f5eb3c3102633baa87e72d3affd34.tar.xz
urpmi-95b705797d4f5eb3c3102633baa87e72d3affd34.zip
On systems with 32-bit EFI, enable the Core 32bit media by default.
-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 3a6cd6ca..597398a9 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.115 - 1 May 2019
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;