]> 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>
Tue, 20 Jul 2021 09:54:48 +0000 (11:54 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/lscpu-arm.c

index 230eb5fddf69fed91a52c81332a55ab0ddc47598..75dd17d61406b42e60a24d7dcbc9d23d5806070a 100644 (file)
@@ -364,7 +364,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();
 }
 
@@ -372,8 +373,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;