Commit graph

16 commits

Author SHA1 Message Date
Tom Gundersen
e9363f96ed osbuild.py: give assemblers a full devtmpfs
This follows what is done for the stages. We intend to look into
making this unnecessary, but for now allow full access so we can
work on the individual assemblers.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2019-06-19 19:49:53 +02:00
Tom Gundersen
0646b48bb3 osbulid.py/nspawn: bindmount /dev rather than use a synthetic one
We need dynamic device node creation when we create loop devices
and their partitions. It would be possible to mknod them, but
just using the host /dev seems more straight-forward. Access to
the various nodes still needs to be granted explictly as we are
in the devices CGroup.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2019-06-17 14:49:53 +02:00
Tom Gundersen
566911cc27 osbuild.pi: grant access to loop device nodes
We are in the devices namespace, so we must explicitly grant
permission to devices and/or device classes if we are to use
them.

We rely on being able to create and access loop devices in
order to create partitions and filesystems.

/dev/loop-control allows us to create new loop devices backed by
files. The block-loop class allows access to the created block
devices to set up a partition table and the block-blkext class
allows access to the partitions to create and mount filesystems.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2019-06-16 22:48:16 +02:00
Tom Gundersen
253ae27eca osbuild.py/tmpfs: mount with the right mode
Mount tmpfs by default as 0755. This only really makes a differente
when we copy the whole tree.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2019-06-16 13:58:13 +02:00
Lars Karlitski
92f3af94f6 stage api: pass options in a separate key
This avoids name clashes between osbuild and stage options.
2019-06-16 12:07:27 +02:00
Lars Karlitski
2d487fe685 osbuild.py: add systemResourcesFromEtc key
Some programs have resources in /etc (for example, /etc/pki or grub's
config scripts). Give stages a way to access these.
2019-06-14 20:29:14 +02:00
Lars Karlitski
bd87038210 osbuild.py: separate tree from build root
There's no reason to conflate the two. This allows us to build on
something other than a tmpfs.
2019-06-14 19:54:42 +02:00
Lars Karlitski
d43fe388a0 osbuild.py: clarify argument name 2019-06-14 19:46:37 +02:00
Lars Karlitski
c0769fc318 Add assemblers/ directory 2019-06-14 19:46:37 +02:00
Lars Karlitski
aea9dd1752 osbuild.py: don't use /tmp in the build root 2019-06-14 19:34:19 +02:00
Lars Karlitski
bc36adc1f1 osbuild.py: clean up bind mounts for stages
Allow input_dir for assemblers, but mount the tree read-only.
2019-06-14 19:32:05 +02:00
Lars Karlitski
e6dd428107 osbuild.py: rename run-stage to osbuild-run
Run all programs in the build root through osbuild-run. The things it
sets up are probbaly needed by everything.
2019-06-14 18:45:55 +02:00
Lars Karlitski
ce0b01e93d osbuild: remove --sit
It's not really useful because it's at the wrong place, after a stage
has torn down all mounts. It also makes the code more complex for too
little benefit.
2019-06-14 18:38:13 +02:00
Lars Karlitski
7ee6571640 osbuild.py: use readonly bind mounts when possible 2019-06-13 21:12:51 +02:00
Lars Karlitski
2dbd177b0f osbuild.py: add BuildRoot.run_assembler()
This is the canonical way to run an assembler.

Also improve error handling by introducing a StageFailed exception.
2019-06-13 21:07:23 +02:00
Lars Karlitski
b36c8135ae osbuild: split BuildRoot into a reusable module 2019-06-13 20:01:53 +02:00