From d5ae2087adc0b075f230256214372d5c20c4b88d Mon Sep 17 00:00:00 2001 From: wangzhe Date: Fri, 12 May 2023 19:13:14 +0800 Subject: [PATCH] Fix the memory unit error --- 0043-Fix-the-memory-unit-error.patch | 42 ++++++++++++++++++++++++++++ leapp-repository.spec | 7 +++-- 2 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 0043-Fix-the-memory-unit-error.patch diff --git a/0043-Fix-the-memory-unit-error.patch b/0043-Fix-the-memory-unit-error.patch new file mode 100644 index 0000000..73c618d --- /dev/null +++ b/0043-Fix-the-memory-unit-error.patch @@ -0,0 +1,42 @@ +From eea594340a1bb07aaa606703e637630f5f7d0c15 Mon Sep 17 00:00:00 2001 +From: wangzhe +Date: Fri, 12 May 2023 18:00:15 +0800 +Subject: [PATCH] Fix the memory unit error + +--- + .../el7toel8/actors/checkmemory/libraries/checkmemory.py | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/repos/system_upgrade/el7toel8/actors/checkmemory/libraries/checkmemory.py b/repos/system_upgrade/el7toel8/actors/checkmemory/libraries/checkmemory.py +index e1ac567..bf6fbee 100644 +--- a/repos/system_upgrade/el7toel8/actors/checkmemory/libraries/checkmemory.py ++++ b/repos/system_upgrade/el7toel8/actors/checkmemory/libraries/checkmemory.py +@@ -5,10 +5,10 @@ from leapp.libraries.stdlib import api + from leapp.models import MemoryInfo + + min_req_memory = { +- architecture.ARCH_X86_64: 1536, # 1.5G +- architecture.ARCH_ARM64: 2048, # 2Gb +- architecture.ARCH_PPC64LE: 2048, # 2Gb +- architecture.ARCH_S390X: 1024 # 1Gb ++ architecture.ARCH_X86_64: 1572864, # 1.5G ++ architecture.ARCH_ARM64: 2097152, # 2Gb ++ architecture.ARCH_PPC64LE: 2097152, # 2Gb ++ architecture.ARCH_S390X: 1048576 # 1Gb + } + + +@@ -33,8 +33,8 @@ def process(): + + if minimum_req_error: + title = 'Minimum memory requirements for Anolis 8 are not met' +- summary = 'Memory detected: {} KiB, required: {} KiB'.format(minimum_req_error['detected'], +- minimum_req_error['minimal_req']) ++ summary = 'Memory detected: {} MiB, required: {} MiB'.format(int(minimum_req_error['detected'] / 1024), ++ int(minimum_req_error['minimal_req'] / 1024)) + reporting.create_report([ + reporting.Title(title), + reporting.Summary(summary), +-- +1.8.3.1 + diff --git a/leapp-repository.spec b/leapp-repository.spec index 41e9ffe..20eead2 100644 --- a/leapp-repository.spec +++ b/leapp-repository.spec @@ -11,7 +11,7 @@ }\ py2_byte_compile "%1" "%2"} -%define anolis_release 21 +%define anolis_release 22 Name: leapp-repository Version: 0.13.0 @@ -68,7 +68,7 @@ Patch39: 0039-Add-grub2-tools-update-into-answerfile.patch Patch40: 0040-Fix-colloecting-virtio-nic-info-error.patch Patch41: 0041-Add-python-devel-version-check-and-update.patch Patch42: 0042-Report-inhibitor-message-to-SMC.patch - +Patch43: 0043-Fix-the-memory-unit-error.patch BuildArch: noarch BuildRequires: python-devel @@ -196,6 +196,9 @@ done; # no files here %changelog +* Fri May 12 2023 wangzhe - 0.13.0-2.22 +- Fix the memory unit error + * Tue Apr 25 2023 wangzhe - 0.13.0-2.21 - Report inhibitor message to SMC. -- Gitee