-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
86 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
class { 'pi::cmdline': | ||
reboot => false, # reboots are problematic for acceptance testing | ||
} | ||
|
||
pi::cmdline::parameter { '8250.nr_uarts=0': } | ||
pi::cmdline::parameter { 'coherent_pool=1M': } | ||
pi::cmdline::parameter { 'snd_bcm2835.enable_headphones=0': } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class { 'pi::cmdline': | ||
reboot => false, # reboots are problematic for acceptance testing | ||
parameters => { | ||
'coherent_pool=1M' => {}, | ||
'bcm2708_fb.fbwidth=0' => {}, | ||
'bcm2708_fb.fbswap=1' => {}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,31 @@ | ||
# | ||
# @summary Manages /boot/cmdline.txt parameters. | ||
# | ||
class pi::cmdline { | ||
# @param parameters | ||
# A hash of pi::cmdline::parameter resources to create. | ||
# | ||
# @param reboot | ||
# Whether or not to force a reboot when `/boot/cmdline.txt` parameters change. | ||
# | ||
class pi::cmdline ( | ||
Hash[String[1], Hash] $parameters = {}, | ||
Boolean $reboot = true, | ||
) { | ||
augeas::lens { 'boot_cmdline': | ||
lens_content => file("${module_name}/boot_cmdline.aug"), | ||
} | ||
|
||
$parameters.each | String $name, Hash $conf | { | ||
pi::cmdline::parameter { $name: | ||
* => $conf, | ||
} | ||
} | ||
|
||
if ($reboot) { | ||
reboot { '/boot/cmdline.txt': | ||
apply => finished, | ||
message => 'Rebooting to apply /boot/config.txt changes', | ||
when => refreshed, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
shared_context 'cmdline.txt test setup' do | ||
before(:context) do | ||
shell('mkdir -p /boot') | ||
|
||
create_remote_file('default', '/boot/cmdline.txt', 'console=serial0,115200 console=tty1 root=PARTUUID=4a435670-02 rootfstype=ext4 fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles') | ||
end | ||
|
||
after(:context) do | ||
shell('rm -rf /boot/cmdline.txt') | ||
end | ||
end |