summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/util-linux/util-linux/tests-lscpu.patch
blob: 36a19bd5a55997903223e61ca543eb8b256773a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Upstream-Status: Backport
Signed-off-by: Ross Burton <ross.burton@arm.com>

From c2ca2837a27a3f1344904037ea691bfdbb288f02 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Fri, 2 Jul 2021 13:12:13 +0200
Subject: [PATCH] lscpu: don't use DMI if executed with --sysroot

Signed-off-by: Karel Zak <kzak@redhat.com>
---
 sys-utils/lscpu-arm.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/sys-utils/lscpu-arm.c b/sys-utils/lscpu-arm.c
index d52765f9d..c7128094c 100644
--- a/sys-utils/lscpu-arm.c
+++ b/sys-utils/lscpu-arm.c
@@ -322,7 +322,8 @@ static void arm_decode(struct lscpu_cxt *cxt, struct lscpu_cputype *ct)
 
 	arm_ids_decode(ct);
 	arm_rXpY_decode(ct);
-	if (cxt->is_cluster)
+
+	if (!cxt->noalive && cxt->is_cluster)
 		ct->nr_socket_on_cluster = get_number_of_physical_sockets_from_dmi();
 }
 
@@ -330,8 +331,9 @@ static int is_cluster_arm(struct lscpu_cxt *cxt)
 {
 	struct stat st;
 
-	if (!(strcmp(cxt->arch->name, "aarch64")) &&
-	     (stat(_PATH_ACPI_PPTT, &st) < 0) && (cxt->ncputypes == 1))
+	if (!cxt->noalive
+	    && strcmp(cxt->arch->name, "aarch64") == 0
+	    && stat(_PATH_ACPI_PPTT, &st) < 0 && cxt->ncputypes == 1)
 		return 1;
 	else
 		return 0;
-- 
2.25.1