Veethree D7 SDK
Loading...
Searching...
No Matches
Performing actions on the release image

< Details index

Purpose

The action mechanism utilizes the swupdate process to allow users to run scripts on the board without requiring a restart and on both release and development images.

This could be useful for updating configuration files or other small tasks especially on release images where remote access is not available.

The action is signed and then verified on the D7 using the supplied key pair in the same way an update is verified. See software update details for more information.

Unlike the updates there is no feedback for an action. It is up to the user to add a feedback mechanism. One example could be to log success or failure in a text file on the USB device /mnt/usbstick.

Creating the action

To create the action simply create a POSIX compliant shellscript and feed that into swugen with the additional --action argument. Copy the .swu to a USB device and insert it into a powered on device.

After applying the sample action below a text file will be created on the USB stick with the contents "hello world".

Linux

  1. Create a script that writes "hello world" to a text file on the USB

    script=/tmp/a-script.sh
    cat << EOF > ${script}
    #!/bin/sh
    echo hello world > /mnt/usbstick/hello-world.txt
    sync
    EOF
  2. Generate the action

    sdk_install_path=~/d7-sdk
    key_path=${sdk_install_path}/keys/default-key
    ${sdk_install_path}/tools/swugen -i ${script} -k ${key_path} -o hello-world --action
  3. Copy generated .swua to USB
  4. Power on device and insert USB

Windows (cmd)

  1. Create a script that writes "hello world" to a text file on the USB

    set script=C:\temp\a-script.sh
    echo #!/bin/sh ^
    echo hello world ^> /mnt/usbstick/hello-world.txt ^
    sync > %script%
  2. Generate the action

    set sdk_install_path=%USERPROFILE%\d7-sdk
    set key_path=%sdk_install_path%\keys\default-key
    %sdk_install_path%/tools/swugen.bat -i %script% -k %key_path% -o hello-world --action
  3. Copy generated .swua to USB
  4. Power on device and insert USB

Summary

On this page, we have presented the supported method to run configuration scripts on the device outside of an update context.