Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:GA
util-linux.3352
util-linux-lscpu-power-2.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File util-linux-lscpu-power-2.patch of Package util-linux.3352
From 641350fe822e7f1ac10873dad9a364bdeaba8083 Mon Sep 17 00:00:00 2001 From: Karel Zak <kzak@redhat.com> Date: Tue, 15 Mar 2016 14:23:59 +0100 Subject: [PATCH 2/4] lscpu: keep lscpu usable on snapshots This patch reverts 3ac03fe4d20558b55635a048d7f2fb0f5e85ee2a for snapshots (--sysroot). Yeah, poor-man solution. It would be really nice to have runtime detection to support model overwriting also on snapshots. Signed-off-by: Karel Zak <kzak@redhat.com> --- sys-utils/lscpu.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c index 423bc56..8e62c64 100644 --- a/sys-utils/lscpu.c +++ b/sys-utils/lscpu.c @@ -453,25 +453,36 @@ read_basicinfo(struct lscpu_desc *desc, struct lscpu_modifier *mod) char buf[BUFSIZ]; struct utsname utsbuf; size_t setsize; + int overwrite_model = 0; /* architecture */ if (uname(&utsbuf) == -1) err(EXIT_FAILURE, _("error: uname failed")); desc->arch = xstrdup(utsbuf.machine); + /* Use another records from cpuinfo for PPC, on snapshot follow + * standard behavior. + * + * TODO: use runtime detection to make model overwrite possible on + * snapshots too. + */ +#if defined(__powerpc__) || defined(__powerpc64__) + if (mod->system == SYSTEM_LIVE) + overwrite_model = 1; +#endif /* details */ while (fgets(buf, sizeof(buf), fp) != NULL) { if (lookup(buf, "vendor", &desc->vendor)) ; else if (lookup(buf, "vendor_id", &desc->vendor)) ; else if (lookup(buf, "family", &desc->family)) ; else if (lookup(buf, "cpu family", &desc->family)) ; -#if defined(__powerpc__) || defined(__powerpc64__) - else if (lookup(buf, "revision", &desc->model)) ; - else if (lookup(buf, "cpu", &desc->modelname)) ; -#else - else if (lookup(buf, "model", &desc->model)) ; - else if (lookup(buf, "model name", &desc->modelname)) ; -#endif + + else if (overwrite_model && lookup(buf, "revision", &desc->model)) ; + else if (overwrite_model && lookup(buf, "cpu", &desc->modelname)) ; + + else if (!overwrite_model && lookup(buf, "model", &desc->model)) ; + else if (!overwrite_model && lookup(buf, "model name", &desc->modelname)) ; + else if (lookup(buf, "stepping", &desc->stepping)) ; else if (lookup(buf, "cpu MHz", &desc->mhz)) ; else if (lookup(buf, "flags", &desc->flags)) ; /* x86 */ -- 2.8.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor