neofetch
neofetch copied to clipboard
Fix support for ARM, RISC-V, LoongArch detection
Description
Use lscpu to get name of ARM CPU, tested on HiSilicon and Phytium machines.
cpuinfo shows ARM CPU implementer and model as binary information stored at cpuid register, e.g. 0x48
means HiSilicon, lscpu uses a lookup table to decode that, utilising lscpu could avoid maintaining the lookup table ourselves.
Update 20220731
- added detection for Android, which shows CPU as string in cpuinfo.
- added Loongarch (tested on Loongson 3A5000), RISC-V (to show the uarch, tested on StarFive).
Update 20220909
- Moved LoongArch and RISC-V to fallback detection, making it more universal.
P.S.:
small bugfix: fixed the bug of that the scripts deleting postfixes not matching those CPUs saying with Radeon Graphics
On a big.LITTLE machine (RK3399)
The CPU frequency is also wrong (it shows only the little core freq, not the big core one)
圈子好小 qwq
This is working on a Raspberry Pi.
Found a bug: This method fails to detect cpu for riscv on QEMU.
It can be solved by moving the fallback cpu detection outside the switch-case block. (i.e. if no cpu is detected with platform-specific methods, try using the /proc/cpuinfo
method)
What is the status of this PR? I would like to make a PR to improve neofetch on RISC-V, but I don't want to conflict with this work.