{"id":27867675,"url":"https://github.com/openhd/openhd-imagebuilder","last_synced_at":"2025-05-04T22:52:02.936Z","repository":{"id":37967938,"uuid":"167034887","full_name":"OpenHD/OpenHD-ImageBuilder","owner":"OpenHD","description":"Script for building OpenHD Images","archived":false,"fork":false,"pushed_at":"2025-04-21T19:23:02.000Z","size":9072,"stargazers_count":33,"open_issues_count":2,"forks_count":57,"subscribers_count":7,"default_branch":"2.6-evo","last_synced_at":"2025-04-28T10:25:30.187Z","etag":null,"topics":["build-system","images","openhd"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenHD.png","metadata":{"files":{"readme":"README.asciidoc","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,"zenodo":null}},"created_at":"2019-01-22T17:15:01.000Z","updated_at":"2025-03-29T15:40:02.000Z","dependencies_parsed_at":"2024-01-03T14:14:20.556Z","dependency_job_id":"8eb2ceaf-7eef-40dc-8bf7-3bcb9b0ccdf7","html_url":"https://github.com/OpenHD/OpenHD-ImageBuilder","commit_stats":{"total_commits":1678,"total_committers":27,"mean_commits":"62.148148148148145","dds":"0.49523241954707986","last_synced_commit":"60fb3aff5ad59b5c24eacf0ccdbc82ef2bc9a941"},"previous_names":[],"tags_count":53,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenHD%2FOpenHD-ImageBuilder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenHD%2FOpenHD-ImageBuilder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenHD%2FOpenHD-ImageBuilder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenHD%2FOpenHD-ImageBuilder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenHD","download_url":"https://codeload.github.com/OpenHD/OpenHD-ImageBuilder/tar.gz/refs/heads/2.6-evo","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252411816,"owners_count":21743604,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["build-system","images","openhd"],"created_at":"2025-05-04T22:52:02.242Z","updated_at":"2025-05-04T22:52:02.931Z","avatar_url":"https://github.com/OpenHD.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"// SETTINGS \\\\\n\n:doctype: book \n\n// -- Table of Contents\n\n:toc:\n:toclevels: 3\n:toc-title:  \n:toc-placement!:\n\n// -- Icons\n\nifdef::env-github[]\n:caution-caption: :fire:\n:important-caption: :exclamation:\n:note-caption: :paperclip:\n:tip-caption: :bulb:\n:warning-caption: :warning:\nendif::[]\n\nifdef::env-github[]\n:status:\n:outfilesuffix: .asciidoc\nendif::[]\n\n:sectanchors:\n:numbered:\n\n// SETTINGS END \\\\\n\n# OpenHD-Image-Builder\n\n// Table of Contents\ntoc::[]\n\n## Flashing\nWhen flashing please use the OpenHD-ImageWriter.\nIf you want to flash the Images manually you need to create a (air.txt) or (ground.txt) file in the openhd folder, which is in the root of the FAT32 Partition on the SD-CARD.\n\n\n\n## What is this\nThis project takes a base image and modifies it into an OpenHD compatible image.\nFor the long version, read on.\n\n\n## Using\nIn order to be able to run this you need a Debian or Ubuntu Linux machine with 30 Gb free space on the main partition, and with the following packages:\n\n```sh\nsudo apt install unzip curl git qemu qemu-user-static binfmt-support build-essential gcc-arm*\n```\n\nIf any of the packages fails to install, run apt update prior to the apt install command:\n```\nsudo apt update\n```\n\nThen git clone this repository to a suitable folder \n\n```sh\ngit clone https://github.com/OpenHD/OpenHD-ImageBuilder.git\ncd OpenHD-ImageBuilder\n```\n\nElevate your prompt:\n\n```sh\nsudo -s\n```\n\nAnd run:\n```sh\n./build.sh TARGET\n```\n\nor\n\nvalid targets are:\n\n```sh\npi-bullseye\nx86-noble\nrock5b\nrock5a\nradxa-cm3\nx20\nradxa-zero3w\n```\n\n## More information (what's going on?)\n\n**Note:** if a build fails for some reason, be sure to run the cleanup script so that any temporarily mounted images are cleaned up:\n\n    ./clean-fail.sh \n\n### STAGES\nThe core concept (and some code) was taken from link:https://github.com/RPi-Distro/pi-gen[pi-gen], the Raspbian image generator.\n\nWhenever we make a OpenHD image, we basically perform several steps in order:\n\n- Step 01-00 Download a base image\n- Step 01-01 Increase the size of the root partition if necessary\n- Step 02-00 Install,Remove,Hold Packages (gets documentation soon)\n- Step 03-00 Misc changes to the image, copying files, setting usernames,...\n- Step 03-01 Enable/Disable Services\n- Step 03-02 Additional changes for device detection (poc)\n- Cleanup\n\n\nThe ImageBuilder allows us to run the build process once, and when we want to make a change in stage 3, we only run stage 3 and 4 again by removing the `SKIP` file from the `stages/03-Packages` and the `stages/04-Wifibroadcast` folders. The build system will copy the kernel `IMAGE.img` from stage 2 to stage 3 and re-run all the scripts in stage 3. The resulting image is copied to stage 4 and all those scripts are run. Finally, when there are no more stages, the `IMAGE.img` from the last stage is copied to the `./deploy` directory and renamed to include the target board and OpenHD version.\n\n#### Skipping\nBy placing a `SKIP` file in the stage folder, the entire stage will be skipped by the build system. Please be aware there is no sanity check in place, removing the `SKIP` file from stage 3 while leaving the `SKIP` file in stage 4 will produce an image based on the previous run, ignoring the modifications done in step 3.\n\nIt is also possible to put a `SKIP-IMAGE` file into a stage, this will disable any attempt to copy the image from the previous stage. This is mainly used to prevent image copying in stage `00` and `01` where no image is yet available.\n\n#### Scripts\nEvery stage comprises one or more scripts. Scripts need to be named in the format `XX-run.sh` or `XX-run-chroot.sh`. The order is determined by the XX part, where any `-chroot` script is run **AFTER** the non-chroot script.\n\n**chroot**? What's that? Well, it's a little complex, but basically it allows you to run statements within the image as if you were running the image on an actual target board like the Raspberry Pi. This is used to download and install the `apt-get` packages and several scripts to make the image ready for use with the OpenHD system. Please remember to use `sudo` in the `-chroot` scripts where approperiate.\n\n#### Small\nWe've added a small option, which removes the old images after each step is done.\n\n\n# Contributing\n*Thanks to all the people who already contributed!*\n \n[#img-contributors,link=https://github.com/OpenHD/OpenHD-ImageBuilder/graphs/contributors]\nimage::https://contrib.rocks/image?repo=OpenHD/OpenHD-ImageBuilder[Contributors]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenhd%2Fopenhd-imagebuilder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenhd%2Fopenhd-imagebuilder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenhd%2Fopenhd-imagebuilder/lists"}