@@ -34,6 +34,7 @@ IMAGE_FSTYPES += "tar.xz.md5sum"
# Extra boot files for WIC images
do_image_wic[depends] += "tisdk-uenv:do_deploy"
+WKS_FILE:ti-swupdate = "sdimage-2part-swupdate.wks"
IMAGE_BOOT_FILES += "uEnv.txt"
# Mask any broken recipes (currently none)
new file mode 100644
@@ -0,0 +1,9 @@
+CONFIG_HW_COMPATIBILITY=y
+# CONFIG_LUA is not set
+# CONFIG_BOOTLOADER_NONE is not set
+CONFIG_SYSTEMD=y
+CONFIG_WEBSERVER=y
+CONFIG_CFI=y
+CONFIG_EMMC_HANDLER=y
+CONFIG_RAW=y
+CONFIG_SHELLSCRIPTHANDLER=y
new file mode 100644
@@ -0,0 +1,13 @@
+globals :
+{
+ verbose = true;
+ loglevel = 5;
+ syslog = true;
+};
+
+webserver :
+{
+ document_root = "/www";
+ userid = 0;
+ groupid = 0;
+};
new file mode 100644
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+rootfs=$(swupdate -g)
+
+if [ $rootfs == '/dev/mmcblk0p2' ];then
+ SELECTION="-e stable,copy1"
+else
+ SELECTION="-e stable,copy2"
+fi
+
+swupdate -H @MACHINE@:1.0 ${SELECTION} -p 'reboot' -f /etc/swupdate.cfg -w "-r /www -p 8080"
new file mode 100644
@@ -0,0 +1,28 @@
+inherit swupdate-lib
+
+FILESEXTRAPATHS:append := "${THISDIR}/files:"
+
+FILES:${PN} += " \
+ ${SWUPDATE_HW_COMPATIBILITY_FILE} \
+"
+
+SRC_URI += " \
+ file://defconfig \
+ file://swupdate.sh \
+ file://swupdate.cfg \
+ "
+
+do_install:append () {
+ install -d ${D}
+ echo "${MACHINE} 1.0" > ${D}/${@d.getVar("SWUPDATE_HW_COMPATIBILITY_FILE")}
+
+ # We don't make use of conf.d in our swupdate.sh
+ rm -rf ${D}${libdir}/swupdate/conf.d
+
+ install -m 0755 ${WORKDIR}/swupdate.sh ${D}${libdir}/swupdate/
+ sed -i "s#@MACHINE@#${MACHINE}#g" ${D}${libdir}/swupdate/swupdate.sh
+
+ install -d ${D}${sysconfdir}
+ install -m 644 ${WORKDIR}/swupdate.cfg ${D}${sysconfdir}
+ sed -i "s#@MACHINE@#${MACHINE}#g" ${D}${sysconfdir}/swupdate.cfg
+}
new file mode 100644
@@ -0,0 +1,6 @@
+# short-description: Create SD card image with A/B partitions for SWUpdate
+# long-description: Creates a partitioned SD card image for TI platforms with SWUpdate support.
+# Check https://sbabic.github.io/swupdate/scenarios.html#double-copy-with-fall-back
+
+part / --source rootfs --fstype=ext4 --label rootfs_1 --align 1024 --use-uuid
+part / --source rootfs --fstype=ext4 --label rootfs_2 --align 1024 --use-uuid
This patch adds basic support for A/B dual update mechanism where the rootfs is duplicated to provide redundancy in case of an update failure. The bbappend adds the modifications required to make SWUpdate suitable for our use case. The new swupdate systemd service invokes swupdate.sh on startup which starts an update server on the target platform. The "ti-swupdate" override is used to selectively enable SWUpdate support to the final tisdk image. Signed-off-by: Anshul Dalal <anshuld@ti.com> --- meta-arago-distro/conf/distro/arago.conf | 1 + .../recipes-swupdate/swupdate/files/defconfig | 9 ++++++ .../swupdate/files/swupdate.cfg | 13 +++++++++ .../swupdate/files/swupdate.sh | 11 ++++++++ .../swupdate/swupdate_%.bbappend | 28 +++++++++++++++++++ .../wic/sdimage-2part-swupdate.wks | 6 ++++ 6 files changed, 68 insertions(+) create mode 100644 meta-arago-distro/recipes-swupdate/swupdate/files/defconfig create mode 100644 meta-arago-distro/recipes-swupdate/swupdate/files/swupdate.cfg create mode 100644 meta-arago-distro/recipes-swupdate/swupdate/files/swupdate.sh create mode 100644 meta-arago-distro/recipes-swupdate/swupdate/swupdate_%.bbappend create mode 100644 meta-arago-distro/wic/sdimage-2part-swupdate.wks