Compare commits

..

6 commits

8 changed files with 59 additions and 24 deletions

View file

@ -1 +0,0 @@
deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi

View file

@ -7,9 +7,6 @@ supported_os = {
12: 'bookworm',
99: 'unstable',
},
'raspbian': {
10: 'buster',
},
}
try:

View file

@ -21,6 +21,9 @@ defaults = {
'cron/jobs/upgrade-and-reboot'
)
def patchday(metadata):
if not node.metadata.get('apt/unattended-upgrades/enabled', True):
return {}
day = metadata.get('apt/unattended-upgrades/day')
hour = metadata.get('apt/unattended-upgrades/hour')

View file

@ -5,12 +5,6 @@ files = {
'svc_systemd:mosquitto:restart',
},
},
'/usr/local/bin/tasmota-telegraf-plugin': {
'mode': '0755',
'needs': {
'pkg_apt:python3-paho-mqtt',
},
},
}
svc_systemd = {
@ -23,6 +17,12 @@ svc_systemd = {
}
if node.has_bundle('telegraf'):
files['/usr/local/bin/tasmota-telegraf-plugin']['triggers'] = {
'svc_systemd:telegraf:restart',
files['/usr/local/bin/tasmota-telegraf-plugin'] = {
'mode': '0755',
'needs': {
'pkg_apt:python3-paho-mqtt',
},
'triggers': {
'svc_systemd:telegraf:restart',
},
}

View file

@ -5,7 +5,6 @@ defaults = {
'packages': {
'mosquitto': {},
'mosquitto-clients': {},
'python3-paho-mqtt': {}, # for telegraf plugin
},
},
'icinga2_api': {
@ -24,6 +23,9 @@ defaults = {
},
}
if node.has_bundle('telegraf'):
defaults['apt']['packages']['python3-paho-mqtt'] = {}
@metadata_reactor.provides(
'firewall/port_rules',

View file

@ -1,22 +1,30 @@
disable_overscan=1
hdmi_force_hotplug=1
dtparam=spi=on
dtparam=audio=on
dtoverlay=vc4-fkms-v3d
dtoverlay=vc4-kms-v3d
max_framebuffers=2
hdmi_drive=2
force_turbo=1
gpu_mem=${node.metadata['raspberrypi'].get('gpu_mem', 128)}
gpu_mem=${node.metadata.get('raspberrypi/gpu_mem', 128)}
% if node.metadata.get('raspberrypi/enable_display'):
display_auto_detect=1
% else:
dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=spi=on
hdmi_drive=2
hdmi_force_hotplug=1
% endif
% if node.os == 'debian':
arm_64bit=1
% endif
arm_boost=1
% for item in sorted(node.metadata['raspberrypi'].get('config.txt', set())):
% for item in sorted(node.metadata.get('raspberrypi/config.txt', set())):
${item}
% endfor
% if node.metadata['raspberrypi'].get('camera', False):
start_x=1
% if node.metadata.get('raspberrypi/enable_camera', False):
camera_auto_detect=1
% endif

View file

@ -15,11 +15,11 @@ actions = {
}
files = {
'/boot/cmdline.txt': {
'/boot/firmware/cmdline.txt': {
'content': ' '.join(sorted(node.metadata['raspberrypi']['cmdline'])),
**file_perms,
},
'/boot/config.txt': {
'/boot/firmware/config.txt': {
'content_type': 'mako',
'context': node.metadata['raspberrypi'],
**file_perms,

View file

@ -1,5 +1,6 @@
defaults = {
'apt': {
'clean_old_kernels': False,
'packages': {
'dhcpcd5': {
'installed': False,
@ -14,9 +15,16 @@ defaults = {
'installed': False,
},
},
'repos': {
'raspi': {
'install_gpg_key': False,
'items': {
'deb http://archive.raspberrypi.org/debian/ {os_release} main',
},
},
},
},
'raspberrypi': {
'default-target': 'multi-user.target',
'cmdline': {
'console=tty1',
'root=/dev/mmcblk0p2',
@ -28,6 +36,8 @@ defaults = {
'plymouth.ignore-serial-consoles',
'net.ifnames=0',
},
'default-target': 'multi-user.target',
'enable_display': False,
},
'systemd': {
'journal': {
@ -37,3 +47,19 @@ defaults = {
},
},
}
@metadata_reactor.provides(
'raspberrypi/cmdline',
)
def display(metadata):
if not metadata.get('raspberrypi/enable_display'):
return {}
return {
'raspberrypi': {
'cmdline': {
'video=DSI-1:800x480@60,rotate=180',
},
},
}