diff options
| -rw-r--r-- | classes/image_types_ostree.bbclass | 60 | ||||
| -rw-r--r-- | classes/image_types_ota.bbclass | 30 | ||||
| -rw-r--r-- | classes/sota_sanity.bbclass | 23 | ||||
| -rw-r--r-- | recipes-core/images/initramfs-ostree-image.bb | 2 | ||||
| -rw-r--r-- | recipes-extended/collectd/collectd_%.bbappend | 5 | ||||
| -rw-r--r-- | recipes-sota/aktualizr/aktualizr-collectd.bb | 21 | ||||
| -rw-r--r-- | recipes-sota/aktualizr/aktualizr-shared-prov.bb | 2 | ||||
| -rw-r--r-- | recipes-sota/aktualizr/aktualizr_git.bb | 12 | ||||
| -rw-r--r-- | recipes-sota/aktualizr/files/aktualizr-collectd.conf | 9 |
9 files changed, 110 insertions, 54 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index ce9f984..fd38d28 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass | |||
| @@ -20,14 +20,24 @@ CONVERSION_CMD_tar = "touch ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${ | |||
| 20 | CONVERSIONTYPES_append = " tar" | 20 | CONVERSIONTYPES_append = " tar" |
| 21 | 21 | ||
| 22 | TAR_IMAGE_ROOTFS_task-image-ostree = "${OSTREE_ROOTFS}" | 22 | TAR_IMAGE_ROOTFS_task-image-ostree = "${OSTREE_ROOTFS}" |
| 23 | |||
| 24 | python prepare_ostree_rootfs() { | ||
| 25 | import oe.path | ||
| 26 | import shutil | ||
| 27 | |||
| 28 | ostree_rootfs = d.getVar("OSTREE_ROOTFS") | ||
| 29 | if os.path.lexists(ostree_rootfs): | ||
| 30 | bb.utils.remove(ostree_rootfs, True) | ||
| 31 | |||
| 32 | # Copy required as we change permissions on some files. | ||
| 33 | image_rootfs = d.getVar("IMAGE_ROOTFS") | ||
| 34 | oe.path.copyhardlinktree(image_rootfs, ostree_rootfs) | ||
| 35 | } | ||
| 36 | |||
| 23 | do_image_ostree[dirs] = "${OSTREE_ROOTFS}" | 37 | do_image_ostree[dirs] = "${OSTREE_ROOTFS}" |
| 24 | do_image_ostree[cleandirs] = "${OSTREE_ROOTFS}" | 38 | do_image_ostree[prefuncs] += "prepare_ostree_rootfs" |
| 25 | do_image_ostree[depends] = "coreutils-native:do_populate_sysroot virtual/kernel:do_deploy ${INITRAMFS_IMAGE}:do_image_complete" | 39 | do_image_ostree[depends] = "coreutils-native:do_populate_sysroot virtual/kernel:do_deploy ${INITRAMFS_IMAGE}:do_image_complete" |
| 26 | IMAGE_CMD_ostree () { | 40 | IMAGE_CMD_ostree () { |
| 27 | cp -a ${IMAGE_ROOTFS}/* ${OSTREE_ROOTFS} | ||
| 28 | chmod a+rx ${OSTREE_ROOTFS} | ||
| 29 | sync | ||
| 30 | |||
| 31 | for d in var/*; do | 41 | for d in var/*; do |
| 32 | if [ "${d}" != "var/local" ]; then | 42 | if [ "${d}" != "var/local" ]; then |
| 33 | rm -rf ${d} | 43 | rm -rf ${d} |
| @@ -38,9 +48,6 @@ IMAGE_CMD_ostree () { | |||
| 38 | mkdir sysroot | 48 | mkdir sysroot |
| 39 | ln -sf sysroot/ostree ostree | 49 | ln -sf sysroot/ostree ostree |
| 40 | 50 | ||
| 41 | rm -rf tmp/* | ||
| 42 | ln -sf sysroot/tmp tmp | ||
| 43 | |||
| 44 | mkdir -p usr/rootdirs | 51 | mkdir -p usr/rootdirs |
| 45 | 52 | ||
| 46 | mv etc usr/ | 53 | mv etc usr/ |
| @@ -49,13 +56,11 @@ IMAGE_CMD_ostree () { | |||
| 49 | mkdir -p usr/etc/tmpfiles.d | 56 | mkdir -p usr/etc/tmpfiles.d |
| 50 | tmpfiles_conf=usr/etc/tmpfiles.d/00ostree-tmpfiles.conf | 57 | tmpfiles_conf=usr/etc/tmpfiles.d/00ostree-tmpfiles.conf |
| 51 | echo "d /var/rootdirs 0755 root root -" >>${tmpfiles_conf} | 58 | echo "d /var/rootdirs 0755 root root -" >>${tmpfiles_conf} |
| 52 | echo "L /var/rootdirs/home - - - - /sysroot/home" >>${tmpfiles_conf} | ||
| 53 | else | 59 | else |
| 54 | mkdir -p usr/etc/init.d | 60 | mkdir -p usr/etc/init.d |
| 55 | tmpfiles_conf=usr/etc/init.d/tmpfiles.sh | 61 | tmpfiles_conf=usr/etc/init.d/tmpfiles.sh |
| 56 | echo '#!/bin/sh' > ${tmpfiles_conf} | 62 | echo '#!/bin/sh' > ${tmpfiles_conf} |
| 57 | echo "mkdir -p /var/rootdirs; chmod 755 /var/rootdirs" >> ${tmpfiles_conf} | 63 | echo "mkdir -p /var/rootdirs; chmod 755 /var/rootdirs" >> ${tmpfiles_conf} |
| 58 | echo "ln -sf /sysroot/home /var/rootdirs/home" >> ${tmpfiles_conf} | ||
| 59 | 64 | ||
| 60 | ln -s ../init.d/tmpfiles.sh usr/etc/rcS.d/S20tmpfiles.sh | 65 | ln -s ../init.d/tmpfiles.sh usr/etc/rcS.d/S20tmpfiles.sh |
| 61 | fi | 66 | fi |
| @@ -64,13 +69,11 @@ IMAGE_CMD_ostree () { | |||
| 64 | mkdir -p usr/share/sota/ | 69 | mkdir -p usr/share/sota/ |
| 65 | echo -n "${OSTREE_BRANCHNAME}" > usr/share/sota/branchname | 70 | echo -n "${OSTREE_BRANCHNAME}" > usr/share/sota/branchname |
| 66 | 71 | ||
| 67 | # Preserve data in /home to be later copied to /sysroot/home by sysroot | 72 | # home directories get copied from the OE root later to the final sysroot |
| 68 | # generating procedure | 73 | # Create a symlink to var/rootdirs/home to make sure the OSTree deployment |
| 69 | mkdir -p usr/homedirs | 74 | # redirects /home to /var/rootdirs/home. |
| 70 | if [ -d "home" ] && [ ! -L "home" ]; then | 75 | rm -rf home/ |
| 71 | mv home usr/homedirs/home | 76 | ln -sf var/rootdirs/home home |
| 72 | ln -sf var/rootdirs/home home | ||
| 73 | fi | ||
| 74 | 77 | ||
| 75 | # Move persistent directories to /var | 78 | # Move persistent directories to /var |
| 76 | dirs="opt mnt media srv" | 79 | dirs="opt mnt media srv" |
| @@ -138,7 +141,7 @@ IMAGE_CMD_ostree () { | |||
| 138 | checksum=$(sha256sum ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} | cut -f 1 -d " ") | 141 | checksum=$(sha256sum ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} | cut -f 1 -d " ") |
| 139 | touch boot/initramfs-${checksum} | 142 | touch boot/initramfs-${checksum} |
| 140 | else | 143 | else |
| 141 | if [ "${OSTREE_DEPLOY_DEVICETREE}" = "1" ] && [ -n "${KERNEL_DEVICETREE}" ]; then | 144 | if [ ${@ oe.types.boolean('${OSTREE_DEPLOY_DEVICETREE}')} = True ] && [ -n "${KERNEL_DEVICETREE}" ]; then |
| 142 | checksum=$(cat ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES} ${KERNEL_DEVICETREE} | sha256sum | cut -f 1 -d " ") | 145 | checksum=$(cat ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES} ${KERNEL_DEVICETREE} | sha256sum | cut -f 1 -d " ") |
| 143 | for DTS_FILE in ${KERNEL_DEVICETREE}; do | 146 | for DTS_FILE in ${KERNEL_DEVICETREE}; do |
| 144 | DTS_FILE_BASENAME=$(basename ${DTS_FILE}) | 147 | DTS_FILE_BASENAME=$(basename ${DTS_FILE}) |
| @@ -165,25 +168,20 @@ IMAGE_CMD_ostreecommit () { | |||
| 165 | fi | 168 | fi |
| 166 | 169 | ||
| 167 | # Commit the result | 170 | # Commit the result |
| 168 | ostree --repo=${OSTREE_REPO} commit \ | 171 | ostree_target_hash=$(ostree --repo=${OSTREE_REPO} commit \ |
| 169 | --tree=dir=${OSTREE_ROOTFS} \ | 172 | --tree=dir=${OSTREE_ROOTFS} \ |
| 170 | --skip-if-unchanged \ | 173 | --skip-if-unchanged \ |
| 171 | --branch=${OSTREE_BRANCHNAME} \ | 174 | --branch=${OSTREE_BRANCHNAME} \ |
| 172 | --subject="${OSTREE_COMMIT_SUBJECT}" \ | 175 | --subject="${OSTREE_COMMIT_SUBJECT}" \ |
| 173 | --body="${OSTREE_COMMIT_BODY}" \ | 176 | --body="${OSTREE_COMMIT_BODY}" \ |
| 174 | --add-metadata-string=version="${OSTREE_COMMIT_VERSION}" \ | 177 | --add-metadata-string=version="${OSTREE_COMMIT_VERSION}" \ |
| 175 | --bind-ref="${OSTREE_BRANCHNAME}-${IMAGE_BASENAME}" | 178 | ${EXTRA_OSTREE_COMMIT}) |
| 176 | 179 | ||
| 177 | if [ "${OSTREE_UPDATE_SUMMARY}" = "1" ]; then | 180 | echo $ostree_target_hash > ${WORKDIR}/ostree_manifest |
| 181 | |||
| 182 | if [ ${@ oe.types.boolean('${OSTREE_UPDATE_SUMMARY}')} = True ]; then | ||
| 178 | ostree --repo=${OSTREE_REPO} summary -u | 183 | ostree --repo=${OSTREE_REPO} summary -u |
| 179 | fi | 184 | fi |
| 180 | |||
| 181 | # To enable simultaneous bitbaking of two images with the same branch name, | ||
| 182 | # create a new ref in the repo using the basename of the image. (This first | ||
| 183 | # requires deleting it if it already exists.) Fixes OTA-2211. | ||
| 184 | ostree --repo=${OSTREE_REPO} refs --delete ${OSTREE_BRANCHNAME}-${IMAGE_BASENAME} | ||
| 185 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) | ||
| 186 | ostree --repo=${OSTREE_REPO} refs --create=${OSTREE_BRANCHNAME}-${IMAGE_BASENAME} ${ostree_target_hash} | ||
| 187 | } | 185 | } |
| 188 | 186 | ||
| 189 | IMAGE_TYPEDEP_ostreepush = "ostreecommit" | 187 | IMAGE_TYPEDEP_ostreepush = "ostreecommit" |
| @@ -198,7 +196,7 @@ IMAGE_CMD_ostreepush () { | |||
| 198 | 196 | ||
| 199 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then | 197 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then |
| 200 | if [ -e ${SOTA_PACKED_CREDENTIALS} ]; then | 198 | if [ -e ${SOTA_PACKED_CREDENTIALS} ]; then |
| 201 | garage-push -vv --repo=${OSTREE_REPO} \ | 199 | garage-push --loglevel 0 --repo=${OSTREE_REPO} \ |
| 202 | --ref=${OSTREE_BRANCHNAME} \ | 200 | --ref=${OSTREE_BRANCHNAME} \ |
| 203 | --credentials=${SOTA_PACKED_CREDENTIALS} \ | 201 | --credentials=${SOTA_PACKED_CREDENTIALS} \ |
| 204 | --cacert=${STAGING_ETCDIR_NATIVE}/ssl/certs/ca-certificates.crt \ | 202 | --cacert=${STAGING_ETCDIR_NATIVE}/ssl/certs/ca-certificates.crt \ |
| @@ -233,7 +231,7 @@ IMAGE_CMD_garagesign () { | |||
| 233 | --home-dir ${GARAGE_SIGN_REPO} \ | 231 | --home-dir ${GARAGE_SIGN_REPO} \ |
| 234 | --credentials ${SOTA_PACKED_CREDENTIALS} | 232 | --credentials ${SOTA_PACKED_CREDENTIALS} |
| 235 | 233 | ||
| 236 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}-${IMAGE_BASENAME}) | 234 | ostree_target_hash=$(cat ${WORKDIR}/ostree_manifest) |
| 237 | 235 | ||
| 238 | # Use OSTree target hash as version if none was provided by the user | 236 | # Use OSTree target hash as version if none was provided by the user |
| 239 | target_version=${ostree_target_hash} | 237 | target_version=${ostree_target_hash} |
| @@ -309,7 +307,7 @@ IMAGE_CMD_garagecheck () { | |||
| 309 | # if credentials are issued by a server that doesn't support offline signing, exit silently | 307 | # if credentials are issued by a server that doesn't support offline signing, exit silently |
| 310 | unzip -p ${SOTA_PACKED_CREDENTIALS} root.json targets.pub targets.sec tufrepo.url 2>&1 >/dev/null || exit 0 | 308 | unzip -p ${SOTA_PACKED_CREDENTIALS} root.json targets.pub targets.sec tufrepo.url 2>&1 >/dev/null || exit 0 |
| 311 | 309 | ||
| 312 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}-${IMAGE_BASENAME}) | 310 | ostree_target_hash=$(cat ${WORKDIR}/ostree_manifest) |
| 313 | 311 | ||
| 314 | garage-check --ref=${ostree_target_hash} \ | 312 | garage-check --ref=${ostree_target_hash} \ |
| 315 | --credentials=${SOTA_PACKED_CREDENTIALS} \ | 313 | --credentials=${SOTA_PACKED_CREDENTIALS} \ |
diff --git a/classes/image_types_ota.bbclass b/classes/image_types_ota.bbclass index 2cc8913..a8a19b5 100644 --- a/classes/image_types_ota.bbclass +++ b/classes/image_types_ota.bbclass | |||
| @@ -45,14 +45,17 @@ do_image_ota[cleandirs] = "${OTA_SYSROOT}" | |||
| 45 | do_image_ota[depends] = "${@'grub:do_populate_sysroot' if d.getVar('OSTREE_BOOTLOADER') == 'grub' else ''} \ | 45 | do_image_ota[depends] = "${@'grub:do_populate_sysroot' if d.getVar('OSTREE_BOOTLOADER') == 'grub' else ''} \ |
| 46 | ${@'virtual/bootloader:do_deploy' if d.getVar('OSTREE_BOOTLOADER') == 'u-boot' else ''}" | 46 | ${@'virtual/bootloader:do_deploy' if d.getVar('OSTREE_BOOTLOADER') == 'u-boot' else ''}" |
| 47 | IMAGE_CMD_ota () { | 47 | IMAGE_CMD_ota () { |
| 48 | export OSTREE_BOOT_PARTITION=${OSTREE_BOOT_PARTITION} | 48 | ostree admin --sysroot=${OTA_SYSROOT} init-fs --modern ${OTA_SYSROOT} |
| 49 | |||
| 50 | ostree admin --sysroot=${OTA_SYSROOT} init-fs ${OTA_SYSROOT} | ||
| 51 | ostree admin --sysroot=${OTA_SYSROOT} os-init ${OSTREE_OSNAME} | 49 | ostree admin --sysroot=${OTA_SYSROOT} os-init ${OSTREE_OSNAME} |
| 50 | |||
| 51 | # Preparation required to steer ostree bootloader detection | ||
| 52 | mkdir -p ${OTA_SYSROOT}/boot/loader.0 | 52 | mkdir -p ${OTA_SYSROOT}/boot/loader.0 |
| 53 | ln -s loader.0 ${OTA_SYSROOT}/boot/loader | 53 | ln -s loader.0 ${OTA_SYSROOT}/boot/loader |
| 54 | 54 | ||
| 55 | if [ "${OSTREE_BOOTLOADER}" = "grub" ]; then | 55 | if [ "${OSTREE_BOOTLOADER}" = "grub" ]; then |
| 56 | # Used by ostree-grub-generator called by the ostree binary | ||
| 57 | export OSTREE_BOOT_PARTITION=${OSTREE_BOOT_PARTITION} | ||
| 58 | |||
| 56 | mkdir -p ${OTA_SYSROOT}/boot/grub2 | 59 | mkdir -p ${OTA_SYSROOT}/boot/grub2 |
| 57 | ln -s ../loader/grub.cfg ${OTA_SYSROOT}/boot/grub2/grub.cfg | 60 | ln -s ../loader/grub.cfg ${OTA_SYSROOT}/boot/grub2/grub.cfg |
| 58 | elif [ "${OSTREE_BOOTLOADER}" = "u-boot" ]; then | 61 | elif [ "${OSTREE_BOOTLOADER}" = "u-boot" ]; then |
| @@ -61,15 +64,25 @@ IMAGE_CMD_ota () { | |||
| 61 | bbfatal "Invalid bootloader: ${OSTREE_BOOTLOADER}" | 64 | bbfatal "Invalid bootloader: ${OSTREE_BOOTLOADER}" |
| 62 | fi | 65 | fi |
| 63 | 66 | ||
| 64 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}-${IMAGE_BASENAME}) | 67 | ostree_target_hash=$(cat ${WORKDIR}/ostree_manifest) |
| 65 | 68 | ||
| 69 | # Use OSTree hash to avoid any potential race conditions between | ||
| 70 | # multiple builds accessing the same ${OSTREE_REPO}. | ||
| 66 | ostree --repo=${OTA_SYSROOT}/ostree/repo pull-local --remote=${OSTREE_OSNAME} ${OSTREE_REPO} ${ostree_target_hash} | 71 | ostree --repo=${OTA_SYSROOT}/ostree/repo pull-local --remote=${OSTREE_OSNAME} ${OSTREE_REPO} ${ostree_target_hash} |
| 67 | kargs_list="" | 72 | kargs_list="" |
| 68 | for arg in ${OSTREE_KERNEL_ARGS}; do | 73 | for arg in ${OSTREE_KERNEL_ARGS}; do |
| 69 | kargs_list="${kargs_list} --karg-append=$arg" | 74 | kargs_list="${kargs_list} --karg-append=$arg" |
| 70 | done | 75 | done |
| 71 | 76 | ||
| 72 | ostree admin --sysroot=${OTA_SYSROOT} deploy ${kargs_list} --os=${OSTREE_OSNAME} ${ostree_target_hash} | 77 | # Create the same reference on the device we use in the archive OSTree |
| 78 | # repo in ${OSTREE_REPO}. This reference will show up when showing the | ||
| 79 | # deployment on the device: | ||
| 80 | # ostree admin status | ||
| 81 | # If a remote with the name ${OSTREE_OSNAME} is configured, this also | ||
| 82 | # will allow to use: | ||
| 83 | # ostree admin upgrade | ||
| 84 | ostree --repo=${OTA_SYSROOT}/ostree/repo refs --create=${OSTREE_OSNAME}:${OSTREE_BRANCHNAME} ${ostree_target_hash} | ||
| 85 | ostree admin --sysroot=${OTA_SYSROOT} deploy ${kargs_list} --os=${OSTREE_OSNAME} ${OSTREE_OSNAME}:${OSTREE_BRANCHNAME} | ||
| 73 | 86 | ||
| 74 | cp -a ${IMAGE_ROOTFS}/var/sota ${OTA_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/ || true | 87 | cp -a ${IMAGE_ROOTFS}/var/sota ${OTA_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/ || true |
| 75 | # Create /var/sota if it doesn't exist yet | 88 | # Create /var/sota if it doesn't exist yet |
| @@ -77,8 +90,11 @@ IMAGE_CMD_ota () { | |||
| 77 | # Ensure the permissions are correctly set | 90 | # Ensure the permissions are correctly set |
| 78 | chmod 700 ${OTA_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota | 91 | chmod 700 ${OTA_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota |
| 79 | 92 | ||
| 80 | cp -a ${OSTREE_ROOTFS}/var/local ${OTA_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/ || true | 93 | cp -a ${IMAGE_ROOTFS}/var/local ${OTA_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/ || true |
| 81 | cp -a ${OSTREE_ROOTFS}/usr/homedirs/home ${OTA_SYSROOT}/ || true | 94 | |
| 95 | mkdir -p ${OTA_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/rootdirs | ||
| 96 | cp -a ${IMAGE_ROOTFS}/home ${OTA_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/rootdirs/home || true | ||
| 97 | |||
| 82 | # Ensure that /var/local exists (AGL symlinks /usr/local to /var/local) | 98 | # Ensure that /var/local exists (AGL symlinks /usr/local to /var/local) |
| 83 | install -d ${OTA_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/local | 99 | install -d ${OTA_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/local |
| 84 | # Set package version for the first deployment | 100 | # Set package version for the first deployment |
diff --git a/classes/sota_sanity.bbclass b/classes/sota_sanity.bbclass index 74973eb..02ca2e7 100644 --- a/classes/sota_sanity.bbclass +++ b/classes/sota_sanity.bbclass | |||
| @@ -1,5 +1,12 @@ | |||
| 1 | # Sanity check the sota setup for common misconfigurations | 1 | # Sanity check the sota setup for common misconfigurations |
| 2 | 2 | ||
| 3 | def sota_check_boolean_variable(var, d): | ||
| 4 | try: | ||
| 5 | oe.types.boolean(d.getVar(var)) | ||
| 6 | except: | ||
| 7 | return False | ||
| 8 | return True | ||
| 9 | |||
| 3 | def sota_check_overrides(status, d): | 10 | def sota_check_overrides(status, d): |
| 4 | for var in (d.getVar('SOTA_OVERRIDES_BLACKLIST') or "").split(): | 11 | for var in (d.getVar('SOTA_OVERRIDES_BLACKLIST') or "").split(): |
| 5 | if var in d.getVar('OVERRIDES').split(':'): | 12 | if var in d.getVar('OVERRIDES').split(':'): |
| @@ -47,14 +54,14 @@ def sota_check_variables_validity(status, d): | |||
| 47 | path = os.path.abspath(credentials) | 54 | path = os.path.abspath(credentials) |
| 48 | if not os.path.exists(path): | 55 | if not os.path.exists(path): |
| 49 | status.addresult("SOTA_PACKED_CREDENTIALS is not set correctly. The zipped credentials file does not exist.\n") | 56 | status.addresult("SOTA_PACKED_CREDENTIALS is not set correctly. The zipped credentials file does not exist.\n") |
| 50 | if d.getVar("OSTREE_UPDATE_SUMMARY") and d.getVar("OSTREE_UPDATE_SUMMARY") not in ("0", "1", ""): | 57 | if not sota_check_boolean_variable("OSTREE_UPDATE_SUMMARY", d): |
| 51 | status.addresult("OSTREE_UPDATE_SUMMARY should be set to 0 or 1.\n") | 58 | status.addresult("OSTREE_UPDATE_SUMMARY (=%s) should be set to yes/y/true/t/1 or no/n/false/f/0.\n" % d.getVar("OSTREE_UPDATE_SUMMARY")) |
| 52 | if d.getVar("OSTREE_DEPLOY_DEVICETREE") and d.getVar("OSTREE_DEPLOY_DEVICETREE") not in ("0", "1", ""): | 59 | if not sota_check_boolean_variable("OSTREE_DEPLOY_DEVICETREE", d): |
| 53 | status.addresult("OSTREE_DEPLOY_DEVICETREE should be set to 0 or 1.\n") | 60 | status.addresult("OSTREE_DEPLOY_DEVICETREE (=%s) should be set to yes/y/true/t/1 or no/n/false/f/0.\n" % d.getVar("OSTREE_DEPLOY_DEVICETREE")) |
| 54 | if d.getVar("GARAGE_SIGN_AUTOVERSION") and d.getVar("GARAGE_SIGN_AUTOVERSION") not in ("0", "1", ""): | 61 | if not sota_check_boolean_variable("GARAGE_SIGN_AUTOVERSION", d): |
| 55 | status.addresult("GARAGE_SIGN_AUTOVERSION should be set to 0 or 1.\n") | 62 | status.addresult("GARAGE_SIGN_AUTOVERSION (=%s) should be set to yes/y/true/t/1 or no/n/false/f/0.\n" % d.getVar("GARAGE_SIGN_AUTOVERSION")) |
| 56 | if d.getVar("SOTA_DEPLOY_CREDENTIALS") and d.getVar("SOTA_DEPLOY_CREDENTIALS") not in ("0", "1", ""): | 63 | if not sota_check_boolean_variable("SOTA_DEPLOY_CREDENTIALS", d): |
| 57 | status.addresult("SOTA_DEPLOY_CREDENTIALS should be set to 0 or 1.\n") | 64 | status.addresult("SOTA_DEPLOY_CREDENTIALS (=%s) should be set to yes/y/true/t/1 or no/n/false/f/0.\n" % d.getVar("SOTA_DEPLOY_CREDENTIALS")) |
| 58 | 65 | ||
| 59 | def sota_raise_sanity_error(msg, d): | 66 | def sota_raise_sanity_error(msg, d): |
| 60 | if d.getVar("SANITY_USE_EVENTS") == "1": | 67 | if d.getVar("SANITY_USE_EVENTS") == "1": |
diff --git a/recipes-core/images/initramfs-ostree-image.bb b/recipes-core/images/initramfs-ostree-image.bb index 936c59a..bc21ed3 100644 --- a/recipes-core/images/initramfs-ostree-image.bb +++ b/recipes-core/images/initramfs-ostree-image.bb | |||
| @@ -13,7 +13,7 @@ IMAGE_LINGUAS = "" | |||
| 13 | 13 | ||
| 14 | LICENSE = "MIT" | 14 | LICENSE = "MIT" |
| 15 | 15 | ||
| 16 | IMAGE_CLASSES_remove = "image_repo_manifest" | 16 | IMAGE_CLASSES_remove = "image_repo_manifest qemuboot" |
| 17 | 17 | ||
| 18 | IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" | 18 | IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" |
| 19 | 19 | ||
diff --git a/recipes-extended/collectd/collectd_%.bbappend b/recipes-extended/collectd/collectd_%.bbappend new file mode 100644 index 0000000..fb3e6c4 --- /dev/null +++ b/recipes-extended/collectd/collectd_%.bbappend | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | do_install_append() { | ||
| 2 | printf "<Include \"${sysconfdir}/collectd.conf.d\">\nFilter \"*.conf\"\n</Include>\n" >> ${D}/${sysconfdir}/collectd.conf | ||
| 3 | |||
| 4 | install -d ${D}/${sysconfdir}/collectd.conf.d | ||
| 5 | } | ||
diff --git a/recipes-sota/aktualizr/aktualizr-collectd.bb b/recipes-sota/aktualizr/aktualizr-collectd.bb new file mode 100644 index 0000000..c1fc717 --- /dev/null +++ b/recipes-sota/aktualizr/aktualizr-collectd.bb | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | SUMMARY = "Aktualizr metric collection" | ||
| 2 | HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" | ||
| 3 | SECTION = "base" | ||
| 4 | LICENSE = "MPL-2.0" | ||
| 5 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad" | ||
| 6 | |||
| 7 | RDEPENDS_${PN} = "collectd" | ||
| 8 | |||
| 9 | SRC_URI = " file://aktualizr-collectd.conf" | ||
| 10 | |||
| 11 | S = "${WORKDIR}" | ||
| 12 | |||
| 13 | do_install() { | ||
| 14 | install -d ${D}${sysconfdir}/collectd.conf.d | ||
| 15 | install -m 0644 ${WORKDIR}/aktualizr-collectd.conf ${D}${sysconfdir}/collectd.conf.d/aktualizr.conf | ||
| 16 | } | ||
| 17 | |||
| 18 | FILES_${PN} = " \ | ||
| 19 | ${sysconfdir}/collectd.conf.d \ | ||
| 20 | ${sysconfdir}/collectd.conf.d/aktualizr.conf \ | ||
| 21 | " | ||
diff --git a/recipes-sota/aktualizr/aktualizr-shared-prov.bb b/recipes-sota/aktualizr/aktualizr-shared-prov.bb index 2ee47a1..0f712df 100644 --- a/recipes-sota/aktualizr/aktualizr-shared-prov.bb +++ b/recipes-sota/aktualizr/aktualizr-shared-prov.bb | |||
| @@ -10,7 +10,7 @@ inherit allarch | |||
| 10 | # We need to get the config files from the aktualizr-host-tools package built by | 10 | # We need to get the config files from the aktualizr-host-tools package built by |
| 11 | # the aktualizr (target) recipe. | 11 | # the aktualizr (target) recipe. |
| 12 | DEPENDS = "aktualizr" | 12 | DEPENDS = "aktualizr" |
| 13 | RDEPENDS_${PN}_append = "${@' aktualizr-shared-prov-creds' if d.getVar('SOTA_DEPLOY_CREDENTIALS') == '1' else ''}" | 13 | RDEPENDS_${PN}_append = "${@' aktualizr-shared-prov-creds' if oe.types.boolean(d.getVar('SOTA_DEPLOY_CREDENTIALS')) else ''}" |
| 14 | 14 | ||
| 15 | # If the config file from aktualizr used here is changed, you will need to bump | 15 | # If the config file from aktualizr used here is changed, you will need to bump |
| 16 | # the version here because of SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS! | 16 | # the version here because of SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS! |
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb index a46eab0..56a6389 100644 --- a/recipes-sota/aktualizr/aktualizr_git.bb +++ b/recipes-sota/aktualizr/aktualizr_git.bb | |||
| @@ -17,7 +17,7 @@ PRIVATE_LIBS_${PN}-ptest = "libaktualizr.so libaktualizr_secondary.so" | |||
| 17 | PV = "1.0+git${SRCPV}" | 17 | PV = "1.0+git${SRCPV}" |
| 18 | PR = "7" | 18 | PR = "7" |
| 19 | 19 | ||
| 20 | GARAGE_SIGN_PV = "0.7.1" | 20 | GARAGE_SIGN_PV = "0.7.1-4-gf10c1da" |
| 21 | 21 | ||
| 22 | SRC_URI = " \ | 22 | SRC_URI = " \ |
| 23 | gitsm://github.com/advancedtelematic/aktualizr;branch=${BRANCH};name=aktualizr \ | 23 | gitsm://github.com/advancedtelematic/aktualizr;branch=${BRANCH};name=aktualizr \ |
| @@ -26,13 +26,13 @@ SRC_URI = " \ | |||
| 26 | file://aktualizr-secondary.service \ | 26 | file://aktualizr-secondary.service \ |
| 27 | file://aktualizr-serialcan.service \ | 27 | file://aktualizr-serialcan.service \ |
| 28 | file://10-resource-control.conf \ | 28 | file://10-resource-control.conf \ |
| 29 | ${@ d.expand("https://tuf-cli-releases.ota.here.com/cli-${GARAGE_SIGN_PV}.tgz;unpack=0;name=garagesign") if d.getVar('GARAGE_SIGN_AUTOVERSION') != '1' else ''} \ | 29 | ${@ d.expand("https://tuf-cli-releases.ota.here.com/cli-${GARAGE_SIGN_PV}.tgz;unpack=0;name=garagesign") if not oe.types.boolean(d.getVar('GARAGE_SIGN_AUTOVERSION')) else ''} \ |
| 30 | " | 30 | " |
| 31 | 31 | ||
| 32 | SRC_URI[garagesign.md5sum] = "febc186527b324b23c5be3affcf90e54" | 32 | SRC_URI[garagesign.md5sum] = "5f8eea81d1559d6fcb28d49c4298727c" |
| 33 | SRC_URI[garagesign.sha256sum] = "a87c3f39d61492d6f813754159ed7ef1e59966c15726edef4cd188a63cde60d6" | 33 | SRC_URI[garagesign.sha256sum] = "8b2f5bb164f19b41972069d3377e39c2eb9edffd471777161691039e12a71738" |
| 34 | 34 | ||
| 35 | SRCREV = "a6392dec3fb9dda3cb8ab8aa10a81b2c0494cb3c" | 35 | SRCREV = "cf44da79555d1897115eb350cbc43db1e213db03" |
| 36 | BRANCH ?= "master" | 36 | BRANCH ?= "master" |
| 37 | 37 | ||
| 38 | S = "${WORKDIR}/git" | 38 | S = "${WORKDIR}/git" |
| @@ -49,7 +49,7 @@ SYSTEMD_SERVICE_${PN}-secondary = "aktualizr-secondary.service" | |||
| 49 | 49 | ||
| 50 | EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release ${@bb.utils.contains('PTEST_ENABLED', '1', '-DTESTSUITE_VALGRIND=on', '', d)}" | 50 | EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release ${@bb.utils.contains('PTEST_ENABLED', '1', '-DTESTSUITE_VALGRIND=on', '', d)}" |
| 51 | 51 | ||
| 52 | GARAGE_SIGN_OPS = "${@ d.expand('-DGARAGE_SIGN_ARCHIVE=${WORKDIR}/cli-${GARAGE_SIGN_PV}.tgz') if d.getVar('GARAGE_SIGN_AUTOVERSION') != '1' else ''}" | 52 | GARAGE_SIGN_OPS = "${@ d.expand('-DGARAGE_SIGN_ARCHIVE=${WORKDIR}/cli-${GARAGE_SIGN_PV}.tgz') if not oe.types.boolean(d.getVar('GARAGE_SIGN_AUTOVERSION')) else ''}" |
| 53 | PKCS11_ENGINE_PATH = "${libdir}/engines-1.1/pkcs11.so" | 53 | PKCS11_ENGINE_PATH = "${libdir}/engines-1.1/pkcs11.so" |
| 54 | 54 | ||
| 55 | PACKAGECONFIG ?= "ostree ${@bb.utils.filter('SOTA_CLIENT_FEATURES', 'hsm serialcan ubootenv', d)}" | 55 | PACKAGECONFIG ?= "ostree ${@bb.utils.filter('SOTA_CLIENT_FEATURES', 'hsm serialcan ubootenv', d)}" |
diff --git a/recipes-sota/aktualizr/files/aktualizr-collectd.conf b/recipes-sota/aktualizr/files/aktualizr-collectd.conf new file mode 100644 index 0000000..35a1f61 --- /dev/null +++ b/recipes-sota/aktualizr/files/aktualizr-collectd.conf | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | <LoadPlugin processes> | ||
| 2 | Interval 1 | ||
| 3 | </LoadPlugin> | ||
| 4 | <Plugin processes> | ||
| 5 | CollectFileDescriptor true | ||
| 6 | CollectContextSwitch true | ||
| 7 | CollectMemoryMaps true | ||
| 8 | Process "aktualizr" | ||
| 9 | </Plugin> | ||
