Skip to content

Commit bf3e1e4

Browse files
authored
Merge pull request #3130 from lilyinstarlight/feature/rpi-issue-detection
Spider - check for the existence of /etc/rpi-issue to identify Raspberry Pi OS
2 parents 2bcf280 + 5dc040f commit bf3e1e4

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

app/server/ruby/bin/compile-extensions.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020
require 'rbconfig'
2121
ruby_api = RbConfig::CONFIG['ruby_version']
2222
os = case RUBY_PLATFORM
23-
when /.*arm.*-linux.*/
24-
:raspberry
2523
when /.*linux.*/
26-
:linux
24+
if File.exist?('/etc/rpi-issue')
25+
:raspberry
26+
else
27+
:linux
28+
end
2729
when /.*darwin.*/
2830
:osx
2931
when /.*mingw.*/

app/server/ruby/bin/daemon.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -627,12 +627,12 @@ def self.log_error(e)
627627

628628
def self.os
629629
case RUBY_PLATFORM
630-
when /.*arm.*-linux.*/
631-
:raspberry
632-
when /aarch64.*linux.*/
633-
:raspberry
634630
when /.*linux.*/
635-
:linux
631+
if File.exist?('/etc/rpi-issue')
632+
:raspberry
633+
else
634+
:linux
635+
end
636636
when /.*darwin.*/
637637
:macos
638638
when /.*mingw.*/

app/server/ruby/lib/sonicpi/util.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ module SonicPi
1919
module Util
2020
# Check which OS we're on
2121
case RUBY_PLATFORM
22-
when /.*arm.*-linux.*/
23-
@@os = :raspberry
24-
when /aarch64.*linux.*/
25-
@@os = :raspberry
2622
when /.*linux.*/
27-
@@os = :linux
23+
if File.exist?('/etc/rpi-issue')
24+
@@os = :raspberry
25+
else
26+
@@os = :linux
27+
end
2828
when /.*darwin.*/
2929
@@os = :osx
3030
when /.*mingw.*/

0 commit comments

Comments
 (0)