diff options
-rw-r--r-- | perl-install/common.pm | 28 |
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 |