Uploaded image for project: 'Mender'
  1. Mender
  2. MEN-4371

Create mender-configure Update Module

    XMLWordPrintable

    Details

      Description

      Acceptance criteria:

      • Update Module "mender-configure" created.
      • Language: /bin/sh (not bash!).
      • Ensuring atomicity: All file copying operations must use a safe_copy function like this:
        cp SRC DST.tmp
        sync DST.tmp
        mv DST.tmp DST
        sync $(dirname DST)
        
      • States:
        • In ArtifactInstall stage:
          1. safe_copy /var/lib/mender-configure/device-config.json $FILES/device-config-backup.json (FILES is the Update Module working directory from the second call argument)
          2. safe_copy meta-data /var/lib/mender-configure/device-config.json
          3. Call
            /usr/lib/mender-configure/apply-device-config /var/lib/mender-configure/device-config.json
            
          4. Return most error codes from /usr/lib/mender-configure/apply-device-config as is.
            • However, upon receiving error code 20, store this as a status somewhere in FILES, and return 0.
        • In NeedsArtifactReboot:
          1. If the "return code 20" was stored earlier, print "Automatic", else print "No"
          2. Return 0
        • In ArtifactRollback:
          1. safe_copy $FILES/device-config-backup.json /var/lib/mender-configure/device-config.json
          2. Call
            /usr/lib/mender-configure/apply-device-config /var/lib/mender-configure/device-config.json
            
      • Unit tests (see the Update Module specification for how to call the module in unit tests)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                a10040 Kristian Amlie
                Reporter:
                a10040 Kristian Amlie
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support