다단계 순서가 지정된 실행

다단계 순서가 지정된 실행을 사용하면 무선 업데이트를 배포할 때 사전 설치 및 사후 설치 작업을 실행할 수 있습니다. 이 기능은 공개 미리 보기 새로 고침 업데이트 매니페스트 v4 스키마의 일부입니다.

공개 미리 보기 새로 고침 릴리스의 일부로 다음 변경 내용을 검토하기 전에 업데이트 매니페스트 설명서를 참조하세요.

다단계 순서가 지정된 실행에는 다음 두 가지 유형의 단계가 있습니다.

  • 인라인 단계(기본값)
  • 참조 단계

하나의 인라인 단계를 사용하는 업데이트 매니페스트 예제:

{
    "updateId": {...},
    "isDeployable": true,
    "compatibility": [
        {
            "manufacturer": "du-device",
            "model": "e2e-test"
        }
    ],
    "instructions": {
        "steps": [
            {
                "description": "Example APT update that install libcurl4-doc on a host device.",
                "handler": "microsoft/apt:1",
                "files": [
                    "apt-manifest-1.0.json"
                ],
                "handlerProperties": {
                    "installedCriteria": "apt-update-test-1.0"
                }
            }
        ]
    },
    "manifestVersion": "4.0",
    "importedDateTime": "2021-11-16T14:54:55.8858676Z",
    "createdDateTime": "2021-11-16T14:50:47.3511877Z"
}

두 개의 인라인 단계를 사용하는 업데이트 매니페스트 예제:

{
    "updateId": {...},
    "isDeployable": true,
    "compatibility": [
        {
            "manufacturer": "du-device",
            "model": "e2e-test"
        }
    ],
    "instructions": {
        "steps": [
            {
                "description": "Install libcurl4-doc on host device",
                "handler": "microsoft/apt:1",
                "files": [
                    "apt-manifest-1.0.json"
                ],
                "handlerProperties": {
                    "installedCriteria": "apt-update-test-2.2"
                }
            },
            {
                "description": "Install tree on host device",
                "handler": "microsoft/apt:1",
                "files": [
                    "apt-manifest-tree-1.0.json"
                ],
                "handlerProperties": {
                    "installedCriteria": "apt-update-test-tree-2.2"
                }
            }
        ]
    },
    "manifestVersion": "4.0",
    "importedDateTime": "2021-11-16T20:21:33.6514738Z",
    "createdDateTime": "2021-11-16T20:19:29.4019035Z"
}

하나의 참조 단계를 사용하는 업데이트 매니페스트 예제:

  • 자식 업데이트를 참조하는 부모 업데이트

    {
        "updateId": {...},
        "isDeployable": true,
        "compatibility": [
            {
                "manufacturer": "du-device",
                "model": "e2e-test"
            }
        ],
        "instructions": {
            "steps": [
                {
                    "type": "reference",
                    "description": "Cameras Firmware Update",
                    "updateId": {
                        "provider": "contoso",
                        "name": "virtual-camera",
                        "version": "1.2"
                    }
                }
            ]
        },
        "manifestVersion": "4.0",
        "importedDateTime": "2021-11-17T07:26:14.7484389Z",
        "createdDateTime": "2021-11-17T07:22:10.6014567Z"
    }
    
  • 여러 인라인 단계를 사용하는 자식 업데이트

    {
        "updateId": {
            "provider": "contoso",
            "name": "virtual-camera",
            "version": "1.2"
        },
        "isDeployable": false,
        "compatibility": [
            {
                "group": "cameras"
            }
        ],
        "instructions": {
            "steps": [
                {
                    "description": "Cameras Update - pre-install step",
                    "handler": "microsoft/script:1",
                    "files": [
                        "contoso-camera-installscript.sh"
                    ],
                    "handlerProperties": {
                        "scriptFileName": "contoso-camera-installscript.sh",
                        "arguments": "--pre-install-sim-success --component-name --component-name-val --component-group --component-group-val --component-prop path --component-prop-val path",
                        "installedCriteria": "contoso-virtual-camera-1.2-step-0"
                    }
                },
                {
                    "description": "Cameras Update - firmware installation (failure - missing file)",
                    "handler": "microsoft/script:1",
                    "files": [
                        "contoso-camera-installscript.sh",
                        "camera-firmware-1.1.json"
                    ],
                    "handlerProperties": {
                        "scriptFileName": "missing-contoso-camera-installscript.sh",
                        "arguments": "--firmware-file camera-firmware-1.1.json --component-name --component-name-val --component-group --component-group-val --component-prop path --component-prop-val path",
                        "installedCriteria": "contoso-virtual-camera-1.2-step-1"
                    }
                },
                {
                    "description": "Cameras Update - post-install step",
                    "handler": "microsoft/script:1",
                    "files": [
                        "contoso-camera-installscript.sh"
                    ],
                    "handlerProperties": {
                        "scriptFileName": "contoso-camera-installscript.sh",
                        "arguments": "--post-install-sim-success --component-name --component-name-val --component-group --component-group-val --component-prop path --component-prop-val path",
                        "installedCriteria": "contoso-virtual-camera-1.2-stop-2"
                    }
                }
            ]
        },
        "referencedBy": [
            {
                "provider": "DU-Client-Eng",
                "name": "MSOE-Update-Demo",
                "version": "3.1"
            }
        ],
        "manifestVersion": "4.0",
        "importedDateTime": "2021-11-17T07:26:14.7376536Z",
        "createdDateTime": "2021-11-17T07:22:09.2232968Z",
        "etag": "\"ad7a553d-24a8-492b-9885-9af424d44d58\""
    }
    

참고 항목

업데이트 매니페스트에서 installedCriteria 문자열을 사용하여 단계를 수행해야 하는지 여부를 결정하는 경우 각 단계에는 서로 다른 해당 문자열이 있어야 합니다.

부모 업데이트 및 자식 업데이트

업데이트 매니페스트에서 서로를 참조하는 경우 최상위 매니페스트를 부모 업데이트라고 하고, 참조 단계에서 지정된 매니페스트를 자식 업데이트라고 합니다.

현재 자식 업데이트에는 참조 단계가 포함될 수 없습니다. 이 제한은 가져오기 시간에 유효성을 검사하며 이 제한을 따르지 않으면 가져오기에 실패합니다.

부모 업데이트의 인라인 단계

부모 업데이트에 지정된 인라인 단계는 호스트 디바이스에 적용됩니다. 여기서 단계 처리기(업데이트 콘텐츠 처리기라고도 함)에 전달되는 ADUC_WorkflowData 개체는 Selected Components 데이터를 포함하지 않습니다. 이 유형의 단계에 대한 처리기는 Component-Aware 처리기가 아니어야 합니다.

단계 콘텐츠 처리기는 각 단계에 대해 IsInstalled 유효성 검사 논리를 적용합니다. Device Update 에이전트의 단계 처리기는 IsInstalled()에서 'true'를 의미하는 "900" 결과 코드를 생성했는지 여부를 확인하여 특정 업데이트가 이미 설치되어 있는지 확인합니다. 업데이트가 이미 설치된 경우 디바이스에 이미 있는 업데이트를 다시 설치하지 않도록 방지하기 위해 DU 에이전트는 단계를 수행할지 여부를 결정하는 데 사용하므로 이후 단계를 건너뜁니다.

업데이트 결과를 보고하려면 --result-file 옵션에서 지정한 대로 단계 처리기 실행 결과를 원하는 결과 파일의 ADUC_Result 구조체에 기록해야 합니다. 그런 다음, 실행 결과에 따라 성공의 경우 0을 반환하고 치명적인 오류의 경우 -1 또는 0xFF를 반환합니다.

자세한 내용은 단계 콘텐츠 처리기사용자 지정 구성 요소 인식 콘텐츠 처리기 구현을 참조하세요.

부모 업데이트의 참조 단계

부모 업데이트에 지정된 참조 단계는 호스트 디바이스에 있거나 호스트 디바이스에 연결된 구성 요소에 적용됩니다. 참조 단계는 자식 업데이트라고 하는 또 다른 업데이트의 업데이트 식별자를 포함하는 단계입니다.

참조 단계를 처리하는 경우 단계 처리기는 참조 단계 데이터에 지정된 분리된 업데이트 매니페스트 파일을 다운로드한 다음, 파일 무결성의 유효성을 검사합니다. 다음으로 단계 처리기는 자식 업데이트 매니페스트의 데이터와 부모 업데이트 매니페스트의 파일 URL 정보를 결합하여 자식 업데이트 매니페스트를 구문 분석하고 ADUC_Workflow 개체(자식 워크플로 데이터라고도 함)를 만듭니다. 이 자식 워크플로 데이터에는 '1'로 설정된 'level' 속성도 있습니다.

참고 항목

현재 자식 업데이트에는 참조 단계가 포함될 수 없습니다.

분리된 업데이트 매니페스트

IoT Hub 쌍 데이터 크기 제한으로 인한 배포 실패를 방지하기 위해 큰 업데이트 매니페스트는 분리된 업데이트 매니페스트라고도 하는 JSON 데이터 파일 형식으로 전달됩니다.

큰 콘텐츠가 포함된 업데이트를 Device Update for IoT Hub로 가져오는 경우 생성된 업데이트 매니페스트에는 업데이트 매니페스트의 전체 데이터가 포함된 Detached Update Manifest라는 또 다른 페이로드 파일이 포함됩니다.

디바이스 또는 모듈 쌍의 UpdateManifest 속성에는 분리된 업데이트 매니페스트 파일 정보가 포함됩니다.

PnP 속성이 변경된 이벤트를 처리하는 경우 Device Update 에이전트는 자동으로 분리된 업데이트 매니페스트 파일을 다운로드하고 전체 업데이트 매니페스트 데이터를 포함하는 ADUC_WorkflowData 개체를 만듭니다.