systemd / mkosi

💽 Build Bespoke OS Images
https://mkosi.systemd.io/
GNU Lesser General Public License v2.1
1.13k stars 304 forks source link

RFC: document execution flow #737

Closed nopeslide closed 3 years ago

nopeslide commented 3 years ago

When starting with mkosi it is hard to distinguish/order the actions that mkosi takes to construct an image, especially since information on each step are separated over multiple locations in the man page A simple flowchart would help to locate these steps and see in which context they are executed.

nopeslide commented 3 years ago

here an example (simplified of course). I do not know if this is correct, since I had to pull the flow from the source and may misunderstood something. exactly the problem I want to tackle :D

@startuml

|host|
start
if (build script?) then (none)
|host|
:skip build image;
else (exists)
|build\nimage|
:copy skeleton trees;
:install distribution;
:install packages;
:install build packages;
:run prepare script (build);
:copy extra trees;
:copy build src;
:run postinstall script (build);
|host|
:run finalize script (build);
|build\nimage|
:run build script;
endif

|final\nimage|
:copy skeleton trees;
:install distribution;
:install packages;
:run prepare script (final);
:copy extra trees;
:copy build destination;
:run postinstall script (final);
|host|
:run finalize script (final);
stop
@enduml

rendered

behrmann commented 3 years ago

Thanks for the contribution. I like this idea a lot. If pandoc can render this, it might make sense to add this to the man page. Would you open a PR for this?

nopeslide commented 3 years ago

Thanks for the contribution. I like this idea a lot. If pandoc can render this, it might make sense to add this to the man page. Would you open a PR for this?

It seems plantuml can only export sequence diagrams as ascii. so I converted it to ascii by hand.