summaryrefslogtreecommitdiffstats
path: root/external/meta-updater/classes
diff options
context:
space:
mode:
Diffstat (limited to 'external/meta-updater/classes')
-rw-r--r--external/meta-updater/classes/image_repo_manifest.bbclass2
-rw-r--r--external/meta-updater/classes/image_types_ostree.bbclass92
-rw-r--r--external/meta-updater/classes/image_types_ota.bbclass3
-rw-r--r--external/meta-updater/classes/sota.bbclass33
-rw-r--r--external/meta-updater/classes/sota_bleeding.inc1
-rw-r--r--external/meta-updater/classes/sota_m3ulcb.bbclass7
-rw-r--r--external/meta-updater/classes/sota_raspberrypi.bbclass34
-rw-r--r--external/meta-updater/classes/sota_sanity.bbclass47
-rw-r--r--external/meta-updater/classes/target_version_example.bbclass2
9 files changed, 168 insertions, 53 deletions
diff --git a/external/meta-updater/classes/image_repo_manifest.bbclass b/external/meta-updater/classes/image_repo_manifest.bbclass
index c2e7056d..72dc28fe 100644
--- a/external/meta-updater/classes/image_repo_manifest.bbclass
+++ b/external/meta-updater/classes/image_repo_manifest.bbclass
@@ -9,8 +9,6 @@
# For more information, see:
# https://web.archive.org/web/20161224194009/https://wiki.cyanogenmod.org/w/Doc:_Using_manifests
-HOSTTOOLS_NONFATAL += " repo "
-
# Write build information to target filesystem
buildinfo_manifest () {
if [ $(which repo) ]; then
diff --git a/external/meta-updater/classes/image_types_ostree.bbclass b/external/meta-updater/classes/image_types_ostree.bbclass
index 56d4d76c..533d338b 100644
--- a/external/meta-updater/classes/image_types_ostree.bbclass
+++ b/external/meta-updater/classes/image_types_ostree.bbclass
@@ -5,6 +5,7 @@ OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}"
OSTREE_ROOTFS ??= "${WORKDIR}/ostree-rootfs"
OSTREE_COMMIT_SUBJECT ??= "Commit-id: ${IMAGE_NAME}"
OSTREE_COMMIT_BODY ??= ""
+OSTREE_COMMIT_VERSION ??= "${DISTRO_VERSION}"
OSTREE_UPDATE_SUMMARY ??= "0"
OSTREE_DEPLOY_DEVICETREE ??= "0"
@@ -13,11 +14,11 @@ BUILD_OSTREE_TARBALL ??= "1"
SYSTEMD_USED = "${@oe.utils.ifelse(d.getVar('VIRTUAL-RUNTIME_init_manager') == 'systemd', 'true', '')}"
IMAGE_CMD_TAR = "tar --xattrs --xattrs-include=*"
-CONVERSION_CMD_tar = "touch ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}; ${IMAGE_CMD_TAR} --numeric-owner -cf ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.tar -C ${OTA_IMAGE_ROOTFS} . || [ $? -eq 1 ]"
+CONVERSION_CMD_tar = "touch ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}; ${IMAGE_CMD_TAR} --numeric-owner -cf ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.tar -C ${TAR_IMAGE_ROOTFS} . || [ $? -eq 1 ]"
CONVERSIONTYPES_append = " tar"
REQUIRED_DISTRO_FEATURES = "usrmerge"
-OTA_IMAGE_ROOTFS_task-image-ostree = "${OSTREE_ROOTFS}"
+TAR_IMAGE_ROOTFS_task-image-ostree = "${OSTREE_ROOTFS}"
do_image_ostree[dirs] = "${OSTREE_ROOTFS}"
do_image_ostree[cleandirs] = "${OSTREE_ROOTFS}"
do_image_ostree[depends] = "coreutils-native:do_populate_sysroot virtual/kernel:do_deploy ${INITRAMFS_IMAGE}:do_image_complete"
@@ -78,15 +79,15 @@ IMAGE_CMD_ostree () {
if [ "$(ls -A $dir)" ]; then
bbwarn "Data in /$dir directory is not preserved by OSTree. Consider moving it under /usr"
fi
-
- if [ -n "${SYSTEMD_USED}" ]; then
- echo "d /var/rootdirs/${dir} 0755 root root -" >>${tmpfiles_conf}
- else
- echo "mkdir -p /var/rootdirs/${dir}; chown 755 /var/rootdirs/${dir}" >>${tmpfiles_conf}
- fi
rm -rf ${dir}
- ln -sf var/rootdirs/${dir} ${dir}
fi
+
+ if [ -n "${SYSTEMD_USED}" ]; then
+ echo "d /var/rootdirs/${dir} 0755 root root -" >>${tmpfiles_conf}
+ else
+ echo "mkdir -p /var/rootdirs/${dir}; chown 755 /var/rootdirs/${dir}" >>${tmpfiles_conf}
+ fi
+ ln -sf var/rootdirs/${dir} ${dir}
done
if [ -d root ] && [ ! -L root ]; then
@@ -95,15 +96,40 @@ IMAGE_CMD_ostree () {
fi
if [ -n "${SYSTEMD_USED}" ]; then
- echo "d /var/roothome 0755 root root -" >>${tmpfiles_conf}
+ echo "d /var/roothome 0700 root root -" >>${tmpfiles_conf}
else
- echo "mkdir -p /var/roothome; chown 755 /var/roothome" >>${tmpfiles_conf}
+ echo "mkdir -p /var/roothome; chown 700 /var/roothome" >>${tmpfiles_conf}
fi
rm -rf root
ln -sf var/roothome root
fi
+ if [ -d usr/local ] && [ ! -L usr/local ]; then
+ if [ "$(ls -A usr/local)" ]; then
+ bbfatal "Data in /usr/local directory is not preserved by OSTree."
+ fi
+ rm -rf usr/local
+ fi
+
+ if [ -n "${SYSTEMD_USED}" ]; then
+ echo "d /var/usrlocal 0755 root root -" >>${tmpfiles_conf}
+ else
+ echo "mkdir -p /var/usrlocal; chown 755 /var/usrlocal" >>${tmpfiles_conf}
+ fi
+
+ dirs="bin etc games include lib man sbin share src"
+
+ for dir in ${dirs}; do
+ if [ -n "${SYSTEMD_USED}" ]; then
+ echo "d /var/usrlocal/${dir} 0755 root root -" >>${tmpfiles_conf}
+ else
+ echo "mkdir -p /var/usrlocal/${dir}; chown 755 /var/usrlocal/${dir}" >>${tmpfiles_conf}
+ fi
+ done
+
+ ln -sf ../var/usrlocal usr/local
+
if [ "${KERNEL_IMAGETYPE}" = "fitImage" ]; then
# this is a hack for ostree not to override init= in kernel cmdline -
# make it think that the initramfs is present (while it is in FIT image)
@@ -143,7 +169,9 @@ IMAGE_CMD_ostreecommit () {
--skip-if-unchanged \
--branch=${OSTREE_BRANCHNAME} \
--subject="${OSTREE_COMMIT_SUBJECT}" \
- --body="${OSTREE_COMMIT_BODY}"
+ --body="${OSTREE_COMMIT_BODY}" \
+ --add-metadata-string=version="${OSTREE_COMMIT_VERSION}" \
+ --bind-ref="${OSTREE_BRANCHNAME}-${IMAGE_BASENAME}"
if [ "${OSTREE_UPDATE_SUMMARY}" = "1" ]; then
ostree --repo=${OSTREE_REPO} summary -u
@@ -160,13 +188,20 @@ IMAGE_CMD_ostreecommit () {
IMAGE_TYPEDEP_ostreepush = "ostreecommit"
do_image_ostreepush[depends] += "aktualizr-native:do_populate_sysroot ca-certificates-native:do_populate_sysroot"
IMAGE_CMD_ostreepush () {
- # Print warnings if credetials are not set or if the file has not been found.
+ # send a copy of the repo manifest to backend if available
+ local SEND_MANIFEST=""
+ # check if garage-push supports the --repo-manifest option before trying
+ if $(garage-push --help | grep -q '^\s*--repo-manifest') && [ -f ${IMAGE_ROOTFS}${sysconfdir}/manifest.xml ]; then
+ SEND_MANIFEST="--repo-manifest ${IMAGE_ROOTFS}${sysconfdir}/manifest.xml"
+ fi
+
if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then
if [ -e ${SOTA_PACKED_CREDENTIALS} ]; then
garage-push -vv --repo=${OSTREE_REPO} \
--ref=${OSTREE_BRANCHNAME} \
--credentials=${SOTA_PACKED_CREDENTIALS} \
- --cacert=${STAGING_ETCDIR_NATIVE}/ssl/certs/ca-certificates.crt
+ --cacert=${STAGING_ETCDIR_NATIVE}/ssl/certs/ca-certificates.crt \
+ $SEND_MANIFEST
else
bbwarn "SOTA_PACKED_CREDENTIALS file does not exist."
fi
@@ -203,19 +238,29 @@ IMAGE_CMD_garagesign () {
target_version=${ostree_target_hash}
if [ -n "${GARAGE_TARGET_VERSION}" ]; then
target_version=${GARAGE_TARGET_VERSION}
- bbwarn "Target version is overriden with GARAGE_TARGET_VERSION variable. It is a dangerous operation, make sure you've read the respective secion in meta-updater/README.adoc"
+ bbwarn "Target version is overriden with GARAGE_TARGET_VERSION variable. This is a dangerous operation! See https://docs.ota.here.com/ota-client/latest/build-configuration.html#_overriding_target_version"
elif [ -e "${STAGING_DATADIR_NATIVE}/target_version" ]; then
target_version=$(cat "${STAGING_DATADIR_NATIVE}/target_version")
- bbwarn "Target version is overriden with target_version file. It is a dangerous operation, make sure you've read the respective secion in meta-updater/README.adoc"
+ bbwarn "Target version is overriden with target_version file. This is a dangerous operation! See https://docs.ota.here.com/ota-client/latest/build-configuration.html#_overriding_target_version"
fi
# Push may fail due to race condition when multiple build machines try to push simultaneously
# in which case targets.json should be pulled again and the whole procedure repeated
push_success=0
- target_url=""
- if [ -n "${GARAGE_TARGET_URL}" ]; then
- target_url='--url ${GARAGE_TARGET_URL}'
- fi
+ target_url=""
+ if [ -n "${GARAGE_TARGET_URL}" ]; then
+ target_url="--url ${GARAGE_TARGET_URL}"
+ fi
+ target_expiry=""
+ if [ -n "${GARAGE_TARGET_EXPIRES}" ] && [ -n "${GARAGE_TARGET_EXPIRE_AFTER}" ]; then
+ bbfatal "Both GARAGE_TARGET_EXPIRES and GARAGE_TARGET_EXPIRE_AFTER are set. Only one can be set at a time."
+ elif [ -n "${GARAGE_TARGET_EXPIRES}" ]; then
+ target_expiry="--expires ${GARAGE_TARGET_EXPIRES}"
+ elif [ -n "${GARAGE_TARGET_EXPIRE_AFTER}" ]; then
+ target_expiry="--expire-after ${GARAGE_TARGET_EXPIRE_AFTER}"
+ else
+ target_expiry="--expire-after 1M"
+ fi
for push_retries in $( seq 3 ); do
garage-sign targets pull --repo tufrepo \
@@ -229,8 +274,15 @@ IMAGE_CMD_garagesign () {
${target_url} \
--sha256 ${ostree_target_hash} \
--hardwareids ${SOTA_HARDWARE_ID}
+ if [ -n "${GARAGE_CUSTOMIZE_TARGET}" ]; then
+ bbplain "Running command(${GARAGE_CUSTOMIZE_TARGET}) to customize target"
+ ${GARAGE_CUSTOMIZE_TARGET} \
+ ${GARAGE_SIGN_REPO}/tufrepo/roles/unsigned/targets.json \
+ ${GARAGE_TARGET_NAME}-${target_version}
+ fi
garage-sign targets sign --repo tufrepo \
--home-dir ${GARAGE_SIGN_REPO} \
+ ${target_expiry} \
--key-name=targets
errcode=0
garage-sign targets push --repo tufrepo \
diff --git a/external/meta-updater/classes/image_types_ota.bbclass b/external/meta-updater/classes/image_types_ota.bbclass
index 12375ec1..857161af 100644
--- a/external/meta-updater/classes/image_types_ota.bbclass
+++ b/external/meta-updater/classes/image_types_ota.bbclass
@@ -38,13 +38,14 @@ calculate_size () {
}
OTA_SYSROOT = "${WORKDIR}/ota-sysroot"
-OTA_IMAGE_ROOTFS_task-image-ota = "${OTA_SYSROOT}"
+TAR_IMAGE_ROOTFS_task-image-ota = "${OTA_SYSROOT}"
IMAGE_TYPEDEP_ota = "ostreecommit"
do_image_ota[dirs] = "${OTA_SYSROOT}"
do_image_ota[cleandirs] = "${OTA_SYSROOT}"
do_image_ota[depends] = "${@'grub:do_populate_sysroot' if d.getVar('OSTREE_BOOTLOADER') == 'grub' else ''} \
${@'virtual/bootloader:do_deploy' if d.getVar('OSTREE_BOOTLOADER') == 'u-boot' else ''}"
IMAGE_CMD_ota () {
+ export OSTREE_BOOT_PARTITION=${OSTREE_BOOT_PARTITION}
ostree admin --sysroot=${OTA_SYSROOT} init-fs ${OTA_SYSROOT}
ostree admin --sysroot=${OTA_SYSROOT} os-init ${OSTREE_OSNAME}
mkdir -p ${OTA_SYSROOT}/boot/loader.0
diff --git a/external/meta-updater/classes/sota.bbclass b/external/meta-updater/classes/sota.bbclass
index bf27b6dd..c248cfc0 100644
--- a/external/meta-updater/classes/sota.bbclass
+++ b/external/meta-updater/classes/sota.bbclass
@@ -1,28 +1,12 @@
DISTROOVERRIDES .= "${@bb.utils.contains('DISTRO_FEATURES', 'sota', ':sota', '', d)}"
-HOSTTOOLS_NONFATAL += "java"
-
SOTA_CLIENT ??= "aktualizr"
SOTA_CLIENT_PROV ??= "aktualizr-shared-prov"
SOTA_DEPLOY_CREDENTIALS ?= "1"
SOTA_HARDWARE_ID ??= "${MACHINE}"
-# Translate old provisioning recipe names into the new versions.
-python () {
- prov = d.getVar("SOTA_CLIENT_PROV")
- if prov == "aktualizr-auto-prov":
- bb.warn('aktualizr-auto-prov is deprecated. Please use aktualizr-shared-prov instead.')
- d.setVar("SOTA_CLIENT_PROV", "aktualizr-shared-prov")
- elif prov == "aktualizr-ca-implicit-prov":
- bb.warn('aktualizr-ca-implicit-prov is deprecated. Please use aktualizr-device-prov instead.')
- d.setVar("SOTA_CLIENT_PROV", "aktualizr-device-prov")
- elif prov == "aktualizr-hsm-prov":
- bb.warn('aktualizr-hsm-prov is deprecated. Please use aktualizr-device-prov-hsm instead.')
- d.setVar("SOTA_CLIENT_PROV", "aktualizr-device-prov-hsm")
-}
-
IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PROV}"
-IMAGE_CLASSES += " image_types_ostree image_types_ota"
+IMAGE_CLASSES += " image_types_ostree image_types_ota image_repo_manifest"
IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'ostreepush garagesign garagecheck ota-ext4 wic', ' ', d)}"
IMAGE_FSTYPES += "${@bb.utils.contains('BUILD_OSTREE_TARBALL', '1', 'ostree.tar.bz2', ' ', d)}"
@@ -38,11 +22,11 @@ EXTRA_IMAGEDEPENDS_append_sota = " parted-native mtools-native dosfstools-native
INITRAMFS_FSTYPES ?= "${@oe.utils.ifelse(d.getVar('OSTREE_BOOTLOADER') == 'u-boot', 'cpio.gz.u-boot', 'cpio.gz')}"
# Please redefine OSTREE_REPO in order to have a persistent OSTree repo
-export OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo"
-export OSTREE_BRANCHNAME ?= "${SOTA_HARDWARE_ID}"
-export OSTREE_OSNAME ?= "poky"
-export OSTREE_BOOTLOADER ??= 'u-boot'
-export OSTREE_BOOT_PARTITION ??= "/boot"
+OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo"
+OSTREE_BRANCHNAME ?= "${SOTA_HARDWARE_ID}"
+OSTREE_OSNAME ?= "poky"
+OSTREE_BOOTLOADER ??= 'u-boot'
+OSTREE_BOOT_PARTITION ??= "/boot"
INITRAMFS_IMAGE ?= "initramfs-ostree-image"
@@ -51,6 +35,9 @@ GARAGE_SIGN_KEYNAME ?= "garage-key"
GARAGE_TARGET_NAME ?= "${OSTREE_BRANCHNAME}"
GARAGE_TARGET_VERSION ?= ""
GARAGE_TARGET_URL ?= ""
+GARAGE_TARGET_EXPIRES ?= ""
+GARAGE_TARGET_EXPIRE_AFTER ?= ""
+GARAGE_CUSTOMIZE_TARGET ?= ""
SOTA_MACHINE ??="none"
SOTA_MACHINE_rpi ?= "raspberrypi"
@@ -63,4 +50,4 @@ SOTA_MACHINE_am335x-evm ?= "am335x-evm-wifi"
SOTA_OVERRIDES_BLACKLIST = "ostree ota"
SOTA_REQUIRED_VARIABLES = "OSTREE_REPO OSTREE_BRANCHNAME OSTREE_OSNAME OSTREE_BOOTLOADER OSTREE_BOOT_PARTITION GARAGE_SIGN_REPO GARAGE_TARGET_NAME"
-inherit sota_sanity sota_${SOTA_MACHINE} image_repo_manifest
+inherit sota_sanity sota_${SOTA_MACHINE}
diff --git a/external/meta-updater/classes/sota_bleeding.inc b/external/meta-updater/classes/sota_bleeding.inc
index fc5947de..77d004bf 100644
--- a/external/meta-updater/classes/sota_bleeding.inc
+++ b/external/meta-updater/classes/sota_bleeding.inc
@@ -1 +1,2 @@
SRCREV_pn-aktualizr ?= "${AUTOREV}"
+SRCREV_pn-aktualizr-native ?= "${AUTOREV}"
diff --git a/external/meta-updater/classes/sota_m3ulcb.bbclass b/external/meta-updater/classes/sota_m3ulcb.bbclass
index b93cc407..e7fa9c2f 100644
--- a/external/meta-updater/classes/sota_m3ulcb.bbclass
+++ b/external/meta-updater/classes/sota_m3ulcb.bbclass
@@ -1,11 +1,12 @@
# Commit united image to OSTree, not just uImage
OSTREE_KERNEL = "Image"
-EXTRA_IMAGEDEPENDS_append_sota = " m3ulcb-ota-bootfiles"
-IMAGE_BOOT_FILES_sota += "m3ulcb-ota-bootfiles/*"
+EXTRA_IMAGEDEPENDS_append_sota = " renesas-ota-bootfiles"
+IMAGE_BOOT_FILES_sota += "renesas-ota-bootfiles/*"
OSTREE_BOOTLOADER ?= "u-boot"
-UBOOT_MACHINE_sota = "m3ulcb_defconfig"
+
+UBOOT_MACHINE_sota = "${@d.getVar('SOC_FAMILY').split(':')[1]}_ulcb_defconfig"
PREFERRED_RPROVIDER_virtual/network-configuration ?= "connman"
IMAGE_INSTALL_append_sota = " virtual/network-configuration "
diff --git a/external/meta-updater/classes/sota_raspberrypi.bbclass b/external/meta-updater/classes/sota_raspberrypi.bbclass
index 69f09fd5..c901a70e 100644
--- a/external/meta-updater/classes/sota_raspberrypi.bbclass
+++ b/external/meta-updater/classes/sota_raspberrypi.bbclass
@@ -16,25 +16,55 @@ DEV_MATCH_DIRECTIVE_pn-networkd-dhcp-conf = "Driver=smsc95xx lan78xx"
IMAGE_INSTALL_append_sota = " virtual/network-configuration "
PREFERRED_PROVIDER_virtual/bootloader_sota ?= "u-boot"
-UBOOT_ENTRYPOINT_sota ?= "0x00008000"
+UBOOT_ENTRYPOINT_sota ?= "0x00080000"
IMAGE_FSTYPES_remove_sota = "rpi-sdimg"
OSTREE_BOOTLOADER ?= "u-boot"
+def make_dtb_boot_files(d):
+ # Generate IMAGE_BOOT_FILES entries for device tree files listed in
+ # KERNEL_DEVICETREE.
+ #
+ # This function was taken from conf/machine/include/rpi-base.inc in
+ # meta-raspberrypi
+ alldtbs = d.getVar('KERNEL_DEVICETREE')
+ imgtyp = d.getVar('KERNEL_IMAGETYPE')
+
+ def transform(dtb):
+ base = os.path.basename(dtb)
+ if dtb.endswith('dtb'):
+ return base
+ elif dtb.endswith('dtbo'):
+ return '{};{}'.format(base, dtb)
+
+ return ' '.join([transform(dtb) for dtb in alldtbs.split(' ') if dtb])
+
+IMAGE_BOOT_FILES_sota = "bcm2835-bootfiles/* \
+ u-boot.bin;${SDIMG_KERNELIMAGE} \
+ "
+
# OSTree puts its own boot.scr to bcm2835-bootfiles
-IMAGE_BOOT_FILES_sota = "bcm2835-bootfiles/* u-boot.bin;${SDIMG_KERNELIMAGE}"
+# raspberrypi4 needs dtb in /boot partition so that they can be read by the
+# firmware
+IMAGE_BOOT_FILES_append_sota_raspberrypi4 = "${@make_dtb_boot_files(d)}"
# Just the overlays that will be used should be listed
KERNEL_DEVICETREE_raspberrypi2_sota ?= " bcm2709-rpi-2-b.dtb "
KERNEL_DEVICETREE_raspberrypi3_sota ?= " bcm2710-rpi-3-b.dtb overlays/vc4-kms-v3d.dtbo overlays/rpi-ft5406.dtbo"
KERNEL_DEVICETREE_raspberrypi3-64_sota ?= " broadcom/bcm2710-rpi-3-b.dtb overlays/vc4-kms-v3d.dtbo overlays/vc4-fkms-v3d.dtbo overlays/rpi-ft5406.dtbo"
+KERNEL_DEVICETREE_raspberrypi4_sota ?= " bcm2711-rpi-4-b.dtb overlays/vc4-fkms-v3d.dtbo overlays/uart0-rpi4.dtbo"
+KERNEL_DEVICETREE_raspberrypi4-64_sota ?= " broadcom/bcm2711-rpi-4-b.dtb overlays/vc4-fkms-v3d.dtbo overlays/uart0-rpi4.dtbo"
SOTA_MAIN_DTB_raspberrypi2 ?= "bcm2709-rpi-2-b.dtb"
SOTA_MAIN_DTB_raspberrypi3 ?= "bcm2710-rpi-3-b.dtb"
SOTA_MAIN_DTB_raspberrypi3-64 ?= "broadcom_bcm2710-rpi-3-b.dtb"
+SOTA_MAIN_DTB_raspberrypi4_sota ?= "bcm2711-rpi-4-b.dtb"
+SOTA_MAIN_DTB_raspberrypi4-64_sota ?= "broadcom_bcm2711-rpi-4-b.dtb"
SOTA_DT_OVERLAYS_raspberrypi3 ?= "vc4-kms-v3d.dtbo rpi-ft5406.dtbo"
SOTA_DT_OVERLAYS_raspberrypi3-64 ?= "vc4-kms-v3d.dtbo vc4-fkms-v3d.dtbo rpi-ft5406.dtbo"
+SOTA_DT_OVERLAYS_raspberrypi4 ?= "vc4-fkms-v3d.dtbo uart0-rpi4.dtbo"
+SOTA_DT_OVERLAYS_raspberrypi4-64 ?= "vc4-fkms-v3d.dtbo uart0-rpi4.dtbo"
# Kernel args normally provided by RPi's internal bootloader. Non-updateable
OSTREE_KERNEL_ARGS_sota ?= " 8250.nr_uarts=1 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=614 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 dwc_otg.lpm_enable=0 console=ttyS0,115200 usbhid.mousepoll=0 "
diff --git a/external/meta-updater/classes/sota_sanity.bbclass b/external/meta-updater/classes/sota_sanity.bbclass
index 8e80acbf..74973eb5 100644
--- a/external/meta-updater/classes/sota_sanity.bbclass
+++ b/external/meta-updater/classes/sota_sanity.bbclass
@@ -10,6 +10,52 @@ def sota_check_required_variables(status, d):
if not d.getVar(var):
status.addresult("%s should be set in your local.conf.\n" % var)
+def sota_check_variables_validity(status, d):
+ import re
+ import os.path
+
+ if d.getVar("OSTREE_BRANCHNAME") and re.match("^[a-zA-Z0-9._-]*$", d.getVar("OSTREE_BRANCHNAME")) is None:
+ status.addresult("OSTREE_BRANCHNAME Should only contain characters from the character set [a-zA-Z0-9._-].\n")
+ if d.getVar("SOTA_HARDWARE_ID") and re.match("^[a-zA-Z0-9._-]*$", d.getVar("SOTA_HARDWARE_ID")) is None:
+ status.addresult("SOTA_HARDWARE_ID Should only contain characters from the character set [a-zA-Z0-9._-].\n")
+ if d.getVar("SOTA_CLIENT_FEATURES") is not None:
+ for feat in d.getVar("SOTA_CLIENT_FEATURES").split(' '):
+ if feat not in ("hsm", "serialcan", "ubootenv", ""):
+ status.addresult("SOTA_CLIENT_FEATURES should only include hsm, serialcan and bootenv.\n")
+ break
+ if d.getVar("SOTA_CLIENT_PROV") is not None:
+ prov = d.getVar("SOTA_CLIENT_PROV").strip()
+ if prov not in ("aktualizr-shared-prov", "aktualizr-device-prov", "aktualizr-device-prov-hsm", ""):
+ status.addresult("Valid options for SOTA_CLIENT_PROV are aktualizr-shared-prov, aktualizr-device-prov and aktualizr-device-prov-hsm.\n")
+ if prov == "aktualizr-auto-prov":
+ bb.warn('aktualizr-auto-prov is deprecated. Please use aktualizr-shared-prov instead.')
+ elif prov == "aktualizr-ca-implicit-prov":
+ bb.warn('aktualizr-ca-implicit-prov is deprecated. Please use aktualizr-device-prov instead.')
+ elif prov == "aktualizr-hsm-prov":
+ bb.warn('aktualizr-hsm-prov is deprecated. Please use aktualizr-device-prov-hsm instead.')
+ if d.getVar("GARAGE_TARGET_URL") and re.match("^(https?|ftp|file)://.+$", d.getVar("GARAGE_TARGET_URL")) is None:
+ status.addresult("GARAGE_TARGET_URL is set to a bad url.\n")
+ if d.getVar("SOTA_POLLING_SEC") and re.match("^[1-9]\d*|0$", d.getVar("SOTA_POLLING_SEC")) is None:
+ status.addresult("SOTA_POLLING_SEC should be an integer.\n")
+ config = d.getVar("SOTA_SECONDARY_CONFIG")
+ if config is not None and config != "":
+ path = os.path.abspath(config)
+ if not os.path.exists(path):
+ status.addresult("SOTA_SECONDARY_CONFIG is not set correctly. The file containing JSON configuration for secondaries does not exist.\n")
+ credentials = d.getVar("SOTA_PACKED_CREDENTIALS")
+ if credentials is not None and credentials != "":
+ path = os.path.abspath(credentials)
+ if not os.path.exists(path):
+ status.addresult("SOTA_PACKED_CREDENTIALS is not set correctly. The zipped credentials file does not exist.\n")
+ if d.getVar("OSTREE_UPDATE_SUMMARY") and d.getVar("OSTREE_UPDATE_SUMMARY") not in ("0", "1", ""):
+ status.addresult("OSTREE_UPDATE_SUMMARY should be set to 0 or 1.\n")
+ if d.getVar("OSTREE_DEPLOY_DEVICETREE") and d.getVar("OSTREE_DEPLOY_DEVICETREE") not in ("0", "1", ""):
+ status.addresult("OSTREE_DEPLOY_DEVICETREE should be set to 0 or 1.\n")
+ if d.getVar("GARAGE_SIGN_AUTOVERSION") and d.getVar("GARAGE_SIGN_AUTOVERSION") not in ("0", "1", ""):
+ status.addresult("GARAGE_SIGN_AUTOVERSION should be set to 0 or 1.\n")
+ if d.getVar("SOTA_DEPLOY_CREDENTIALS") and d.getVar("SOTA_DEPLOY_CREDENTIALS") not in ("0", "1", ""):
+ status.addresult("SOTA_DEPLOY_CREDENTIALS should be set to 0 or 1.\n")
+
def sota_raise_sanity_error(msg, d):
if d.getVar("SANITY_USE_EVENTS") == "1":
bb.event.fire(bb.event.SanityCheckFailed(msg), d)
@@ -34,6 +80,7 @@ def sota_check_sanity(sanity_data):
sota_check_overrides(status, sanity_data)
sota_check_required_variables(status, sanity_data)
+ sota_check_variables_validity(status, sanity_data)
if status.messages != "":
sota_raise_sanity_error(sanity_data.expand(status.messages), sanity_data)
diff --git a/external/meta-updater/classes/target_version_example.bbclass b/external/meta-updater/classes/target_version_example.bbclass
index ef119fb2..c0b5aec3 100644
--- a/external/meta-updater/classes/target_version_example.bbclass
+++ b/external/meta-updater/classes/target_version_example.bbclass
@@ -1,7 +1,5 @@
# Writes target version to be used by garage-sign
-HOSTTOOLS += " git "
-
deploy_target_version () {
version=$(git --git-dir=${METADIR}/.repo/manifests/.git/ rev-parse HEAD)
echo -n ${version} > ${STAGING_DATADIR_NATIVE}/target_version