{"id":22779023,"url":"https://github.com/sinipelto/edge-image-tools","last_synced_at":"2026-04-29T10:33:14.741Z","repository":{"id":163362165,"uuid":"461883114","full_name":"sinipelto/edge-image-tools","owner":"sinipelto","description":"Toolset for creating and publishing OS images with automated TPM attestation process for Azure IoT Edge.","archived":false,"fork":false,"pushed_at":"2022-09-09T11:16:20.000Z","size":38301,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-07T00:05:11.566Z","etag":null,"topics":["azure","azure-devops","azure-iot","azure-iot-dps","azure-iot-edge","azure-iot-hub","azure-iot-sample","azure-pipelines","deployment-automation","edge-deployment","image-tools","iot-device","iot-edge","iot-security","swtpm","tpm-attestation","tpm-authentication","tpm2","tpm2-simulator","ubuntu"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sinipelto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-21T13:53:06.000Z","updated_at":"2023-09-08T18:31:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"4c41dcf8-9d46-45cb-8777-750da49e38bd","html_url":"https://github.com/sinipelto/edge-image-tools","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sinipelto/edge-image-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinipelto%2Fedge-image-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinipelto%2Fedge-image-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinipelto%2Fedge-image-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinipelto%2Fedge-image-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sinipelto","download_url":"https://codeload.github.com/sinipelto/edge-image-tools/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinipelto%2Fedge-image-tools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32421792,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T06:29:02.080Z","status":"ssl_error","status_checked_at":"2026-04-29T06:29:00.631Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure","azure-devops","azure-iot","azure-iot-dps","azure-iot-edge","azure-iot-hub","azure-iot-sample","azure-pipelines","deployment-automation","edge-deployment","image-tools","iot-device","iot-edge","iot-security","swtpm","tpm-attestation","tpm-authentication","tpm2","tpm2-simulator","ubuntu"],"created_at":"2024-12-11T20:07:34.918Z","updated_at":"2026-04-29T10:33:14.726Z","avatar_url":"https://github.com/sinipelto.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# edge-image-tools\n\n[![Build Status](https://dev.azure.com/ThesisPoC/EdgeImageTools/_apis/build/status/EdgeImageTools?branchName=publish)](https://dev.azure.com/ThesisPoC/EdgeImageTools/_build/latest?definitionId=3\u0026branchName=publish)\n\n## General information\n\nToolset for creating and publishing OS images with automated TPM attestation process for Azure IoT Edge.\n\nDesigned to be run in a pipeline, using e.g. Azure pipelines but can be run locally for testing purposes, too.\n\nThe main idea is to bring automation into the process of fetching a suitable Operating System, installing and configuring \nnecesary tools and software onto the OS image, then upload it in a cloud storage available for OTA updates for newer versions of the image.\nThe second phase consists of initially downloading the image file, flashing it onto a IoT Edge device with a functioning TPM chip and finally\ntaking that device onto the target premises. After setting up the device and booting it for the first time, the third phase would automate the\nprocess of connecting to a network, connecting to Azure, establishing communication with Azure DPS Service and Azure IoT Hub, verifying the device \nidentity using Azure DPS by using TPM attestation, with pre-registered details in the DPS service for the device to be able to provision itself, \nfetch its configuration and start operating with the IoT Hub.\n\nThe whole process is illustrated in the Figure below:\n\n![Azure IoT Edge Deployment Process](/assets/edge_deployment.png)\n\n## Repository structure\n\n### Directories\n\n* local - Directory contains all local-only assets, configuration files to be used with the scripts.\n* example - Contains examples and templates, configuration files to be edited by personal requirements and copied over the `local` directory.\n* templates - Directory for storing e.g. templated configuration files to be filled with customized information and copied onto the created system image during image creation process.\n\n### Files\n\n* create-image.sh - Script to download a fresh official system image, unpack it, optionally expand it, patch and configure it, finally repack the image.\n* publish-image.sh - Script for publishing the patched and packed image file into a file share / cloud storage. Currently only supports Azure File Share (Azure Storage Account).\n* local-wrapper.image.sh - A Wrapper script for creating and publishing the iot edge system image with optimal local configuration variables. Eases testing the system as whole. Acts as a local replacement for the actual pipeline\n* flash-image.sh - A script for flashing the created image into a SD card to be inserted into the target device. Designed to work also in Windows environments using a bash emulator.\n* provision-image.sh - Script for provisioning the edge device at first boot to install dependencies, and configure azure iot edge. Also polls for new images and updates the system as such available.\n* provisioning.service - Provides the systemd service configuration wrapper for the provisioning service script.\n* wait-for-it.sh - A utility script for waiting for a specific host and port to be available over network connection. Useful for testing network access to critical services.\n\n## Execution locally\n\nTo run the scripts locally:\n\nFirst, copy over the configuration example files over (see the subdirectories README files).\n\nEnsure all variables set correctly in `local/local_config`.\n\nRun the tests to see if any required parameters missing or empty:\n\n```bash\n/bin/bash local-wrapper-image.sh 'test'\n```\n\nShould respond:\n\n```bash\nScript self-test OK\n...\n```\n\nfor each script tested.\n\nEnsure no errors are thrown.\n\nFinally, execute the wrapper script:\n\n```bash\n/bin/bash local-wrapper-image.sh\n```\n\n## Execution using devops pipeline\n\nTo run the scripts in a pipeline\n\nEnsure following requirements met:\n\n* Compatible build agent and OS with sudo/root privileges (Currently Ubuntu 18.04/20.04 LTS supported)\n* Target cloud file storage available and enough free space (Currently Azure File Share as SMB mount point supported)\n\nCurrently implemented pipelines:\n\n* Azure DevOps Pipelines (see azure-pipelines.yml for reference)\n\nConstruct the pipeline configuration with at least following stages/jobs:\n\n* execute script create-image.sh for creating the image file\n* execute publish-image.sh for publishing the image in the cloud file share\n* ensure necessary environment variables set for both scripts (see `example/local_config` file for variable reference)\n\nIn case a different publishing solution is needed, create a separate publish script\nand execute it in the pipeline instead.\n\n### Using the existing Azure Devops Pipeline configuration\n\nImport this repo in Azure Devops Repos section.\n\nEnsure the pipeline configuration (azure-pipelines.yml) is recognized by the Azure environment, and create a pipeline instance for it.\n\nSet the necessary environment variables through the Azure Pipeline variables (ensure any secrets are marked as secret variables).\n\nConfigure a build agent for the pipeline (Microsoft hosted build agent with ubuntu-20.04 recommended).\n\nExecute the pipeline to build and publish an image to a configured cloud storage.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinipelto%2Fedge-image-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsinipelto%2Fedge-image-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinipelto%2Fedge-image-tools/lists"}