Coder Social home page Coder Social logo

mkosi's Introduction

mkosi โ€” Build Bespoke OS Images

A fancy wrapper around dnf --installroot, apt, pacman and zypper that generates customized disk images with a number of bells and whistles.

For a longer description and available features and options, see the man page.

Packaging status

Installation

You can install mkosi from your distribution using its package manager or install the development version from git. If you install mkosi using your distribution's package manager, make sure it installs at least mkosi v16 or newer (Use mkosi --version to check). If your distribution only packages an older version of mkosi, it is recommended to install mkosi using one of the alternative installation methods listed below instead.

Running mkosi from the repository

To run mkosi straight from its git repository, you can invoke the shim bin/mkosi. The MKOSI_INTERPRETER environment variable can be set when using the bin/mkosi shim to configure the python interpreter used to execute mkosi. The shim can be symlinked to e.g. /usr/local/bin to make it accessible from the PATH.

git clone https://github.com/systemd/mkosi
ln -s $PWD/mkosi/bin/mkosi /usr/local/bin/mkosi
mkosi --version

Python installation methods

mkosi can also be installed straight from the git repository url using pipx:

pipx install git+https://github.com/systemd/mkosi.git
mkosi --version

which will transparently install mkosi into a Python virtual environment and a mkosi binary to ~/.local/bin. This is, up to the path of the virtual environment and the mkosi binary, equivalent to

python3 -m venv mkosivenv
mkosivenv/bin/pip install git+https://github.com/systemd/mkosi.git
mkosivenv/bin/mkosi --version

You can also package mkosi as a zipapp that you can deploy anywhere in your PATH. Running this will leave a mkosi binary in builddir/

git clone https://github.com/systemd/mkosi
cd mkosi
tools/generate-zipapp.sh
builddir/mkosi --version

Besides the mkosi binary, you can also call mkosi via

python3 -m mkosi

when not installed as a zipapp.

Please note, that the python module exists solely for the usage of the mkosi binary and is not to be considered a public API.

kernel-install plugin

mkosi can also be used as a kernel-install plugin to build initrds. To enable this feature, install kernel-install/50-mkosi.install into /usr/lib/kernel/install.d. Extra distro configuration for the initrd can be configured in /usr/lib/mkosi-initrd. Users can add their own customizations in /etc/mkosi-initrd.

Once installed, the mkosi plugin can be enabled by writing initrd_generator=mkosi-initrd to /usr/lib/kernel/install.conf or to /etc/kernel/install.conf.

Hacking on mkosi

To hack on mkosi itself you will also need mypy, for type checking, and pytest, to run tests. We check tests and typing in CI (see .github/workflows), but you can run the tests locally as well.

References

Community

Find us on Matrix at #mkosi:matrix.org.

mkosi's People

Contributors

afreof avatar behrmann avatar bluca avatar cmarcelo avatar cornelicorn avatar daandemeyer avatar davide125 avatar dellgreen avatar eliasp avatar fbuihuu avatar foxxx0 avatar fsateler avatar fthiery avatar gdiscry avatar gsegatti avatar keszybz avatar killermoehre avatar l3n41c avatar lucasdemarchi avatar lucaswerkmeister avatar lukeshu avatar malt3 avatar mcassaniti avatar mrc0mmand avatar nekkodroid avatar poettering avatar pyfisch avatar richardmaw-codethink avatar septatrix avatar werkov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.