From 33c1168212316026908f0813706ed0d623757e8c Mon Sep 17 00:00:00 2001
From: Andreas Kempe <kempe@lysator.liu.se>
Date: Thu, 14 Apr 2022 19:00:39 +0200
Subject: [PATCH] rpi3_boot_config: add GPS compatible RPI3 B+ boot
 configuration

---
 files/bootfiles/cmdline.txt   |  1 +
 files/bootfiles/config.txt    |  3 +++
 manifests/rpi3_boot_config.pp | 17 +++++++++++++++++
 3 files changed, 21 insertions(+)
 create mode 100644 files/bootfiles/cmdline.txt
 create mode 100755 files/bootfiles/config.txt
 create mode 100644 manifests/rpi3_boot_config.pp

diff --git a/files/bootfiles/cmdline.txt b/files/bootfiles/cmdline.txt
new file mode 100644
index 0000000..e45c1e9
--- /dev/null
+++ b/files/bootfiles/cmdline.txt
@@ -0,0 +1 @@
+root=/dev/mmcblk0p2 rw rootwait console=tty1 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 loglevel=4 elevator=noop
diff --git a/files/bootfiles/config.txt b/files/bootfiles/config.txt
new file mode 100755
index 0000000..d49a51c
--- /dev/null
+++ b/files/bootfiles/config.txt
@@ -0,0 +1,3 @@
+# NOTE: This file is handled by the timehost::rpi3_boot_config class.
+enable_uart=1
+dtoverlay=pps-gpio,gpiopin=27
diff --git a/manifests/rpi3_boot_config.pp b/manifests/rpi3_boot_config.pp
new file mode 100644
index 0000000..2e8fcff
--- /dev/null
+++ b/manifests/rpi3_boot_config.pp
@@ -0,0 +1,17 @@
+# Install boot configuration to be able to use the GPS module with the
+# Raspberry Pi 3 B+.
+class timehost::rpi3_boot_config {
+  file { '/boot/cmdline.txt':
+    ensure => present,
+    source => 'puppet:///modules/timehost/bootfiles/cmdline.txt',
+    owner  => 'root',
+    group  => 'root',
+  }
+
+  file { '/boot/config.txt':
+    ensure => present,
+    source => 'puppet:///modules/timehost/bootfiles/config.txt',
+    owner  => 'root',
+    group  => 'root',
+  }
+}
-- 
GitLab