Git Product home page Git Product logo

mkosi-kernel's Introduction

mkosi-kernel

This repository hosts mkosi configuration files intended for kernel development using mkosi. By default, a an image is built which is booted with qemu's direct kernel boot and VirtioFS.

To get started, write the distribution you want to build to mkosi.local.conf in the root of the repository in the Distribution section. Currently CentOS, Fedora and Debian are supported. For example, for fedora, write the following:

[Distribution]
Distribution=fedora

Then, to build the image and boot it, run the following:

$ mkosi -f qemu

To exit qemu, press ctrl+a followed by c to enter the qemu monitor, and then type quit to exit the VM. Alternatively, run systemctl poweroff.

To build your own kernel, add the following to mkosi.conf:

[Config]
@Include=modules/kernel

[Content]
BuildSources=<path-to-your-kernel-sources>:kernel

If you want to mount a directory into the qemu VM, you can add the following:

[Host]
RuntimeTrees=<path-to-sources>:/path/in/guest

Now run mkosi -f qemu again and a custom kernel will be built and booted instead of the default one. The kconfig file will be picked up from the kernel source tree at mkosi.kernel.config. If it does not exist and the $CONFIG environment variable (set using Environment=) is not set, the default config file shipped with this repository (mkosi.kernel.config) is used instead. Alternatively, --config (or -c) can be used to pass the config path to use via the command line (e.g. mkosi -f build -c <path-to-config>).

To build the selftests, set SELFTESTS=1 using Environment=. SELFTESTS_TARGETS= can be used to only build specific selftests targets. SELFTESTS_SKIP_TARGETS= can be used to skip specific selftests targets, such as bpf which can take a long time to rebuild.

For each kernel, the out-of-tree build subdirectory used is synthesized from the localversion files in the given kernel source tree, the CONFIG_LOCALVERSION setting in the configuration and the $LOCALVERSION environment variable.

Various other modules are supported as well. For example, to use the btrfs-progs module to bulid and install btrfs-progs:

[Config]
@Include=modules/btrfs-progs

[Content]
BuildSources=<path-to-your-btrfs-progs-sources>:btrfs-progs

The same applies to the other modules (fstests, ltp, blktests, bpfilter).

To enable multiple modules, you can do the following:

[Config]
@Include=modules/btrfs-progs
         modules/kernel

[Content]
BuildSources=<path-to-your-btrfs-progs-sources>:btrfs-progs
             <path-to-your-kernel-sources>:kernel

To temporarily disable building a specific module, you can simply comment out the relevant BuildSources= entry without disabling the module itself.

Requirements

This configuration will download the required tools to build and boot the image on the fly. To use this configuration, the following tools have to be installed:

  • mkosi v19
  • python 3.9 (Set $MKOSI_INTERPRETER to point to an alternative interpreter)
  • bubblewrap
  • package manager of the distribution you're building
  • coreutils
  • util-linux

Contributing

All package and kconfig lists must be sorted using sort -u.

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.