diff options
Diffstat (limited to 'classes')
-rw-r--r-- | classes/image_types_ostree.bbclass | 23 | ||||
-rw-r--r-- | classes/sota.bbclass | 2 | ||||
-rw-r--r-- | classes/sota_qemux86-64.bbclass | 2 |
3 files changed, 18 insertions, 9 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index 172f2c8..ea3c7a2 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass | |||
@@ -183,7 +183,7 @@ IMAGE_DEPENDS_garagesign = "garage-sign-native:do_populate_sysroot" | |||
183 | IMAGE_CMD_garagesign () { | 183 | IMAGE_CMD_garagesign () { |
184 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then | 184 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then |
185 | # if credentials are issued by a server that doesn't support offline signing, exit silently | 185 | # if credentials are issued by a server that doesn't support offline signing, exit silently |
186 | unzip -p ${SOTA_PACKED_CREDENTIALS} root.json targets.pub targets.sec 2>&1 >/dev/null || exit 0 | 186 | unzip -p ${SOTA_PACKED_CREDENTIALS} root.json targets.pub targets.sec tufrepo.url 2>&1 >/dev/null || exit 0 |
187 | 187 | ||
188 | java_version=$( java -version 2>&1 | awk -F '"' '/version/ {print $2}' ) | 188 | java_version=$( java -version 2>&1 | awk -F '"' '/version/ {print $2}' ) |
189 | if [ "${java_version}" = "" ]; then | 189 | if [ "${java_version}" = "" ]; then |
@@ -198,11 +198,7 @@ IMAGE_CMD_garagesign () { | |||
198 | garage-sign init --repo ${GARAGE_SIGN_REPO} --home-dir ${GARAGE_SIGN_REPO} --credentials ${SOTA_PACKED_CREDENTIALS} | 198 | garage-sign init --repo ${GARAGE_SIGN_REPO} --home-dir ${GARAGE_SIGN_REPO} --credentials ${SOTA_PACKED_CREDENTIALS} |
199 | fi | 199 | fi |
200 | 200 | ||
201 | if [ -n "${GARAGE_SIGN_REPOSERVER}" ]; then | 201 | reposerver_args="--reposerver $( unzip -p ${SOTA_PACKED_CREDENTIALS} tufrepo.url )" |
202 | reposerver_args="--reposerver ${GARAGE_SIGN_REPOSERVER}" | ||
203 | else | ||
204 | reposerver_args="" | ||
205 | fi | ||
206 | 202 | ||
207 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) | 203 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) |
208 | 204 | ||
@@ -227,9 +223,20 @@ IMAGE_CMD_garagesign () { | |||
227 | bberror "Couldn't push to garage repository" | 223 | bberror "Couldn't push to garage repository" |
228 | exit 1 | 224 | exit 1 |
229 | fi | 225 | fi |
230 | else | ||
231 | bbwarn "SOTA_PACKED_CREDENTIALS not set. Please add SOTA_PACKED_CREDENTIALS." | ||
232 | fi | 226 | fi |
233 | } | 227 | } |
234 | 228 | ||
229 | IMAGE_TYPEDEP_garagecheck = "ostreepush garagesign" | ||
230 | IMAGE_DEPENDS_garagecheck = "aktualizr-native:do_populate_sysroot" | ||
231 | IMAGE_CMD_garagecheck () { | ||
232 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then | ||
233 | # if credentials are issued by a server that doesn't support offline signing, exit silently | ||
234 | unzip -p ${SOTA_PACKED_CREDENTIALS} root.json targets.pub targets.sec tufrepo.url 2>&1 >/dev/null || exit 0 | ||
235 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) | ||
236 | |||
237 | garage-check --ref=${ostree_target_hash} \ | ||
238 | --credentials=${SOTA_PACKED_CREDENTIALS} \ | ||
239 | --cacert=${STAGING_ETCDIR_NATIVE}/ssl/certs/ca-certificates.crt | ||
240 | fi | ||
241 | } | ||
235 | # vim:set ts=4 sw=4 sts=4 expandtab: | 242 | # vim:set ts=4 sw=4 sts=4 expandtab: |
diff --git a/classes/sota.bbclass b/classes/sota.bbclass index f5a42c1..0f42332 100644 --- a/classes/sota.bbclass +++ b/classes/sota.bbclass | |||
@@ -11,7 +11,7 @@ SOTA_CLIENT ??= "aktualizr" | |||
11 | SOTA_CLIENT_PROV ??= "aktualizr-auto-prov" | 11 | SOTA_CLIENT_PROV ??= "aktualizr-auto-prov" |
12 | IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PROV}" | 12 | IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PROV}" |
13 | IMAGE_CLASSES += " image_types_ostree image_types_ota" | 13 | IMAGE_CLASSES += " image_types_ostree image_types_ota" |
14 | IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'ostreepush garagesign otaimg wic', ' ', d)}" | 14 | IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'ostreepush garagesign garagecheck otaimg wic', ' ', d)}" |
15 | 15 | ||
16 | PACKAGECONFIG_append_pn-curl = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', " ssl", " ", d)}" | 16 | PACKAGECONFIG_append_pn-curl = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', " ssl", " ", d)}" |
17 | PACKAGECONFIG_remove_pn-curl = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', " gnutls", " ", d)}" | 17 | PACKAGECONFIG_remove_pn-curl = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', " gnutls", " ", d)}" |
diff --git a/classes/sota_qemux86-64.bbclass b/classes/sota_qemux86-64.bbclass index 5ec4f69..53e0026 100644 --- a/classes/sota_qemux86-64.bbclass +++ b/classes/sota_qemux86-64.bbclass | |||
@@ -9,3 +9,5 @@ UBOOT_MACHINE_sota = "qemu-x86_defconfig" | |||
9 | OSTREE_BOOTLOADER ?= "u-boot" | 9 | OSTREE_BOOTLOADER ?= "u-boot" |
10 | 10 | ||
11 | OSTREE_KERNEL_ARGS ?= "ramdisk_size=16384 rw rootfstype=ext4 rootwait rootdelay=2 ostree_root=/dev/hda" | 11 | OSTREE_KERNEL_ARGS ?= "ramdisk_size=16384 rw rootfstype=ext4 rootwait rootdelay=2 ostree_root=/dev/hda" |
12 | |||
13 | IMAGE_ROOTFS_EXTRA_SPACE = "${@bb.utils.contains('DISTRO_FEATURES', 'sota', '65536', '', d)}" | ||