summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-10-12 22:44:49 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2022-10-12 22:44:49 +0200
commit45836282f52e18bb3f00465812c207428a96136a (patch)
treebfff46a68a697461a52d89571cb5929c01e253e1
parentInitial commit. (diff)
downloadraspberry-master.tar.gz
raspberry-master.tar.xz
Add existing.HEADmaster
-rw-r--r--lib/facter/raspberry_serial.rb4
-rw-r--r--manifests/init.pp16
2 files changed, 20 insertions, 0 deletions
diff --git a/lib/facter/raspberry_serial.rb b/lib/facter/raspberry_serial.rb
new file mode 100644
index 0000000..bcf34da
--- /dev/null
+++ b/lib/facter/raspberry_serial.rb
@@ -0,0 +1,4 @@
+Facter.add('serial') do
+ confine { File.exists? '/usr/local/bin/serial' }
+ setcode "/usr/local/bin/serial"
+end
diff --git a/manifests/init.pp b/manifests/init.pp
new file mode 100644
index 0000000..72bd1c5
--- /dev/null
+++ b/manifests/init.pp
@@ -0,0 +1,16 @@
+class raspberry {
+ file { '/usr/local/bin/serial':
+ ensure => file,
+ mode => '0555',
+ content => @(EOF)
+ #!/bin/sh
+ perl -n -e'/^Serial\s*: 0{8}(.*)/ && print "$1\n"' /proc/cpuinfo
+ | EOF
+ }
+
+ file_line { 'Hack in to force systemd service prodiver on raspbian':
+ path => '/var/lib/gems/2.7.0/gems/puppet-7.14.0/lib/puppet/provider/service/systemd.rb',
+ after => '^\s*defaultfor :operatingsystem => :debian',
+ line => ' defaultfor :operatingsystem => :raspbian',
+ }
+}