GitHunt
IT

Itay2805/image-builder

A tool to create images based on a yaml file

Image Builder

A tool to easily create images based on a yaml configuration.

Supported formats

Partitions

  • GPT
  • MBR

File systems

  • Fat12/16/32
  • Ext2/3/4
  • Echfs

Requirements

  • dd
  • parted
  • python3
    • pyyaml

Optional

  • for fat12/16/32
    • mkfs.fat
    • mtools
  • for ext2/3/4
    • mke2fs
    • e2tools
  • for eachfs
  • for for vdi/vmdk files
    • qemu-img

How to use

You use simply run image-builder.py <config> with config being the yaml configuration file.

If the filename ends with .vmdk or .vdi then the tool will automatically convert the file into these formats.

YAML Layout

See example.yaml for how such a file would look like

  • file - the output filename
  • size - the total size of the image as <num>M/G (1024M == 1G)
  • type - the image type (supported: gpt, mbr)
  • partitions - array of partitions
    • fs - the file system type (supported: fat12/16/32, ext2/3/4, echfs)
    • size - the size of the partition (same format as image size), can also define fit to take all left space
    • bootable - optional, sets the partition as bootable
    • label - the partition label
    • content - folder whose contents will be copied to the root of the filesystem

Languages

Python100.0%

Contributors

MIT License
Created July 6, 2019
Updated January 16, 2024
Itay2805/image-builder | GitHunt