system() raspberry PI detection improved

This commit is contained in:
Sebastian Hildebrandt
2025-01-08 22:11:27 +01:00
parent 0845e034f0
commit 348c6cf77e
5 changed files with 10 additions and 3 deletions
+1 -1
View File
@@ -189,7 +189,7 @@ function system(callback) {
const model = util.getValue(lines, 'model:', ':', true);
// reference values: https://elinux.org/RPi_HardwareHistory
// https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
if ((result.model === 'BCM2835' || result.model === 'BCM2708' || result.model === 'BCM2709' || result.model === 'BCM2710' || result.model === 'BCM2711' || result.model === 'BCM2836' || result.model === 'BCM2837') && model.toLowerCase().indexOf('raspberry') >= 0) {
if ((result.model === 'BCM2835' || result.model === 'BCM2708' || result.model === 'BCM2709' || result.model === 'BCM2710' || result.model === 'BCM2711' || result.model === 'BCM2836' || result.model === 'BCM2837' || result.model === '') && model.toLowerCase().indexOf('raspberry') >= 0) {
const rPIRevision = util.decodePiCpuinfo(lines);
result.model = rPIRevision.model;
result.version = rPIRevision.revisionCode;
+2 -1
View File
@@ -661,7 +661,8 @@ function isRaspberry() {
}
const hardware = getValue(cpuinfo, 'hardware');
return (hardware && PI_MODEL_NO.indexOf(hardware) > -1);
const model = getValue(cpuinfo, 'model');
return ((hardware && PI_MODEL_NO.indexOf(hardware) > -1) || (model && model.indexOf('Raspberry Pi') > -1));
}
function isRaspbian() {