Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

After selecting eMMC size, you will be prompted to choose a root file system. Refer to the picture below and Enter “7” to select Ubuntu MATE 24.04.1.

...

After the completion of executing “make config”, execute “make” command to build the images.

swupdate installation

After updating the images to the platform and booting the system of the platform, connect to the internet and use the following commands to install swupdate.

...

Buildroot Setup

After the completion of running executing make config”, enter the buildroot configuration by running the following command in the top directory of project.

...

After updating the images to the platform and boot booting the system of it, it would fail to start SWUpdate daemon as shown below. It lacks a public key to activate the web server.

...

Besides adding the parameter (the path of the public key) to /usr/lib/swupdate/conf.d/10-mongoose-args for activating the web server, make sure the platform system clock is within the validity period of the public key (mycert.cert.pem) and reference the procedure of updating images by other Ubuntu platforms in Ubuntu MATE 24.04 - eMMC boot.

Yocto 4.2.4 - eMMC boot

When you run “make config” to configure your build environment and after selecting the board, you will be prompted to choose a boot device. Refer to the picture below and Enter “1” to select eMMC.

...

After selecting eMMC size, you will be prompted to choose a root file system. Refer to the picture below and Enter “12” to select Yocto 4.2.4.

...

After the execution of “make config”, you can modify linux\rootfs\initramfs\yocto\meta-swupdate\recipes-support\swupdate\swupdate\defconfig according to your requests. An example shown below enables systemd support、checks for hardware / software compatibility、uses environment in RAM as bootloader interface and enables verification of signed images … etc.

Code Block
#
# Automatically generated file; DO NOT EDIT.
# Swupdate Configuration
#
CONFIG_HAVE_DOT_CONFIG=y

#
# Swupdate Settings
#

#
# General Configuration
#
# CONFIG_CURL is not set
# CONFIG_CURL_SSL is not set
CONFIG_SYSTEMD=y
CONFIG_DEFAULT_CONFIG_FILE="/etc/swupdate.cfg"
CONFIG_SCRIPTS=y
CONFIG_HW_COMPATIBILITY=y
CONFIG_HW_COMPATIBILITY_FILE="/etc/hwrevision"
CONFIG_SW_VERSIONS_FILE="/etc/sw-versions"

#
# Socket Paths
#
CONFIG_SOCKET_CTRL_PATH=""
CONFIG_SOCKET_PROGRESS_PATH=""
CONFIG_SOCKET_REMOTE_HANDLER_DIRECTORY="/tmp/"
CONFIG_MTD=y
CONFIG_LUA=y
CONFIG_LUAPKG="lua"
# CONFIG_FEATURE_SYSLOG is not set

#
# Build Options
#
CONFIG_CROSS_COMPILE=""
CONFIG_SYSROOT=""
CONFIG_EXTRA_LDLIBS=""

#
# Debugging Options
#
# CONFIG_DEBUG is not set
# CONFIG_WERROR is not set
# CONFIG_NOCLEANUP is not set
# CONFIG_BOOTLOADER_EBG is not set
# CONFIG_UBOOT is not set
CONFIG_BOOTLOADER_NONE=y
# CONFIG_BOOTLOADER_GRUB is not set
CONFIG_BOOTLOADER_DEFAULT_NONE=y
# CONFIG_SSL_IMPL_NONE is not set
CONFIG_SSL_IMPL_OPENSSL=y
# CONFIG_SSL_IMPL_MBEDTLS is not set
# CONFIG_DOWNLOAD is not set
CONFIG_HASH_VERIFY=y
CONFIG_SIGNED_IMAGES=y
# CONFIG_SIGALG_RAWRSA is not set
# CONFIG_SIGALG_RSAPSS is not set
CONFIG_SIGALG_CMS=y
# CONFIG_SIGALG_GPG is not set

#
# CMS / PKCS#7 signature verification options
#
# CONFIG_CMS_IGNORE_EXPIRED_CERTIFICATE is not set
# CONFIG_CMS_IGNORE_CERTIFICATE_PURPOSE is not set
# CONFIG_CMS_SKIP_UNKNOWN_SIGNERS is not set
# CONFIG_ENCRYPTED_IMAGES is not set
# CONFIG_SURICATTA is not set
CONFIG_WEBSERVER=y
CONFIG_MONGOOSE=y
CONFIG_MONGOOSEIPV6=y
CONFIG_MONGOOSESSL=y
CONFIG_GUNZIP=y
# CONFIG_ZSTD is not set

#
# Parser Features
#
CONFIG_LIBCONFIG=y
CONFIG_PARSERROOT=""
# CONFIG_JSON is not set
# CONFIG_LUAEXTERNAL is not set
# CONFIG_SETSWDESCRIPTION is not set

#
# Image Handlers
#
# CONFIG_UBIVOL is not set
CONFIG_CFI=y
# CONFIG_CFIHAMMING1 is not set
# CONFIG_DISKPART is not set
CONFIG_RAW=y
# CONFIG_RDIFFHANDLER is not set
CONFIG_LUASCRIPTHANDLER=y
CONFIG_SHELLSCRIPTHANDLER=y
# CONFIG_HANDLER_IN_LUA is not set
# CONFIG_ARCHIVE is not set
# CONFIG_REMOTE_HANDLER is not set
# CONFIG_SWUFORWARDER_HANDLER is not set
# CONFIG_BOOTLOADERHANDLER is not set
# CONFIG_SSBLSWITCH is not set
# CONFIG_UCFWHANDLER is not set

Modify linux\rootfs\initramfs\yocto\meta-sunplus\recipes-img\images\img-sp7350.bb to install the webserver of nginx during compilation.

...

Then execute “make” command to build the images.

Generate self-signed certificates

After updating the images to the platform and boot the system of it, it would fail to start SWUpdate daemon as shown below. It lacks a public key to start SWUpdate daemon.

...

The procedure to generate self-signed certificates is the same as that in Ubuntu MATE 24.04 - eMMC boot. After generating the public key (mycert.cert.pem) by itself or coping it from other platforms which generate it, pack update.swu and will update the images for this Yocto platform, add the parameters of “-k /home/root/my_key/mycert.cert.pem“ for SWUPDATE_ARGS in /usr/lib/swupdate/swupdate.sh of the platform shown below. Then it will start SWUpdate daemon successfully after rebooting the system.

Code Block
#!/bin/sh

# Override these variables in sourced script(s) located
# in /usr/lib/swupdate/conf.d or /etc/swupdate/conf.d
SWUPDATE_ARGS="-k /home/root/work/my_key/mycert.cert.pem -v ${SWUPDATE_EXTRA_ARGS}"
SWUPDATE_WEBSERVER_ARGS=""
SWUPDATE_SURICATTA_ARGS=""

# source all files from /etc/swupdate/conf.d and /usr/lib/swupdate/conf.d/
# A file found in /etc replaces the same file in /usr
for f in `(test -d /usr/lib/swupdate/conf.d/ && ls -1 /usr/lib/swupdate/conf.d/; test -d /etc/swupda
  if [ -f /etc/swupdate/conf.d/$f ]; then
    . /etc/swupdate/conf.d/$f
  else
    . /usr/lib/swupdate/conf.d/$f
  fi
done

#  handle variable escaping in a simmple way. Use exec to forward open filedescriptors from systemd
if [ "$SWUPDATE_WEBSERVER_ARGS" != "" -a  "$SWUPDATE_SURICATTA_ARGS" != "" ]; then
  exec /usr/bin/swupdate $SWUPDATE_ARGS -w "$SWUPDATE_WEBSERVER_ARGS" -u "$SWUPDATE_SURICATTA_ARGS"
elif [ "$SWUPDATE_WEBSERVER_ARGS" != "" ]; then
  exec /usr/bin/swupdate $SWUPDATE_ARGS -w "$SWUPDATE_WEBSERVER_ARGS"
elif [ "$SWUPDATE_SURICATTA_ARGS" != "" ]; then
  exec /usr/bin/swupdate $SWUPDATE_ARGS -u "$SWUPDATE_SURICATTA_ARGS"
else
  exec /usr/bin/swupdate $SWUPDATE_ARGS

sw-description configuration file

Reference it in Ubuntu MATE 24.04 - eMMC boot.

Building a signed SWU image with CMS signature

Reference it in Ubuntu MATE 24.04 - eMMC boot.

HW_FILE

Reference it in Ubuntu MATE 24.04 - eMMC boot.

Update images

The Yocto platform can update images (update.swu) via the command by itself or web server only by other Ubuntu platforms.

Run SWUpdate

Reference it in Ubuntu MATE 24.04 - eMMC boot.

Web server

The Yocto system can only update images (update.swu) by other Ubuntu systems. Reference it in Ubuntu MATE 24.04 - eMMC boot.