From Fedora Project Wiki

mNo edit summary
 
(5 intermediate revisions by the same user not shown)
Line 21: Line 21:


* '''mkosi''', currently not used but able to create Fedora images.
* '''mkosi''', currently not used but able to create Fedora images.
* '''lorax''', used for some variants of Fedora.


=== What is a Fedora? ===
=== What is a Fedora? ===


When using any of these tools you have a hard problem to solve. ''What actually is a Fedora?''
When using any of these tools you have a hard problem to solve (or ignore). ''What actually is a Fedora?''
'''
'''
The configuration files for the build tool used by a variant are what defines that variant.''' There is no overarching definition or format.
The configuration files for the build tool used by a variant are what defines that variant.


== Let's build a Fedora ==
== Let's build a Fedora ==
Line 32: Line 33:
If you want to build one of Fedora's variants you should use the build tool used by that variant.
If you want to build one of Fedora's variants you should use the build tool used by that variant.


=== What tool? ===
=== Which tool? ===
 
<!-- fill with some information about pungi and looking up what is used -->
 
==== kiwi ====
 
<pre>
$ sudo dnf install kiwi
$ git clone https://pagure.io/fedora-kiwi-descriptions.git
$ cd fedora-kiwi-descriptions
$ sudo ./kiwi-build --image-type=oem --image-profile=Cloud-Base-Generic --output-dir=output
</pre>
 
kiwi consumes a description format. The Fedora variant descriptions can be found in pagure.
 
==== image-builder ====
 
<pre>
$ sudo dnf install image-builder
$ sudo image-builder build minimal-raw
</pre>
 
image-builder has definitions embedded in code.
 
==== mkosi ====
 
<pre>
$ sudo dnf install mkosi
$ sudo mkosi -d fedora -t disk -p bash,systemd
</pre>
 
mkosi images can be defined through the command-line or in configuration files.
 
==== lorax ====
 
<!-- lorax-quickstart-example -->

Latest revision as of 08:34, 16 February 2025

Building a Fedora

There are many variants of Fedora available for general use, you can use one of the main editions such as Workstation or KDE or perhaps you want to drive one of the Atomic Desktops. There is even more choice with Fedora Spins, or even Fedora Labs.

However, sometimes you just want to build your own Fedora. Maybe you want to try out a new combination of packages, or perhaps you want to fiddle with your perfect partition layout.

This page is about how to (re)build a Fedora on your own hardware. It also goes into how the variants of Fedora are built so you know how to build your own.

Image

In this page you'll see references to image quite a lot. For this page that doesn't mean a nice picture, though the terms are related. An operating system image is an artifact produced by combining a bunch of content into a thing that can be distributed. For example: an ISO, a QCOW2, a raw disk image, an ostree commit, or even a tarball of the root filesystem tree.

How are Fedora's being built?

There are a bunch of tools involved with building Fedora. For now we'll skip over all the orchestration involved and jump directly to those currently used:

  • kiwi, used for most variants of Fedora.
  • image-builder, used for some variants of Fedora.

You can also use:

  • mkosi, currently not used but able to create Fedora images.
  • lorax, used for some variants of Fedora.

What is a Fedora?

When using any of these tools you have a hard problem to solve (or ignore). What actually is a Fedora? The configuration files for the build tool used by a variant are what defines that variant.

Let's build a Fedora

If you want to build one of Fedora's variants you should use the build tool used by that variant.

Which tool?

kiwi

$ sudo dnf install kiwi
$ git clone https://pagure.io/fedora-kiwi-descriptions.git
$ cd fedora-kiwi-descriptions
$ sudo ./kiwi-build --image-type=oem --image-profile=Cloud-Base-Generic --output-dir=output

kiwi consumes a description format. The Fedora variant descriptions can be found in pagure.

image-builder

$ sudo dnf install image-builder
$ sudo image-builder build minimal-raw

image-builder has definitions embedded in code.

mkosi

$ sudo dnf install mkosi
$ sudo mkosi -d fedora -t disk -p bash,systemd

mkosi images can be defined through the command-line or in configuration files.

lorax