#9 Docs: Tell how to do a DIY custom local iso build
Closed by tdawson. Opened by tdawson.

We have a page saying a bit about how SIG members can build the images on the CBS Koji site, but we don't have anything about creating custom iso's locally.

Write something up.
This was inspired from this discussion:
https://discussion.fedoraproject.org/t/centos-stream-live-iso/102067/6


Something like this would work for a starting point.

We use Kiwi to create the Live images, and it works great locally. In fact, you don't even have to have kiwi installed locally, it can all be done via podman and containers.

USER - Do this as a regular user
ROOT - Do this as root or sudo. We will assume you are root. It is best to do this in a different screen/console than the one you are using for USER. That way you don't have to re-setup your container each time you attempt an image build.
CROOT - This is done as root in our container

First - make sure you can do a non-custom build.

  • USER mkdir /var/tmp/kiwi ; cd /var/tmp/kiwi
  • USER git clone https://pagure.io/centos-sig-alt-images/kiwi-descriptions.git
  • USER cd kiwi-descriptions ; git checkout c9s
  • ROOT cd /var/tmp/kiwi/kiwi-descriptions
  • ROOT podman pull quay.io/centos/centos:stream9
  • ROOT podman run --privileged --rm -it -v /dev:/dev -v $PWD:/code:z -w /code quay.io/centos/centos:stream9 /bin/bash
    You should now be in a CentOS Stream 9 container.
  • CROOT dnf -y install epel-release ; dnf -y install kiwi policycoreutils
  • CROOT kiwi-ng --type=iso --profile=XFCE-Live --color-output system build --description ./ --target-dir ./outdir
    If everything goes correctly, you should have an iso created in "outdir". Since you have mounted the local directory when you started podman, that file should be /var/tmp/kiwi/kiwi-descriptions/outdir/CentOS-Stream-Image.x86_64-9.iso

The current list of profiles you can choose from is CINNAMON-Live, GNOME-Live, KDE-Live, MATE-Live, MAX-Live, MIN-Live, XFCE-Live.

After you've verified that you can build an image, now do some customizations. Edit whatever you want in the kiwi-descriptions folder (except for the outdir directory) and then run things again.

  • CROOT rm -rf ./outdir
  • CROOT kiwi-ng --type=iso --profile=XFCE-Live --color-output system build --description ./ --target-dir ./outdir

I just looked at our kiwi-descriptions README.
https://pagure.io/centos-sig-alt-images/kiwi-descriptions/tree/c10s

Looks very similar to what I have written above, and in a much better format. Seems like that might have been what I started from. :)

Let's start with the README, put a few more examples in, and put it in our regular Docs section so people can see it from the website.

The page has been created.
https://sigs.centos.org/altimages/diy-local-images/

I am marking this done.

Metadata Update from @tdawson:
- Issue status updated to: Closed (was: Open)

Metadata