Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some documentation on how to implement a new distribution #2919

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs/distribution-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,24 @@ these requirements. However, you can still use mkosi with the
distribution by setting the `Distribution` setting to `custom` and
implementing either providing the rootfs via a skeleton tree or base
tree, or by providing the rootfs via a prepare script.

# Implementing new distributions

To actually implement a new distribution, the following checklist can be
used:

- Add the distribution to the `Distribution` enum
- Add the implementation of the distribution in `mkosi/distributions`.
If the distribution is a variant of an existing distribution, inherit
from the existing distribution's installer class and only override the
necessary methods.
- Update any relevant methods on the `Distribution` enum to take the new
distribution into account.
- Update the documentation in `mkosi/resources/mkosi.md`
- Update the default initrd, tools and default image configurations in
`mkosi/resources/mkosi-initrd`, `mkosi/resources/mkosi-tools` and
`mkosi.conf.d` respectively. If the distribution is a variant of
another existing distribution, update the `[Match]` blocks for the
existing distribution to also match against the new distribution. To
test whether all necessary changes were made, you can run
`mkosi -d <distribution> --tools-tree -t disk -f qemu`.