{"id":29383456,"url":"https://github.com/lumi2021/image-builder","last_synced_at":"2025-07-10T04:10:09.723Z","repository":{"id":276902529,"uuid":"930661754","full_name":"lumi2021/image-builder","owner":"lumi2021","description":"A very tiny library that I made for generating disk images in the zig build script.","archived":false,"fork":false,"pushed_at":"2025-07-06T00:09:18.000Z","size":4769,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-06T01:19:44.762Z","etag":null,"topics":["build-tool","disk-image","osdev","zig","zig-library","ziglang"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lumi2021.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,"zenodo":null}},"created_at":"2025-02-11T02:03:05.000Z","updated_at":"2025-07-06T00:09:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"da194d59-c96b-4886-af60-696677a8cfa0","html_url":"https://github.com/lumi2021/image-builder","commit_stats":null,"previous_names":["lumi2021/imagebuilder","lumi2021/image-builder"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lumi2021/image-builder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lumi2021%2Fimage-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lumi2021%2Fimage-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lumi2021%2Fimage-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lumi2021%2Fimage-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lumi2021","download_url":"https://codeload.github.com/lumi2021/image-builder/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lumi2021%2Fimage-builder/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264526962,"owners_count":23623195,"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-tool","disk-image","osdev","zig","zig-library","ziglang"],"created_at":"2025-07-10T04:02:43.588Z","updated_at":"2025-07-10T04:10:09.718Z","avatar_url":"https://github.com/lumi2021.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LUMI's Image Building Steps for Zig;\n\nThis is a very tiny library that I made for generating disk images\nin the zig build script.\n\nIt is fully written in zig and completelly system-independent.\n\n## How to settup it in your project:\n\n1. Clone this repository;\n2. Copy the `image-builder/` directory inside your project's root or dependency directory;\n3. See the documentation about how to use it.\n\n## Content and Documentation:\n\nInside `image-builder/` there are 2 itens:\n```\nimage-builder/\n |-- main.zig  -- Main namespace interface\n '-- .src/     -- Implementation of the library\n```\nYou should only import `main.zig` and never directly use anything inside\n`.src/` if you don't know exactly what you're doing!\n\n---\n\nIn your build script, create a reference for `imageBuilder.zig` as follows:\n```zig\nconst imageBuilder = @import(\"image-builder/main.zig\");\n```\n\nAlso create references for important constants:\n\n```zig\nconst KiB = imageBuilder.size_constants.KiB;                    // 1 KiB in sectors size\nconst MiB = imageBuilder.size_constants.MiB;                    // i MiB in sectors size\nconst GPTr = imageBuilder.size_constants.GPT_reserved_sectors;  // GPT reserved sectors\n```\n\nYou can create a GPT disk by calling the `addBuildGPTDiskImage()` function.\nIt returns a `Disk` structure that contains the build step and some usefull\nfunctions to manipulate it data:\n\n```zig\nconst disk = imageBuilder.addBuildGPTDiskImage(\n    b,              // The `*Build` reference\n    20*MiB,         // The size of the disk, in sectors\n    \"mydisk.img\"    // The image file name, relative to `zig-out`\n);\n```\n\nTo create a partition inside the disk, you can call tha function `addPartition()` in\nthe disk instance. Notice that you need togive to it a path to a directory. This\ndirectory is the source of the content of the partition, relative to the project root\ndirectory:\n\n```zig\ndisk.addPartition(\n    .FAT,           // The file system\n    \"Main\",         // The partition label\n    \"disk-data\",    // The source directory\n    20*MiB - GPTr   // The partition size\n);\n```\n\nand at the end, don't forget to link the disk creation step with some already\nexistent:\n\n```zig\nbuild_step.dependOn(\u0026disk.step);\n// or\nb.default_step = \u0026disk.step;\n```\n\n**For more information about how to use the tool, check [build.zig](build.zig) or the module files!**\n\n## Development Status:\n\n```\nVersion: 1.0\n```\n```\n| Disk Type    | Implemented | Tested |\n|--------------|-------------|--------|\n| GPT          |     🟩     |   ⚠️   |\n| MBR          |     🔴     |   🔴   |\n| Hybrid       |     🔴     |   🔴   |\n| Free         |     🔴     |   🔴   |\n```\n```\n| File Systems | Implemented | Tested |\n---------------|-------------|--------|\n| vFAT         |     🟩     |   ⚠️   |\n| Ext2         |     🔴     |   🔴   |\n| Ext3         |     🔴     |   🔴   |\n| Ext4         |     🔴     |   🔴   |\n| NTFS         |     🔴     |   🔴   |\n| Btrfs        |     🔴     |   🔴   |\n| ISO 9660     |     🔴     |   🔴   |\n```\n\n\u003e obs: disk types and file systems listed here are planned to be added at some moment\n\n## Using and Contributing:\n\nFeel free to use this code how you want, this project is under the [MIT license!](LICENSE) \\\nFeel free to contribute using the tool, sending issues or pull requests!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flumi2021%2Fimage-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flumi2021%2Fimage-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flumi2021%2Fimage-builder/lists"}