diff options
| -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 | ||||
| -rw-r--r-- | recipes-sota/aktualizr/aktualizr_git.bb | 4 | ||||
| -rwxr-xr-x | scripts/envsetup.sh | 10 |
5 files changed, 22 insertions, 19 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)}" | ||
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb index 162065e..140a670 100644 --- a/recipes-sota/aktualizr/aktualizr_git.bb +++ b/recipes-sota/aktualizr/aktualizr_git.bb | |||
| @@ -18,7 +18,7 @@ PR = "7" | |||
| 18 | SRC_URI = " \ | 18 | SRC_URI = " \ |
| 19 | git://github.com/advancedtelematic/aktualizr;branch=${BRANCH} \ | 19 | git://github.com/advancedtelematic/aktualizr;branch=${BRANCH} \ |
| 20 | " | 20 | " |
| 21 | SRCREV = "f043191ae622a96cf2f4d48f9073d5cfa9f16e3f" | 21 | SRCREV = "860553a1c98513bf43f6ce98491bf65addcf7e48" |
| 22 | BRANCH ?= "master" | 22 | BRANCH ?= "master" |
| 23 | 23 | ||
| 24 | S = "${WORKDIR}/git" | 24 | S = "${WORKDIR}/git" |
| @@ -39,10 +39,12 @@ do_install_append_class-target () { | |||
| 39 | } | 39 | } |
| 40 | do_install_append_class-native () { | 40 | do_install_append_class-native () { |
| 41 | rm -f ${D}${bindir}/aktualizr | 41 | rm -f ${D}${bindir}/aktualizr |
| 42 | rm -f ${D}${bindir}/aktualizr-info | ||
| 42 | } | 43 | } |
| 43 | 44 | ||
| 44 | FILES_${PN}_class-target = " \ | 45 | FILES_${PN}_class-target = " \ |
| 45 | ${bindir}/aktualizr \ | 46 | ${bindir}/aktualizr \ |
| 47 | ${bindir}/aktualizr-info \ | ||
| 46 | " | 48 | " |
| 47 | FILES_${PN}_class-native = " \ | 49 | FILES_${PN}_class-native = " \ |
| 48 | ${bindir}/aktualizr_implicit_writer \ | 50 | ${bindir}/aktualizr_implicit_writer \ |
diff --git a/scripts/envsetup.sh b/scripts/envsetup.sh index 260b048..ff78681 100755 --- a/scripts/envsetup.sh +++ b/scripts/envsetup.sh | |||
| @@ -24,15 +24,7 @@ fi | |||
| 24 | METADIR="${SOURCEDIR}/../.." | 24 | METADIR="${SOURCEDIR}/../.." |
| 25 | 25 | ||
| 26 | if [[ ! -f "${BUILDDIR}/conf/local.conf" ]]; then | 26 | if [[ ! -f "${BUILDDIR}/conf/local.conf" ]]; then |
| 27 | if [ -z "$TEMPLATECONF" ] && [ -d ${METADIR}/meta-updater-${MACHINE}/conf ]; then | 27 | source "$METADIR/poky/oe-init-build-env" "$BUILDDIR" |
| 28 | # Use the template configurations for the specified machine | ||
| 29 | TEMPLATECONF=${METADIR}/meta-updater-${MACHINE}/conf | ||
| 30 | source "$METADIR/poky/oe-init-build-env" "$BUILDDIR" | ||
| 31 | unset TEMPLATECONF | ||
| 32 | else | ||
| 33 | # Use the default configurations or TEMPLATECONF set by the user | ||
| 34 | source "$METADIR/poky/oe-init-build-env" "$BUILDDIR" | ||
| 35 | fi | ||
| 36 | echo "METADIR := \"\${@os.path.abspath('${METADIR}')}\"" >> conf/bblayers.conf | 28 | echo "METADIR := \"\${@os.path.abspath('${METADIR}')}\"" >> conf/bblayers.conf |
| 37 | cat "${METADIR}/meta-updater/conf/include/bblayers/sota.inc" >> conf/bblayers.conf | 29 | cat "${METADIR}/meta-updater/conf/include/bblayers/sota.inc" >> conf/bblayers.conf |
| 38 | cat "${METADIR}/meta-updater/conf/include/bblayers/sota_${MACHINE}.inc" >> conf/bblayers.conf | 30 | cat "${METADIR}/meta-updater/conf/include/bblayers/sota_${MACHINE}.inc" >> conf/bblayers.conf |
