diff --git a/Makefile b/Makefile index 0c593f2..9e53a6d 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ clean: rm -rf *.img *.model *.manifest snaps %.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 "$(USER_KEY)" > $@ + cat definition.yaml $< | node json2yaml.js | sed "s|TIMESTAMP|$(shell date -Iseconds --utc)|g" | snap sign -k "$(USER_KEY)" > $@ snaps/%: deps/%.yaml node build-tool.js --env $(ENV) --channel $(CHANNEL) --board $* .cloud-init.yaml: $(ENV).cloud-init.yaml diff --git a/README.md b/README.md index d676dcf..5dcaf8c 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,14 @@ Everything subject to change, including number of bugs (hopefully to zero ;) ## System Requirements -To build an image you need to have at least Ubuntu 16.04 on your machine and the following packages installed: `ubuntu-image snapd` +To build an image you need to have at least Ubuntu 16.04 on your machine and the following packages installed: `ubuntu-image snapd nodejs` Additionally at least 1 GB of free disk space is required For virtual device testing you also need `qemu-kvm` +Additionally some npm packages are required, run `npm i` to install them + ## Other Requirements - Ubuntu One account diff --git a/json2yaml.js b/json2yaml.js new file mode 100644 index 0000000..d4339bb --- /dev/null +++ b/json2yaml.js @@ -0,0 +1,9 @@ +'use strict' + +const yaml = require('js-yaml') +let d = [] + +process.stdin.on('data', data => d.push(data)) +process.stdin.on('end', () => { + console.log(JSON.stringify(yaml.safeLoad(Buffer.concat(d)), null, 2)) +})