Skip to main content

OS Image Builder

Project description

The aim of JoltOS is to become a framework for building custom Linux images based on popular distributions, such as Debian, Ubuntu, Alpine, etc. Unlike Yocto, the intention is not to build distributions from scratch, but to utilize pre-built binaries to the greatest extent possible through publically available Docker images and package repositories.

Prerequisites

JoltOS is built upon the Jolt task execution tool. Install both with:

$ pip install joltos

Python 3.9 or later is required.

JoltOS also needs Docker. Version 20 or later is recommended. The latest version can be installed with:

$ curl https://get.docker.com | sh

For cross-platform builds, the binfmt-support and qemu-user-static packages are required. Install them with your system’s package manager:

$ sudo apt install -y binfmt-support qemu-user-static

Building an Image

A minimal example image is available in the examples/minimal subdirectory. Build it by running this Jolt command:

$ jolt build minimal/debian:board=qemu

Customizing Images

Create a Jolt Python class inheriting either AlpineImage or DebianImage. Both base classes define different attributes that can be overridden to customize the image.

  • install_files - List of files to be copied into the image.

  • install_pkgs - List of packages to be installed using the distro package manager.

  • install_tasks - List of Jolt task artifacts to be copied into the image.

  • remove_files - List of files to remove from the image.

  • remove_pkgs - List of packages to be removed using the distro package manager.

Image formats are chosen using decorators:

  • joltos.attributes.squashfs - Builds a squashfs image

  • joltos.attributes.tar - Builds a tar archive

Multiple image types can be built at once.

@joltos.attributes.squashfs
@joltos.attributes.tar
class MinimalDebianRootfs(DebianRootfs):
  """ A minimal rootfs with systemd, as squashfs and tar images """
  name = "minimal/debian"
  install_pkgs = ["nano"]
  remove_files = [
    "/usr/share/doc",
    "/usr/share/man",
  ]

To build different variants of an image for different types of boards you can add conditional attributes that are selected based on the values of build parameters. Example:

@joltos.attributes.tar
@joltos.attributes.install_pkgs("install_pkgs_{board}")
@joltos.attributes.install_pkgs("install_pkgs_{variant}")
class MinimalDebianRootfs(DebianRootfs):
  """ A minimal rootfs with systemd, as squashfs and tar images """
  name = "minimal/debian"

  # This attribute is always selected
  install_pkgs = ["nano"]

  # This attribute is selected when variant=debug
  install_pkgs_debug = ["gdb"]

  # This attribute is selected when board=qemu
  install_pkgs_qemu = []
$ jolt build minimal/debian:board=qemu,variant=debug

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

joltos-1.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

joltos-1.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file joltos-1.0.tar.gz.

File metadata

  • Download URL: joltos-1.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.29.1 CPython/3.9.5

File hashes

Hashes for joltos-1.0.tar.gz
Algorithm Hash digest
SHA256 d0f4f1f324ba61aa6a58e33e966d68bcd5a43f52c2b761718b020bede2f1b787
MD5 d25e8a213800ef2db52e347e1b5b8cf1
BLAKE2b-256 268a64767671b4495498aeef74d43d3d978360df2deca6895d5080432e3f216f

See more details on using hashes here.

File details

Details for the file joltos-1.0-py3-none-any.whl.

File metadata

  • Download URL: joltos-1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.29.1 CPython/3.9.5

File hashes

Hashes for joltos-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2b5f1d07f4adbcc9ae751ef0752c596a6ce3f5a92327b4eb3d99ae4aaa71a2f9
MD5 95ddbcc6185e379bf30c34fde0d620ca
BLAKE2b-256 d7dd042105f49c74fd0a46377e4001da48ed52a3ac9db01e267c2d49997947da

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page