Skip to content

Commit

Permalink
Merge pull request #350 from tigertall/tigertall-patch-1
Browse files Browse the repository at this point in the history
add support for raspberry pi 4b
  • Loading branch information
PVince81 authored Jan 18, 2022
2 parents 6dd0c47 + 9226772 commit 261be29
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/OperatingSystems/DefaultOs.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,19 @@ public function getCpuName(): string {

$result = preg_match_all($pattern, $cpuinfo, $matches);
if ($result === 0 || $result === false) {
return $data;
// For Raspberry Pi 4B
$pattern = '/Model\s+:\s(.+)/';
$result = preg_match_all($pattern, $cpuinfo, $matches);
if ($result === 0 || $result === false) {
return $data;
}
}

$model = $matches[1][0];

$pattern = '/processor\s+:\s(.+)/';

$result = preg_match_all($pattern, $cpuinfo, $matches);
$cores = count($matches[1]);

if ($cores === 1) {
Expand Down

0 comments on commit 261be29

Please sign in to comment.