]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lscpu: don't use DMI if executed with --sysroot
authorKarel Zak <kzak@redhat.com>
Fri, 2 Jul 2021 11:12:13 +0000 (13:12 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 2 Jul 2021 11:13:01 +0000 (13:13 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/lscpu-arm.c

index d52765f9d00a844f66718ebcb6d58659c2dd5931..c7128094cfd82ccad63e53324f413ef0605e11f3 100644 (file)
@@ -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;