Browse Source

feat: make signing optional, add presigned

master
Maciej Krüger 4 years ago
parent
commit
d0ed2ee71c
  1. 6
      Makefile
  2. 15
      conf-tool.sh
  3. 26
      presigned/amd64
  4. 26
      presigned/opi0
  5. 26
      presigned/rpi2
  6. 26
      presigned/rpi3

6
Makefile

@ -1,5 +1,6 @@
CHANNEL=$(shell bash conf-tool.sh read CHANNEL)
ENV=$(shell bash conf-tool.sh read ENV)
ENABLE_SIGNING=$(shell bash conf-tool.sh read ENABLE_SIGNING)
DEVICE_IP=$(shell bash conf-tool.sh read DEVICE_IP)
DEVICE_USERNAME=$(shell bash conf-tool.sh read DEVICE_USERNAME)
DEVICE_PORT=$(shell bash conf-tool.sh read DEVICE_PORT)
@ -17,7 +18,10 @@ clean:
rm -rf *.img *.model *.manifest snaps
%.model: boards/%.yaml # sign a model file
cat definition.yaml $< | node json2yaml.js | sed "s|TIMESTAMP|$(shell date -Iseconds --utc)|g" | snap sign -k "$(USER_KEY)" > $@
test "$(ENABLE_SIGNING)" = "false" || cat definition.yaml $< | node json2yaml.js | sed "s|TIMESTAMP|$(shell date -Iseconds --utc)|g" | snap sign -k "$(USER_KEY)" > $@
test "$(ENABLE_SIGNING)" = "true" || cp presigned/$* $*.model
presigned/%: %.model
cp $*.model presigned/$*
%.snaps:
node build-tool.js --env $(ENV) --channel $(CHANNEL) --board $*
.cloud-init.yaml: $(ENV).cloud-init.yaml

15
conf-tool.sh

@ -5,6 +5,12 @@ die() {
exit 2
}
if [ ! -z "$ENABLE_SIGNING"]; then
ENABLE_SIGNING=true
else
ENABLE_SIGNING=false
fi
if [ "x$1" == "xread" ]; then
if [ ! -e .config ]; then
die "No config found. Run '$ bash conf-tool.sh'"
@ -29,8 +35,12 @@ if [ "$user_email" == "-" ]; then
die "User email is not set up. Please run:\n\n\t$ snap login"
fi
if [ "$signing_key" == "No" ]; then
die "Signing key is not set up. https://tutorials.ubuntu.com/tutorial/create-your-own-core-image#3"
if $ENABLE_SIGNING; then
if [ "$signing_key" == "No" ]; then
die "Signing key is not set up. https://tutorials.ubuntu.com/tutorial/create-your-own-core-image#3"
fi
else
signing_key="-"
fi
dev_user=$(echo "$user_email" | sed "s|@.*||g")
@ -52,6 +62,7 @@ ENV=$dev_env
DEVICE_IP=$dev_addr
DEVICE_USERNAME=$dev_user
DEVICE_PORT=$dev_port
ENABLE_SIGNING=$ENABLE_SIGNING
USER_KEY=$signing_key
USER_EMAIL=$user_email"

26
presigned/amd64

@ -0,0 +1,26 @@
type: model
authority-id: 7xN2sMCILuFk10e6DxrTrQWprdmV0Vi9
series: 16
brand-id: 7xN2sMCILuFk10e6DxrTrQWprdmV0Vi9
model: ppl-hub-amd64
architecture: amd64
base: core18
display-name: ppl Hub (amd64)
gadget: pc=18
kernel: pc-kernel=18
required-snaps:
- nextcloud
- snapweb
timestamp: 2018-11-24T14:34:30+00:00
sign-key-sha3-384: Sp52K16Tw9Ffwp-2B1h1t7ZIGAo3-RZIy42QFgcpE3dvxvAWk5wjS28QBfZp4tl8
AcLBcwQAAQoAHRYhBLnisbjJT0NqTiGhZpSS1FlKvJ0OBQJb+WF2AAoJEJSS1FlKvJ0OzBsQAIRI
+JBvQBpcWQmmDei1tuXSivm0D4dAjflZB1sEkh0jJCivwu8yu6PtL+7MNHCXyeA/AFTR/GOO5CSg
XKK2VWcJEGM6NNdtehghTM22IvnyvRglfHPFZ20AIYA9aS1xSzPHoaFPdcGXQ+THRCXNnDQdgDv1
u8dqfy4Ag7WL7u9EKruv2x/FCSslb0/Xah6NvUGWodiUj/9tCMwK4ez5HILyMqCouqeBTb+wYXLD
azXEolXKOBG/6gTpoU0onNKjU8Uj74gJcpG6XyhEnWDX4sEPJCdakX+z6XE9SE3x0jYa8Uv+IUgK
z6OI7fltLouVMm/dvhpgethTzRp04m5RcEsS9NwrUExJnV8pkwyNcrS28Ks5KieKuCNzKth2D5x5
CsQiSHMtlnRp+4nOm+goNWA1cEu1by3WuBsdy9keS6/g7qPd5iNm3ykZY+eoIcYYgKmRac5hIMs7
9GL0K9JUB9JgFPui98vbH77SrVDx5ubclvs5YDnWlANsQMHbRJFYT+y8G+FGe7XLonh9s/NxO4/6
q4zrcosgxPS1fBgmx0nqK+KrR1uCYtZztAXKsWkwtWBInK8ztJ+HXJ2zZnt3ugVOZ44CsvN7Shru
6mpWL06AKlx1toObZfm9iEb4XcyoLTFJqELBa2QX8ZQ2x9iBG1GMPGA1FieUQmaOsFcDAyND

26
presigned/opi0

@ -0,0 +1,26 @@
type: model
authority-id: 7xN2sMCILuFk10e6DxrTrQWprdmV0Vi9
series: 16
brand-id: 7xN2sMCILuFk10e6DxrTrQWprdmV0Vi9
model: ppl-hub-opi0
architecture: armhf
base: core18
display-name: ppl Hub (Orange Pi Zero)
gadget: orangepi-zero-gadget
kernel: orangepi-zero-kernel
required-snaps:
- nextcloud
- snapweb
timestamp: 2018-11-24T14:34:30+00:00
sign-key-sha3-384: Sp52K16Tw9Ffwp-2B1h1t7ZIGAo3-RZIy42QFgcpE3dvxvAWk5wjS28QBfZp4tl8
AcLBcwQAAQoAHRYhBLnisbjJT0NqTiGhZpSS1FlKvJ0OBQJb+WF3AAoJEJSS1FlKvJ0ObNkQAKpS
l3HKy3fgWRJcfonY1xBe5KI3bAI10voMZ5d1Gi+p/x0PR0YqkwM4JCIFEKhzBw4UFoT0weFPZcr4
fOLgaJI98RjqM5lVTFn9p0dZMD2w/rhRZ+ycuAfgAi6FCrYbZR2KBBveA9UAj0p7l7nZBErlmORJ
07PZnvI9LK/lsz3JKpwF0xGDTM3ZekG4I/3+bmfGSlD508IFJIrhANpmXw3/KUNeKhh+lWBd4MJx
PCII74p9ZzEClbJ23SlxjYqepTu51KV8V9RwxDC4r3STIYWUrdzwLs/mKrME9JkUptvTSRD0UhEA
Yd3geC2UTgHJ4AwceTjLMblDPrfeu8qu7Cx8hqI30XvvyWCJ7MCZntW+5rRojjQFUDxZNq+cTDf3
0GL9H2IwwTdrXING1VVKl3R1/CzH/LFJteuV1XmSCEa8tIzIrk4mbwVVyS0lm/bpiu4MVCDvG0Ul
/p0Bs/2s/FKreYVZPaNvcEJcCkROFa0R5DsDGC6N/0ZLf26bw68cF0Mviw9a5QjqXlgHxkL6DXs7
zgnXRXKGBxtrQZd9QniW8Cuhptnp5GStQEu85/jPMt2q20YU2VxahYdIL7HkBBkh9I8eS8cgn3KI
pVm+MnuAkkLZ9aCPxvLLbHdHGf8/hZIK1MLIecq3NKrCsvxqGM39iqiPSAYUsg8WAxpOy3O7

26
presigned/rpi2

@ -0,0 +1,26 @@
type: model
authority-id: 7xN2sMCILuFk10e6DxrTrQWprdmV0Vi9
series: 16
brand-id: 7xN2sMCILuFk10e6DxrTrQWprdmV0Vi9
model: ppl-hub-pi2
architecture: armhf
base: core18
display-name: ppl Hub (Raspberry Pi 2)
gadget: pi2=18
kernel: pi-kernel=18-pi2
required-snaps:
- nextcloud
- snapweb
timestamp: 2018-11-24T14:34:31+00:00
sign-key-sha3-384: Sp52K16Tw9Ffwp-2B1h1t7ZIGAo3-RZIy42QFgcpE3dvxvAWk5wjS28QBfZp4tl8
AcLBcwQAAQoAHRYhBLnisbjJT0NqTiGhZpSS1FlKvJ0OBQJb+WF3AAoJEJSS1FlKvJ0OcnoQAMD8
+JzJ36YNOki3sxVmzqRAQCZFDQ5SYNjGTa6aHbW1zyD+eRxZ5RybmxWxrdpIrft44uRToA9h7gnF
5fn2ptJZdf6F6omXgtOE6eXujjgxWHFxcOxS4AUpDRwn8gJyeOxBzTEqJp1qa2fMsy7MuNGBMBot
Ulus45laI8ymwsrnJbv6P6KFcZ3liHZpWF+kbdkyHQRPcohB5/A7B/kC8yWm07W3ViRwAU/8M64p
f22tOBXK/HxGuonxfO/LfYbt19Smz6WvoRo7OXh9h1l7ZaZhknSTMyPyERwW+RX0Gm4BkXiPPnCb
UYMUOCS+tJa8aZUTJJjfi59OF0oWRU2oFZU4DU9inqfronr1yLKIXY/lMLbS+rP7PnI1aeRj9Wgr
tTylJ7bS9+cXnnOgnzm3sjcnw+iviD1YbF1s5/wZ+U/jjGjBSvVS6qt7gEoeNkFPFrSx+QopdScl
OOamldMARYFdamvCMpQmOLgZ9gJLlkqAPqdOng8+v7jKs5KdCVzv3Pz69H47FrzTHZFJzAS2BBmA
RPwQB+xq+EQPFSfQzKNnfPKkmaIj0iUKloOymewrYnovz8T4iCZ74fb9SlronM4Sde/9f9piFkst
gdmUjc7/cTSgiklI55OjZjF7H2IRTdbervsTyWAKVMaa/f71BnSVUM02Fb0IC7C+0LlygN0r

26
presigned/rpi3

@ -0,0 +1,26 @@
type: model
authority-id: 7xN2sMCILuFk10e6DxrTrQWprdmV0Vi9
series: 16
brand-id: 7xN2sMCILuFk10e6DxrTrQWprdmV0Vi9
model: ppl-hub-pi3
architecture: armhf
base: core18
display-name: ppl Hub (Raspberry Pi 3)
gadget: pi3=18
kernel: pi-kernel=18-pi3
required-snaps:
- nextcloud
- snapweb
timestamp: 2018-11-24T14:34:31+00:00
sign-key-sha3-384: Sp52K16Tw9Ffwp-2B1h1t7ZIGAo3-RZIy42QFgcpE3dvxvAWk5wjS28QBfZp4tl8
AcLBcwQAAQoAHRYhBLnisbjJT0NqTiGhZpSS1FlKvJ0OBQJb+WF4AAoJEJSS1FlKvJ0OVzYQAIsk
HV6trjkGFQs1TL/4Mifv6OmJUFvc9azkSMWwYtEjG+3i4lh2h5/cw4NB+G/gqPdxar9hMD2dmBCE
6/rbaZdTu8IxsP4NLLobYg2CSptxgSKA9k7i/vWL99mVy5i3orlhfJ0t0XtLR+fNx5GzIoezZ0gd
XRgFLOmaj50Ko/p9PAGu7rdBNGC5HnNmloAqlTJcXjcOuJvnKY3oyfoOxH/YhzTjDqkc0NcoMDeV
PcRwNr4bIgFaulNOcClQ7PDssvTTcq2mXe5wYtglX7gknXSSItXpgJ8nRq47t6dann4yXu7TPmJx
ibeSCNbQ3bAvpgr4JK57gCxuQdNjRZi8KvgPIVKYojkD75s+3AlHUujbpkUSIQySExQx0uM5yIvQ
/EyKRTDLbemr1JnnmJFaK9eeHd1wG3iFH3EvmhwKit3KBCduYaQ/UtaI4WcukwyjVbSPupVQPByy
pOxa8HzeLD+pYy+BBIJb+68oSJl/Z6FuQkJoSTgQ2AFw0qhXDzj6w5tnollGFuhnk8edOLqJPhQA
WTt7KwT0TvB1xAcDxBByxaPrXo426dHx2jZj6Pho7JbFfJn/mzZf3wKjMNwZ2tFs2MVaB0uQOj9o
ZPvwGdvMs3CiQIcKC5YHywtVIQHY8K1r8M6zXW6W1QP2TDVa1XlkmLGilbWmcRm0D9aybR+L
Loading…
Cancel
Save