No description
Find a file
Tom Gundersen c124ab264b loop: add helpers to use IPC to create loop devices
loop.py is a simple wrapper around the kernel loop API. remoteloop.py
uses this to create a server/clinet pair that communicates over an
AF_UNIX/SOCK_DGRAM socket to allow the server to create loop devices
for the client.

The client passes a fd that should be bound to the resulting loop
device, and a dir-fd where the loop device node should be created.
The server returns the name of the device node to the client.

The idea is that the client is run from whithin a container without
access to devtmpfs (and hence /dev/loop-control), and the server
runs on the host. The client would typically pass its (fake) /dev
as the output directory.

For the client this will be similar to `losetup -f foo.img --show`.

[@larskarlitski: pylint: ignore the new LoopInfo class, because it
only has dynamic attributes. Also disable attribute-defined-outside-init,
which (among other problems) is not ignored for that class.]

Signed-off-by: Tom Gundersen <teg@jklm.no>
2019-07-19 00:51:12 +02:00
assemblers assemblers/qcow2: don't rely on partition loopback devices 2019-07-19 00:51:12 +02:00
osbuild loop: add helpers to use IPC to create loop devices 2019-07-19 00:51:12 +02:00
samples stages/io.weldr.grub2: drop unused functions and options 2019-07-11 15:01:44 +02:00
stages fix warnings generated by pylint 2019-07-17 13:08:22 +02:00
test fix tests 2019-07-18 10:17:39 +02:00
.pylintrc loop: add helpers to use IPC to create loop devices 2019-07-19 00:51:12 +02:00
.travis.yml add pylint and travis CI configuration 2019-07-17 13:08:22 +02:00
LICENSE Add LICENSE 2019-04-09 18:18:44 +02:00
osbuild-run osbuild.py: rename run-stage to osbuild-run 2019-06-14 18:45:55 +02:00
README.md osbuild: replace --from and --save with --input and --output 2019-06-12 16:26:29 +02:00
setup.py add __main__ file for convenient CLI usage 2019-07-18 10:17:39 +02:00

osbuild

A build system for operating system images, working towards an image build pipeline that's more comprehensible, reproducible, and extendable.

Pipelines

The build process for an image is described by a pipeline. Each stage in a pipeline is a program that, given some configuration, modifies a file system tree. Pipelines are defined as JSON files like this one:

{
  "name": "Example Image",
  "pipeline": [
    {
      "name": "io.weldr.dnf",
      "options": {
        "packages": [ "@core", "httpd" ]
      }
    },
    {
      "name": "io.weldr.systemd",
      "options": {
        "enabled_services": [ "httpd" ]
      }
    },
    {
      "name": "io.weldr.qcow2",
      "options": {
        "target": "output.qcow2"
      }
    }
  ]
}

osbuild runs each of the stages in turn, isolating them from the host and from each other, with the exception that the first stage may be given an input directory, the last stage an output directory and all stages of a given pipeline are given the same filesystem tree to operate on.

Each stage is passed the (appended) options object as JSON over stdin.

The above pipeline has no input and produces a qcow2 image.

Running

osbuild [--input DIRECTORY] [--output DIRECTORY] PIPELINE

Runs PIPELINE. If --input is given, the directory is available read-only in the first stage. If --output is given it, it must be empty and is avialble read-write in the final stage.