Commit graph

3673 commits

Author SHA1 Message Date
Lars Karlitski
ba2a194d5d osbuild: add --sit
Passing --sit keeps the build environment up for inspection when a stage
failed.
2019-06-07 21:46:23 +02:00
Lars Karlitski
5e7a111120 osbuild: run further setup in build environment
Introduce `run-stage` script, which sets up the build environment before
running the stage. Run `ldconfig`, `systemd-sysusers`, and
`systemd-tmpfiles` in it.
2019-06-07 21:33:31 +02:00
Tom Gundersen
256bb718ee osbuild: print the nsenter command needed to get a shell in the container
This is useful for debugging, and would be as a very lightweight ssh
session, but one that only insepcts the environment without hooking
into anything.
2019-06-07 17:19:44 +02:00
Tom Gundersen
61f83b3f46 osbuild: run stages as PID2 instead of PID1
nspawn can provide a minimal PID1 implementation, avoiding stages to
themselves do things like reap zobies etc. Use that.
2019-06-07 17:00:24 +02:00
Lars Karlitski
7999ef9f9d anaconda: don't fail when systemd-tmpfiles returns !0 2019-06-07 13:34:23 +02:00
Lars Karlitski
5f59cc0cb4 osbuild: only use /usr from the host
Use systemd-nspawn's "volatile" mode, which creates a tmpfs for the root
directory. This ensures that we're not accidentally using configuration
from the host.

The only remaining hole is `/etc/pki`.

Anaconda cannot run without its configuation in `/etc`. Recreate the
defaults.
2019-06-07 13:14:21 +02:00
Tom Gundersen
13cb397eca osbuild: use systemd-nspawn
Rather than using unshare, we use nspawn as it gives us more isolation
for free. We are not sure if we will end up with this in the end, but
for the time being let's see how well it works for us.

We have to do a work-around as nspawn refuses to spawn with the current
root as the directory, even in read-only mode, so we bindmount it first
and use the bindmount, in order to trick nspawn.
2019-06-06 19:37:49 +02:00
Tom Gundersen
cdcfa1277e osbuild: make state handling generic
Rather than treating the dnf-cache specially, give each stage its
own state directory that they can reuse. This should obviously be
used with care by the stages in order to make the builds
reproducible.
2019-06-06 19:37:49 +02:00
Lars Karlitski
d7cf0ac006 Update README.md 2019-06-06 17:08:00 +02:00
Tom Gundersen
d557784c8c osbuild: do not set up API VFS in the target tree
Some stages will be chrooting into the target to run things there,
and they will require the standard API VFS to be mounted. Some
tools do that themselves, other do not. In all cases, we would like
to discourage running things in the target tree.

For these reasons do not pre-mount the API VFS, but require the
stages who need it to do the mounting themselves. This is a partial
revert of f6023ed78b.
2019-06-06 16:52:03 +02:00
Tom Gundersen
78c8a176c9 mount /run in the target
Like the other API VFS, we need our own /run instance.
2019-06-05 20:41:34 +02:00
Lars Karlitski
a04ec2c4b0 Add some more stages 2019-06-05 17:29:08 +02:00
Lars Karlitski
f6023ed78b Bind-mount vfs directories for each stage
Many of the stages need it anyway.
2019-05-06 00:23:56 +02:00
Lars Karlitski
658d691174 README: Document that stages have privaete temp dirs 2019-05-05 23:54:07 +02:00
Lars Karlitski
61a59b7ad0 dnf: Simplify writing dnf.conf
Every stage gets its own private /tmp. There's no need to find unique
names or cleaning up.
2019-05-05 23:54:07 +02:00
Lars Karlitski
3a3c35ba99 anaconda: Remove unused import 2019-05-05 23:33:21 +02:00
Lars Karlitski
c6e45d4357 Add io.weldr.qcow2
A stage that makes a bootable .qcow2 image out of the tree.
2019-04-09 18:43:21 +02:00
Lars Karlitski
4f2eef837d README.md: Add section about running osbuild 2019-04-09 18:41:59 +02:00
Lars Karlitski
ced6d2887a
Add LICENSE 2019-04-09 18:18:44 +02:00
Lars Karlitski
3660fe8840 Add README.md 2019-04-09 18:16:57 +02:00
Lars Karlitski
a1d9272866 Add io.weldr.ansible
Run an Ansible playbook on the tree, using Ansible's chroot connection
type.
2019-04-09 16:57:25 +02:00
Lars Karlitski
790a184aef Add --from and --save options
These options allow initializing and saving the tree to a .tar.gz before
running the pipeline.
2019-04-09 12:16:55 +02:00
Lars Karlitski
ae1afef209 osbuild 2019-04-08 13:03:13 +02:00