bundlewrap/bundles/raspberrypi/items.py

27 lines
655 B
Python

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}',
'unless': f'[ "$(systemctl get-default)" = "{default_target}" ]',
},
}
files = {
'/boot/firmware/cmdline.txt': {
'content': ' '.join(sorted(node.metadata['raspberrypi']['cmdline'])),
**file_perms,
},
'/boot/firmware/config.txt': {
'content_type': 'mako',
'context': node.metadata['raspberrypi'],
**file_perms,
},
}