From c7fca8724c65aa69f6e22a04f32e413800828270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= Date: Fri, 10 Aug 2018 16:17:10 +0200 Subject: [PATCH] feat: Use YAML for board definitions --- Makefile | 4 ++-- boards/FOOT.json | 5 ----- boards/HEAD.json | 4 ---- boards/amd64.json | 3 --- boards/amd64.yaml | 3 +++ boards/rpi2.json | 3 --- boards/rpi2.yaml | 3 +++ boards/rpi3.json | 4 ---- boards/rpi3.yaml | 4 ++++ definition.yaml | 12 ++++++++++++ 10 files changed, 24 insertions(+), 21 deletions(-) delete mode 100644 boards/FOOT.json delete mode 100644 boards/HEAD.json delete mode 100644 boards/amd64.json create mode 100644 boards/amd64.yaml delete mode 100644 boards/rpi2.json create mode 100644 boards/rpi2.yaml delete mode 100644 boards/rpi3.json create mode 100644 boards/rpi3.yaml create mode 100644 definition.yaml diff --git a/Makefile b/Makefile index f51617d..52b644f 100644 --- a/Makefile +++ b/Makefile @@ -3,8 +3,8 @@ CHANNEL=stable clean: rm -rf *.img *.model *.manifest -%.model: boards/%.json # sign a model file - cat boards/HEAD.json $< boards/FOOT.json | sed "s|TIMESTAMP|$(shell date -Iseconds --utc)|g" | snap sign -k default > $@ +%.model: boards/%.yaml # sign a model file + cat definition.yaml $< | python -c "import sys, yaml, json; json.dump(yaml.load(sys.stdin), sys.stdout, indent=2)" | sed "s|TIMESTAMP|$(shell date -Iseconds --utc)|g" | snap sign -k default > $@ %.img: %.model # build an image sudo ubuntu-image snap -o $@ -c $(CHANNEL) $< diff --git a/boards/FOOT.json b/boards/FOOT.json deleted file mode 100644 index 40da745..0000000 --- a/boards/FOOT.json +++ /dev/null @@ -1,5 +0,0 @@ - "required-snaps": ["hello", "hello-world", "nextcloud", "lxd"], - "authority-id": "7xN2sMCILuFk10e6DxrTrQWprdmV0Vi9", - "brand-id": "7xN2sMCILuFk10e6DxrTrQWprdmV0Vi9", - "timestamp": "TIMESTAMP" -} diff --git a/boards/HEAD.json b/boards/HEAD.json deleted file mode 100644 index c4117b2..0000000 --- a/boards/HEAD.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "type": "model", - "series": "16", - "model": "hub", diff --git a/boards/amd64.json b/boards/amd64.json deleted file mode 100644 index 12b3b8c..0000000 --- a/boards/amd64.json +++ /dev/null @@ -1,3 +0,0 @@ - "architecture": "amd64", - "gadget": "joule", - "kernel": "joule-linux", diff --git a/boards/amd64.yaml b/boards/amd64.yaml new file mode 100644 index 0000000..9c69dd6 --- /dev/null +++ b/boards/amd64.yaml @@ -0,0 +1,3 @@ +architecture: amd64 +gadget: joule +kernel: joule-linux diff --git a/boards/rpi2.json b/boards/rpi2.json deleted file mode 100644 index e99bc6b..0000000 --- a/boards/rpi2.json +++ /dev/null @@ -1,3 +0,0 @@ - "architecture": "armhf", - "gadget": "pi2", - "kernel": "pi2-kernel", diff --git a/boards/rpi2.yaml b/boards/rpi2.yaml new file mode 100644 index 0000000..180b7e9 --- /dev/null +++ b/boards/rpi2.yaml @@ -0,0 +1,3 @@ +architecture: armhf +gadget: pi2 +kernel: pi2-kernel diff --git a/boards/rpi3.json b/boards/rpi3.json deleted file mode 100644 index d7384de..0000000 --- a/boards/rpi3.json +++ /dev/null @@ -1,4 +0,0 @@ - "architecture": "armhf", - "gadget": "pi2", - "kernel": "pi3-kernel", - diff --git a/boards/rpi3.yaml b/boards/rpi3.yaml new file mode 100644 index 0000000..470e639 --- /dev/null +++ b/boards/rpi3.yaml @@ -0,0 +1,4 @@ +architecture: armhf +gadget: pi3 +kernel: pi2-kernel + diff --git a/definition.yaml b/definition.yaml new file mode 100644 index 0000000..c0da4c2 --- /dev/null +++ b/definition.yaml @@ -0,0 +1,12 @@ +# basic +type: model +series: "16" +model: hub +# snaps to be preinstalled: +required-snaps: + - nextcloud # just for proof-of-concept +# authority meta +authority-id: 7xN2sMCILuFk10e6DxrTrQWprdmV0Vi9 +brand-id: 7xN2sMCILuFk10e6DxrTrQWprdmV0Vi9 +# timestamp gets filled in automatically +timestamp: TIMESTAMP