OutsideIT / FireMotD

:fire: Fire Framework Linux MoTD Generator :fire:
https://outsideit.net/firemotd
GNU General Public License v3.0
175 stars 45 forks source link

Fix Pine A64 detection #96

Closed ThomDietrich closed 6 years ago

ThomDietrich commented 6 years ago

Fixes https://github.com/OutsideIT/FireMotD/pull/35 @EliasGabrielsson could you please confirm this is working correctly? With the logic as implemented in the previous PR, it shouldn't have worked. Maybe my numbers are wrong? Additionally just as discussed in https://github.com/openhab/openhabian/issues/333 we should improve board detection.

willemdh commented 6 years ago

@ThomDietrich Could u please recommit on latest master?

EliasGabrielsson commented 6 years ago

I think this pull request shall be rewritten according to leonsio advice in thread above before getting merged. Cited below:

the best way to detect SoC is to use the information from device-tree/model or ( if not present ) to detect Soc based on some hardware specification.

for example CPU architecture or hardware string in /proc/cpuinfo

the biggest problem is to identify the correct board, if many boards uses the same chipset. for example Allwinner A64 is used on this boards

Azpen hybrx FriendlyARM NanoPi A64 Olimex A64-OLinuXino Pine64 Sinovoip Banana Pi M64 Xunlong Orange Pi Win in this case you need some more unique specifications to detect the right hardware like RAM/ethernet/soundchips or other

The kernel string can be set to anything

ThomDietrich commented 6 years ago

@EliasGabrielsson while you are completely right, this PR is just here to fix the memory differentiation part. Can you verify that the memory of your Pine falls into one (the correct) of the three ranges?

leonsio commented 6 years ago

another tip, don't use dmesg to detect any system information. the buffer size of dmesg is mostly limited to 32k. this means that older entries=boot logs will be deleted/overwritten

here a example from my system running 18 days

[12:56:15][root@rock64:~]
# date
Mi 21. Feb 12:56:20 UTC 2018
[12:56:20][root@rock64:~]
# uptime
 12:56:22 up 18 days, 17:25,  1 user,  load average: 0,04, 0,01, 0,00
[12:56:22][root@rock64:~]
# dmesg -H | head -n1
[Feb12 15:51] "java" (1965) uses deprecated CP15 Barrier instruction at 0xf58b0a30

I can only find information from last 9 days in dmesg, older entries are deleted

ThomDietrich commented 6 years ago

@leonsio I'm not able to contribute anything these months. Would you like to add a PR to replace this one and to improve the detection of all three Pine A64 boards? I'd do it myself but as I currently do not have a system running I would be unable to test.