Skip to content

DIY Local

How hard is it to create your own, custom, Alternative Images?

Not very hard. You can do it with kiwi, in a container.

Overview

It is recommended that you first make sure you can create a standard image before you make a custom image. This way you will be sure that you have everything setup correctly.

Thus, if it fails, you will know that it was your change that caused it to fail.

Setup

Download AltImages git repo

cd /my/builddir ; git clone https://pagure.io/centos-sig-alt-images/kiwi-descriptions.git

Start in the branch you want

cd kiwi-descriptions ; git checkout c9s

Building

Note

All the Building steps should be run as root. Either directly or as sudo

Set into permissive mode

getenforce ; setenforce permissive ; getenforce

cd to git repo

cd /my/builddir/kiwi-descriptions

Pull, then run the container image. For our example we will use CentOS Stream 9.

podman pull quay.io/centos/centos:stream9
podman run --privileged --rm -it -v /dev:/dev -v $PWD:/code:z -w /code quay.io/centos/centos:stream9 /bin/bash

Inside our image, install all the needed software, then run the kiwi command.

dnf -y install epel-release
dnf -y install kiwi policycoreutils
kiwi-ng --type=iso --profile="XFCE-Live" --color-output system build --description="." --target-dir ./outdir

Other Examples:

kiwi-ng --type=tbz --profile="WSL-Base" --color-output system build --description="." --target-dir ./outdir
kiwi-ng --type=oem --profile="XFCE-Disk" --color-output system build --description="." --target-dir ./outdir
kiwi-ng --type=iso --profile="GNOME-Live" --color-output system build --description="." --target-dir ./outdir

After the build

Get your image from the outdir directory

ls /my/builddir/kiwi-descriptions/outdir

Test the image however you want. Just remember to get it out of the outdir if you want to keep it.

Misc

If you stay logged into your container, you can build as many images based on that distribution that you want. You just need to remove the outdir before running the next one.

rm -rf ./outdir ; kiwi-ng --type=iso --profile="XFCE-Live" --color-output system build --description="." --target-dir ./outdir
# Copy or move the image to your testing area.
rm -rf ./outdir ; kiwi-ng --type=iso --profile="MIN-Live" --color-output system build --description="." --target-dir ./outdir
# Copy or move the image to your testing area.
rm -rf ./outdir ; kiwi-ng --type=iso --profile="KDE-Live" --color-output system build --description="." --target-dir ./outdir
# Copy or move the image to your testing area.