diff --git a/manifests/cmdline.pp b/manifests/cmdline.pp index df787c8..5d35cd0 100644 --- a/manifests/cmdline.pp +++ b/manifests/cmdline.pp @@ -11,6 +11,10 @@ Hash[String[1], Hash] $parameters = {}, Boolean $reboot = true, ) { + include pi::params + + $path = "${pi::params::path}/cmdline.txt" + augeas::lens { 'boot_cmdline': lens_content => file("${module_name}/boot_cmdline.aug"), } @@ -22,9 +26,9 @@ } if ($reboot) { - reboot { '/boot/cmdline.txt': + reboot { $path`: apply => finished, - message => 'Rebooting to apply /boot/config.txt changes', + message => "Rebooting to apply ${path} changes", when => refreshed, } } diff --git a/manifests/cmdline/parameter.pp b/manifests/cmdline/parameter.pp index 098a463..9d4eb97 100644 --- a/manifests/cmdline/parameter.pp +++ b/manifests/cmdline/parameter.pp @@ -19,9 +19,9 @@ } augeas { $name: - context => '/files/boot/cmdline.txt/1', + context => "/files${pi::cmdline::path}/1", lens => 'Boot_Cmdline.lns', - incl => '/boot/cmdline.txt', + incl => $pi::cmdline::path, changes => [ "set parameter[. = '${_real_parameter}'] '${_real_parameter}'", ], @@ -29,6 +29,6 @@ } if Class['pi::cmdline']['reboot'] { - Augeas[$name] ~> Reboot['/boot/cmdline.txt'] + Augeas[$name] ~> Reboot[$pi::cmdline::path] } } diff --git a/manifests/config.pp b/manifests/config.pp index 150d48b..74b0819 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -12,7 +12,11 @@ Hash[String[1], Hash] $fragments = {}, Boolean $reboot = true, ) { - concat { '/boot/config.txt': + include pi::params + + $path = "${pi::params::path}/config.txt" + + concat { $path: ensure => present, mode => '0755', # this is the default, +x seems odd } @@ -24,9 +28,9 @@ } if ($reboot) { - reboot { '/boot/config.txt': + reboot { $path: apply => finished, - message => 'Rebooting to apply /boot/config.txt changes', + message => "Rebooting to apply ${path} changes", when => refreshed, } } diff --git a/manifests/config/fragment.pp b/manifests/config/fragment.pp index f85ca82..42756ce 100644 --- a/manifests/config/fragment.pp +++ b/manifests/config/fragment.pp @@ -19,12 +19,12 @@ } concat::fragment { $name: - target => '/boot/config.txt', + target => $pi::config::path, content => $_real_content, order => $order, } if Class['pi::config']['reboot'] { - Concat::Fragment[$name] ~> Reboot['/boot/config.txt'] + Concat::Fragment[$name] ~> Reboot[$pi::config::path] } } diff --git a/manifests/params.pp b/manifests/params.pp new file mode 100644 index 0000000..21f4b79 --- /dev/null +++ b/manifests/params.pp @@ -0,0 +1,9 @@ +class pi::params { + # https://www.raspberrypi.com/documentation/computers/config_txt.html + # Prior to Raspberry Pi OS Bookworm, Raspberry Pi OS stored the boot partition at /boot/. + if $::facts['os']['name'] == 'Raspbian' and versioncmp($::facts['os']['release']['major'], '12') >= 0 { + $path = '/boot/firmware' + } else { + $path = '/boot' + } +}