Add mrhat daemon (#16)

* Add MrHat Daemon

* Add validation of the target configuration
This commit is contained in:
AttilaGombosER
2024-08-20 20:44:56 +02:00
committed by GitHub
parent 17d41f6411
commit 1f3bdcf842
3 changed files with 139 additions and 3 deletions

22
.github/workflows/validate-config.yml vendored Normal file
View File

@ -0,0 +1,22 @@
name: Validate Configuration
on:
pull_request:
paths:
- 'config/target-config.json'
- 'schema/target-config.schema.json'
jobs:
validate-json:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: pip install check-jsonschema
- name: Validate JSON
run: |
check-jsonschema --schemafile schema/target-config.schema.json config/target-config.json

View File

@ -1,7 +1,7 @@
[
{
"name": "edge-pi-zero",
"version": "1.5.3",
"version": "1.6.0",
"reference": "2024-07-05-raspios-bullseye",
"sources": [
{
@ -41,6 +41,10 @@
"package": "mrhat-battery-simple",
"file_url": "https://github.com/EffectiveRange/drv-battery/releases/download/v0.1.0/mrhat-battery-simple_0.1.0-1_all.deb"
},
{
"package": "python3-mrhat-daemon",
"file_url": "https://github.com/EffectiveRange/mrhat-daemon/releases/download/v1.0.0/python3-mrhat-daemon_1.0.0_all.deb"
},
{
"package": "filebeat",
"version": "8.12.2",
@ -50,13 +54,14 @@
"boot_config": [
"enable_uart=1",
"dtoverlay=mrhat-battery-simple",
"dtoverlay=mrhat-bq25622:ce_override=true;battery_diag=true",
"dtoverlay=mrhat-bq25622",
"dtoverlay=mrhat-platform",
"dtoverlay=mrhat-rx8130",
"dtoverlay=googlevoicehat-soundcard"
],
"first_boot": [
"depmod"
"depmod",
"reboot"
],
"post_install": [
"raspi-config nonint do_wifi_country HU",

View File

@ -0,0 +1,109 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"version": {
"type": "string"
},
"reference": {
"type": "string"
},
"sources": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"source": {
"type": "string"
},
"key_id": {
"type": "string"
},
"key_file": {
"type": "string"
},
"key_server": {
"type": "string"
}
},
"required": ["name", "source", "key_id", "key_file"]
}
},
"packages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"package": {
"type": "string"
},
"release": {
"type": "object",
"properties": {
"owner": {
"type": "string"
},
"repo": {
"type": "string"
},
"tag": {
"type": "string"
},
"matcher": {
"type": "string"
}
},
"required": ["owner", "repo", "matcher"]
},
"version": {
"type": "string"
},
"file_url": {
"type": "string"
}
},
"required": ["package"]
}
},
"boot_cmdline": {
"type": "array",
"items": {
"type": "string"
}
},
"boot_config": {
"type": "array",
"items": {
"type": "string"
}
},
"first_boot": {
"type": "array",
"items": {
"type": "string"
}
},
"pre_install": {
"type": "array",
"items": {
"type": "string"
}
},
"post_install": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": ["name", "version", "reference", "packages"]
}
}