summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcajun-rat <phil@advancedtelematic.com>2017-10-24 09:24:20 +0200
committerGitHub <noreply@github.com>2017-10-24 09:24:20 +0200
commiteceaca216c73bd188821e111a73723069668e1f3 (patch)
tree1a1e42ec1e0e8e7c9e0c62978b8a395dfa4481f2
parent6b83fd2c704ad8b528b80ac036abab1e94bb982b (diff)
parent5d654c0b45acd7e3dd1127739b7237143d984d0b (diff)
downloadmeta-updater-eceaca216c73bd188821e111a73723069668e1f3.tar.gz
Merge pull request #148 from advancedtelematic/bugfix/PRO-4216/new-garage-push
Bugfix/pro 4216/new garage push
-rw-r--r--README.adoc10
-rw-r--r--classes/image_types_ostree.bbclass2
-rw-r--r--recipes-sota/aktualizr/aktualizr-native_git.bb6
-rw-r--r--recipes-sota/aktualizr/aktualizr_common.inc2
-rw-r--r--recipes-sota/sota-tools/sota-tools_git.bb24
5 files changed, 11 insertions, 33 deletions
diff --git a/README.adoc b/README.adoc
index 9615f65..47c0a2b 100644
--- a/README.adoc
+++ b/README.adoc
@@ -71,7 +71,7 @@ Although we have used U-Boot so far, other boot loaders can be configured work w
71* OSTREE_BRANCHNAME - the branch your rootfs will be committed to. Defaults to "ota" 71* OSTREE_BRANCHNAME - the branch your rootfs will be committed to. Defaults to "ota"
72* OSTREE_OSNAME - OS deployment name on your target device. For more information about deployments and osnames see the https://ostree.readthedocs.io/en/latest/manual/deployment/[OSTree documentation]. Defaults to "poky". 72* OSTREE_OSNAME - OS deployment name on your target device. For more information about deployments and osnames see the https://ostree.readthedocs.io/en/latest/manual/deployment/[OSTree documentation]. Defaults to "poky".
73* OSTREE_INITRAMFS_IMAGE - initramfs/initrd image that is used as a proxy while booting into OSTree deployment. Do not change this setting unless you are sure that your initramfs can serve as such a proxy. 73* OSTREE_INITRAMFS_IMAGE - initramfs/initrd image that is used as a proxy while booting into OSTree deployment. Do not change this setting unless you are sure that your initramfs can serve as such a proxy.
74* OSTREE_PUSH_CREDENTIALS - when set, your ostree commit will be pushed to a remote repo as a bitbake step. This should be the path to a JSON credentials file in https://github.com/advancedtelematic/sota-tools#credentials[the format accepted by garage-push]. 74* SOTA_PACKED_CREDENTIALS - when set, your ostree commit will be pushed to a remote repo as a bitbake step. This should be the path to a JSON credentials file in https://github.com/advancedtelematic/sota-tools#credentials[the format accepted by garage-push].
75 75
76== Usage 76== Usage
77 77
@@ -113,12 +113,12 @@ ostree pull agl-snapshot agl-ota
113ostree admin deploy --os=agl agl-snapshot:agl-ota 113ostree admin deploy --os=agl agl-snapshot:agl-ota
114.... 114....
115 115
116=== SOTA tools 116=== garage-push
117 117
118SOTA tools currently contains only one tool, garage-push, which lets you push the changes in OSTree repository generated by bitbake process. It communicates with an http server capable of querying files with HEAD requests and uploading them with POST requests. In particular, this can be used with http://www.atsgarage.com/[ATS Garage]. garage-push is used as follows: 118The https://github.com/advancedtelematic/aktualizr[aktualizr repo] contains a tool, garage-push, which lets you push the changes in OSTree repository generated by bitbake process. It communicates with an http server capable of querying files with HEAD requests and uploading them with POST requests. In particular, this can be used with http://www.atsgarage.com/[ATS Garage]. garage-push is used as follows:
119 119
120.... 120....
121garage-push --repo=/path/to/ostree-repo --ref=mybranch --credentials=/path/to/credentials.json 121garage-push --repo=/path/to/ostree-repo --ref=mybranch --credentials=/path/to/credentials.zip
122.... 122....
123 123
124You can set OSTREE_PUSH_CREDENTIALS in your local.conf to make your build results be automatically synchronized with a remote server. Credentials are stored in the JSON format described in the https://github.com/advancedtelematic/sota-tools#credentials[sota-tools README]. 124You can set SOTA_PACKED_CREDENTIALS in your local.conf to make your build results be automatically synchronized with a remote server. Credentials are stored in the JSON format described in the https://github.com/advancedtelematic/aktualizr/blob/master/README.sotatools.adoc[garage-push README]. This JSON file can be optionally stored inside a zip file, although if it is stored this way, the JSON file must be named treehub.json.
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass
index adcafe3..1f8e195 100644
--- a/classes/image_types_ostree.bbclass
+++ b/classes/image_types_ostree.bbclass
@@ -159,7 +159,7 @@ IMAGE_CMD_ostree () {
159} 159}
160 160
161IMAGE_TYPEDEP_ostreepush = "ostree" 161IMAGE_TYPEDEP_ostreepush = "ostree"
162IMAGE_DEPENDS_ostreepush = "sota-tools-native:do_populate_sysroot" 162IMAGE_DEPENDS_ostreepush = "aktualizr-native:do_populate_sysroot"
163IMAGE_CMD_ostreepush () { 163IMAGE_CMD_ostreepush () {
164 # Print warnings if credetials are not set or if the file has not been found. 164 # Print warnings if credetials are not set or if the file has not been found.
165 if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then 165 if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then
diff --git a/recipes-sota/aktualizr/aktualizr-native_git.bb b/recipes-sota/aktualizr/aktualizr-native_git.bb
index 59479fd..b89e9de 100644
--- a/recipes-sota/aktualizr/aktualizr-native_git.bb
+++ b/recipes-sota/aktualizr/aktualizr-native_git.bb
@@ -1,16 +1,18 @@
1require aktualizr_common.inc 1require aktualizr_common.inc
2 2
3DEPENDS = "boost-native openssl-native libarchive-native libsodium-native" 3DEPENDS = "boost-native glib-2.0-native curl-native openssl-native libarchive-native libsodium-native"
4 4
5inherit native 5inherit native
6 6
7EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_OSTREE=OFF -DAKTUALIZR_VERSION=${PV}" 7EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_SOTA_TOOLS=ON -DBUILD_OSTREE=OFF -DAKTUALIZR_VERSION=${PV}"
8 8
9do_install_append () { 9do_install_append () {
10 rm ${D}${bindir}/aktualizr 10 rm ${D}${bindir}/aktualizr
11 rm ${D}${bindir}/aktualizr_cert_provider 11 rm ${D}${bindir}/aktualizr_cert_provider
12 rm ${D}${bindir}/garage-deploy
12} 13}
13 14
14FILES_${PN} = " \ 15FILES_${PN} = " \
15 ${bindir}/aktualizr_implicit_writer \ 16 ${bindir}/aktualizr_implicit_writer \
17 ${bindir}/garage-push \
16 " 18 "
diff --git a/recipes-sota/aktualizr/aktualizr_common.inc b/recipes-sota/aktualizr/aktualizr_common.inc
index 7ed3614..79c5e37 100644
--- a/recipes-sota/aktualizr/aktualizr_common.inc
+++ b/recipes-sota/aktualizr/aktualizr_common.inc
@@ -11,7 +11,7 @@ PR = "7"
11SRC_URI = " \ 11SRC_URI = " \
12 git://github.com/advancedtelematic/aktualizr;branch=${BRANCH} \ 12 git://github.com/advancedtelematic/aktualizr;branch=${BRANCH} \
13 " 13 "
14SRCREV = "59c276c1d4800d025594b53900ee964533695731" 14SRCREV = "67c4f44c4136d16871726449502e3926098e8524"
15BRANCH ?= "master" 15BRANCH ?= "master"
16 16
17S = "${WORKDIR}/git" 17S = "${WORKDIR}/git"
diff --git a/recipes-sota/sota-tools/sota-tools_git.bb b/recipes-sota/sota-tools/sota-tools_git.bb
deleted file mode 100644
index 5403d9a..0000000
--- a/recipes-sota/sota-tools/sota-tools_git.bb
+++ /dev/null
@@ -1,24 +0,0 @@
1DESCRIPTION = "Utility to push data to a server"
2LICENSE = "MPL-2.0"
3
4LIC_FILES_CHKSUM = "file://LICENSE;md5=65d26fcc2f35ea6a181ac777e42db1ea"
5
6S = "${WORKDIR}/git"
7
8SRC_URI = "gitsm://github.com/advancedtelematic/sota-tools.git;branch=master"
9SRCREV = "216cb84db98e9b0f8c6c1c407f480c5dd0b3cf62"
10
11inherit cmake
12
13DEPENDS = "boost glib-2.0 curl libarchive"
14
15BBCLASSEXTEND = "native"
16
17FILES_${PN} = "${bindir}/garage-push"
18
19EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF"
20
21do_install() {
22 install -d ${D}/${bindir}
23 install -m 755 garage-push ${D}/${bindir}
24}