Build system images from declarative input
16 hours ago

e5dcc21 Fix apk key handling in new_repo build template

a day ago


builds.sr.ht status

Build system images from declarative input.

makeimg provides a declarative way to describe system images (e.g. VM images). The project was initially inspired by the OpenWRT image builder and Arch Linux's PKGBUILD format. It was then convinced by Alpine's APKBUILD to become POSIX-compliant.

Some examples can be found in the examples folder.

makeimg is a stand-alone project and quite useful on its own, but it is developed with a focus on its part in project Anemos. Check it out to learn how to use makeimg to deploy bare-metal hosts!

NOTE: The expected project structure has changed from version 0.7 to 0.8 - however, most projects can be converted automatically with a script found in the contrib folder.


makeimg comes with extensive man pages, one for the tool and one for the format of the IMGBUILD file that describes the images. You can read the online version here: makeimg.1, IMGBUILD.5 or build the man pages yourself (see below).


The current version of makeimg should technically run on any reasonable Linux system. It can create Arch Linux, Alpine Linux, and Debian Linux images. However, to do so, it depends on pacman, apk, and debootstrap respectively. Arch Linux and Alpine Linux offer all three, and are hence best suited for running makeimg. On Debian, you will only be able to create Debian images (unless the respective tools have been manually installed and set up).


The required tools depend heavily on the target system and the type of image being built. A properly configured pacman or apk is required to build Arch or Alpine images respectively. For building disk images, parted is needed. For more details, check the source code for now.


#Arch Linux

There is an AUR package.

If needed, packages (x86_64 only) are available in my personal repo - add this to pacman.conf:

Server = https://bitfehler.net/arch/$repo/os/$arch

Packages are signed with https://meta.sr.ht/~bitfehler.pgp

#Alpine Linux

You can find the APKBUILD in the contrib/ folder.

Packages (x86_64 only) are available in the Anemos repo - add this to /etc/apk/repositories:


Packages are signed with https://anemos.io/alpine/conrad-6297636d.rsa.pub


Just copy the script somewhere into your $PATH.


Got questions or other feedback? Please use the anemos mailing list.


The script can be used as is. Linting and static analysis is performed with shfmt and shellcheck respectively. When submitting patches, please make sure make check still succeeds.

To build the man pages, scdoc is required. You can also build a HTML version of the man pages with scd2html.

  • Man pages: make man
  • Man pages (html): make html

Please send patches to the anemos mailing list.