Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path fixes for Raspbian Bookworm #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions manifests/cmdline.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
}
Expand All @@ -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,
}
}
Expand Down
6 changes: 3 additions & 3 deletions manifests/cmdline/parameter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
}

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}'",
],
require => Augeas::Lens['boot_cmdline'],
}

if Class['pi::cmdline']['reboot'] {
Augeas[$name] ~> Reboot['/boot/cmdline.txt']
Augeas[$name] ~> Reboot[$pi::cmdline::path]
}
}
10 changes: 7 additions & 3 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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,
}
}
Expand Down
4 changes: 2 additions & 2 deletions manifests/config/fragment.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
}
9 changes: 9 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
@@ -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'
}
}
Loading