bundlewrap/bundles/raspberrypi/items.py

28 lines
637 B
Python
Raw Permalink Normal View History

2020-09-27 14:46:26 +00:00
default_target = node.metadata['raspberrypi']['default-target']
# On a FAT filesystem.
file_perms = {
'owner': None,
'group': None,
'mode': None,
}
actions = {
'raspberrypi_assure_target': {
'command': f'systemctl set-default {default_target}',
2020-09-27 15:18:05 +00:00
'unless': f'[ "$(systemctl get-default)" = "{default_target}" ]',
2020-09-27 14:46:26 +00:00
},
}
files = {
'/boot/cmdline.txt': {
'content': ' '.join(sorted(node.metadata['raspberrypi']['cmdline'])),
**file_perms,
},
'/boot/config.txt': {
'content_type': 'mako',
'context': node.metadata['raspberrypi'],
**file_perms,
},
}