Yaib (yet another image builder) was always a temporary name, while I
suck at naming debos seems like a pretty good name that isn't overly
confusing (yaib is also the name of an irc bot).
With the renaming I'm also considering the current yaml format and
actions as stable, which means no backwards incompatible will be done
from this point onwards without changing the major version (1)
Most todo for 1.0 apart from renaming to debos are done. The format
seems pretty ok and ends up being pleasant enough to use, without any
unpleasantness that i'd like to change around in the short term. So good
enough for v1.
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
To be consistent with the filesystem deploy action, change the source
identifier from rootdir to filesystem. In general the intended jargon is
that the "filesystem" is the filesystem being created by the tool
(by unpacking a tarball or debootstrap or deploying an ostree or
whatever)
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
At first i was thinking we should have a stage keyboard in the run
action rather then a simple postprocessing boolean, but that bool is
rather convenient to use and the other stages aren't well-defined yet.
So keep the simple bool for now and improve the error it shows (asking
it to chroot into the filesystem makes no sense in postprocessing)
If more stages are defined (pre-processing?) then a new key can be added
and this one kept for backwards compatibility
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Some action can take a good amount of time (packing, unpacking) but gave
no indication that they were running. Improve this by logging whenever
an action starts (using the description) so it's easier to determine
what's going on. Also log at the end (mostly so there is a timestamp)
and in case fakemachine isn't supported, which is a less well tested
usecase.
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
The image-setup action ended up being really two things, doing all the
image partitioning and creating the filesystems as well as deploying the
currently setup filesystem onto it and create its fstab and kernel
cmdline. This especially showed when what was deployed onto the images
wasn't the filesystem but an ostree commit as the latter doesn't have
e.g. an /etc on /
Split the action into two new actions:
* image-partition, which does all the partitioning and filesystem creation
(and mounting those)
* filesystem-deploy, which deploys the current filesystem onto the image
and sets up fstab + /etc/kernel/cmdline
For fstab setup and kernel commandline the required information is
stashed into the general context such that both the ostree deploy action
and the filesystem deploy action can re-use it for their particular
setups
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Let Action also implement the Stringer interface and have a sensible
implementaton in BaseAction which uses the Description field in yaml and
falls back on the Action field otherwise
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Let all Action functions return error and refactor all actions to return
their errors rather then calling log.Fatalf or panic. This allows
handling/printing of the errors consistently at the top level
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Simply wrap template vars as passed to the inner run in " this should
solve the most problem (template vars with spaces), though for a full
solution we'll need to do proper shell escaping or have fakemachine not
start things under a shell
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
When getting a repository from ostree via the OstreeSysroot object some
extra information is stashed in place which seems to confused
ostree_repo_add_remote causing it to put the remote configuration in
/etc (as opposed to the repository itself).
While the proper fix should be in ostree, this allows us to get around
it for now
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Passing the rootdir as the last argument can be cumbersome especially
when using commands rather then scripts. Instead set the ROOTDIR
environment variable for usage in scripts/commands
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Factor out the command runner helper into its own file and make it an
object rather then a helper function so multiple runs can easily be done
using the same setup. Also rather then pulling out the output afterwards
implement a small object implementing the Writer interface to be used
for stdout/stderr which simply re-outputs the information line-based
with a prefix attached for easy debugging.
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Support simple templating by using go's standard text/template on the
recipe. Thusfar it supports one custon template function, sector, to
calculate a sector number to byte offset
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>