azure device update agent: SW update OTA: how to download ".swu" image in some other rootfs directory instead of sandbox

Anonymous
2023-05-30T18:21:31.4833333+00:00

We're working on SW update OTA using azure device update agent, facing some issues.

Issue description: using device update agent we're successfully able to downland ".swu" image that we're deploying from the cloud but after download, ".swu" image is getting deleted from the sandbox.

  • Sandbox is a directory path on device side (Hardware/Board) where ".swu" image is getting downloaded.

SANDBOX PATH: /var/lib/adu/downloads/356a67a1-7952-44b5-817b-a3acd9005bbb

what we're expecting as a solution : we want to download ".swu" image in some other rootfs directory instead of sandbox.

e.g. /tmp

your help would be grateful, waiting for answer, thanks

Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,272 questions
{count} vote

1 answer

Sort by: Most helpful
  1. LeelaRajeshSayana-MSFT 17,766 Reputation points Moderator
    2023-05-31T19:09:11.41+00:00

    Hi @Anonymous Thank you for providing additional information. Script Handler extension of Azure IoT hub device update is used to prepare and execute a script on the IoT Device. At runtime, the Script Handler will download every file listed in files array, into a workfolder. This is a folder used for storing downloaded file, workflow result file, and any other temp files. The workfolder path is automatically injected to the scripts during run time and it has a path as follows /var/lib/adu/downloads/workflow_id_1234567890/

    To provide a custom download path, we can use the argument work-folder under handlerProperties.arguments setting of the Update manifest file to set a custom path. Please refer the following example which displays the arguments for more details.

    
    {
        "description": "Motors Update post-install step",
        "handler": "microsoft/script:1",
        "files": [
            "contoso-motor-installscript.sh"
        ],
        "handlerProperties": {
            "scriptFileName": "contoso-motor-installscript.sh",
            "arguments": "--post-install-sim-success --component-name --component-name-val --component-group --component-group-val --component-prop path --component-prop-val path --work-folder path",
            "installedCriteria": "1.2"
        }
    }
    

    Please refer to the Readme file of the script handler for more details on this.

    Hope this answers your question. Please let us know if you have any additional questions or need further clarification on this.


    If the response helped, please do click Accept Answer and Yes. Doing so would help other community members with similar issue identify the solution. I highly appreciate your contribution to the community.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.