neofetch icon indicating copy to clipboard operation
neofetch copied to clipboard

improve/add model name for arm linux cpus

Open theofficialgman opened this issue 2 years ago • 8 comments

Description

arm cpus currently fallback to the standard cpu detection

this allows to get the friendly name (Cortex A-57 for example)

theofficialgman avatar Oct 08 '21 18:10 theofficialgman

I've make this PR as well https://github.com/dylanaraps/neofetch/pull/1928, with both integrated you can see some before and after pictures: Before: InkedScreenshot_from_2021-10-08_12-31-31 After: InkedScreenshot_from_2021-10-08_14-24-32

theofficialgman avatar Oct 12 '21 04:10 theofficialgman

@dylanaraps any comment on this and my other PR? https://github.com/dylanaraps/neofetch/pull/1928

theofficialgman avatar Oct 23 '21 22:10 theofficialgman

@dylanaraps anything I can do to get these changes merged?

theofficialgman avatar Nov 12 '21 23:11 theofficialgman

Look at the surrounding code and how it makes use of /proc/cpuinfo. Does the ARM model information not exist in this file?

dylanaraps avatar Nov 13 '21 01:11 dylanaraps

it does not, and thats the problem (well it does, but usually its the arm standard name like you see in the photo ARMv8 Processor rev 1 (v8l)). I did it this way because it guarantees to get the info necessary

theofficialgman avatar Nov 13 '21 01:11 theofficialgman

Just wanted to say that this also works on Android. Before / master: image After / PR: image

Likely to be out of scope for this PR, but I've also seen an alternative way to get the CPU name on Android. OEMs can opt-in so one can view the CPU in the system settings, in which case it's possible to get it via getprop. However, there doesn't seem to be any standardization as to which field contains the actual CPU name and everyone seems to implement it under a different property name.

Miepee avatar Dec 27 '21 12:12 Miepee

@dylanaraps any comment on this and my other PR? #1928

@dylanaraps can this be merged? seems to be a nice change for arm cpus on linux/android. as well as my other PR fallback for integrated non-pcie gpus

theofficialgman avatar Jan 25 '22 04:01 theofficialgman

Look at the surrounding code and how it makes use of /proc/cpuinfo. Does the ARM model information not exist in this file?

For most Android systems, the vendor patches /proc/cpuinfo so that it contains the processor model as plain text:

image

On these Android systems, lscpu will not work, showing - as the model name.

image

However, for Linux installed on ARM devices, /proc/cpuinfo is untouched, and the Hardware section will only contain the binary code for the processor, therefore it needs to be decoded with lscpu based on a lookup table, something like:

image

So my solution (https://github.com/hykilpikonna/hyfetch/commit/42d6aa490afa171cc92224b0f0b963e56e2afd94) is to check whether the system is Android, use /proc/cpuinfo if it is, and use lscpu if it's not.

image

Check #2139 for an updated pull request.

hykilpikonna avatar Jul 31 '22 21:07 hykilpikonna