bundlewrap/bundles/raspberrypi/items.py

28 lines
655 B
Python
Raw 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/firmware/cmdline.txt': {
2020-09-27 14:46:26 +00:00
'content': ' '.join(sorted(node.metadata['raspberrypi']['cmdline'])),
**file_perms,
},
'/boot/firmware/config.txt': {
2020-09-27 14:46:26 +00:00
'content_type': 'mako',
'context': node.metadata['raspberrypi'],
**file_perms,
},
}