summaryrefslogtreecommitdiffstats
path: root/perl-install/common.pm
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2018-12-16 22:25:44 +0000
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2018-12-17 18:16:24 +0000
commit51f5733e7910fdf7c99ef9da67fbb5d0d7ef51c1 (patch)
tree2809dfb5c0cca31edcb6ec8f8544608976450e11 /perl-install/common.pm
parent7d4508dd1f905146f433232fb27c33afcf509a47 (diff)
downloaddrakx-51f5733e7910fdf7c99ef9da67fbb5d0d7ef51c1.tar
drakx-51f5733e7910fdf7c99ef9da67fbb5d0d7ef51c1.tar.gz
drakx-51f5733e7910fdf7c99ef9da67fbb5d0d7ef51c1.tar.bz2
drakx-51f5733e7910fdf7c99ef9da67fbb5d0d7ef51c1.tar.xz
drakx-51f5733e7910fdf7c99ef9da67fbb5d0d7ef51c1.zip
Add extra UEFI helper functions.
Needed for next commit.
Diffstat (limited to 'perl-install/common.pm')
-rw-r--r--perl-install/common.pm28
1 files changed, 27 insertions, 1 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm
index 9ac290b2d..474d34c21 100644
--- a/perl-install/common.pm
+++ b/perl-install/common.pm
@@ -10,7 +10,7 @@ use run_program;
use Exporter;
our @ISA = qw(Exporter);
-our @EXPORT = qw($SECTORSIZE N P N_ check_for_xserver files_exist formatTime MB formatXiB get_libdir get_parent_uid is_running is_uefi makedev mageia_release mageia_release_info removeXiBSuffix require_root_capability setVirtual set_alternative set_l10n_sort set_permissions to_utf8 translate unmakedev);
+our @EXPORT = qw($SECTORSIZE N P N_ check_for_xserver files_exist formatTime MB formatXiB get_libdir get_parent_uid is_running is_uefi kernel_uefi_type makedev mageia_release mageia_release_info removeXiBSuffix require_root_capability setVirtual set_alternative set_l10n_sort set_permissions to_utf8 translate uefi_type unmakedev);
# perl_checker: RE-EXPORT-ALL
push @EXPORT, @MDK::Common::EXPORT;
@@ -726,6 +726,32 @@ Checks if we are on an uefi system
sub is_uefi() { -e "/sys/firmware/efi" }
+=item kernel_uefi_type()
+
+Returns the short name of the UEFI machine type supported by the kernel stub loader
+
+=cut
+
+sub kernel_uefi_type() {
+ # No support for ARM yet
+ arch() =~ /i.86/ ? 'ia32' : 'x64';
+}
+
+=item uefi_type()
+
+Returns the UEFI machine type short name
+
+=cut
+
+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';
+ }
+}
+
=item cmp_kernel_versions($va, $vb)
Compare two kernel versions