This page shows you how to build a Fedora ISO image you can use for testing. The examples reference the Fedora Rawhide repository, but the same instructions apply for any release of Fedora. The tutorial requires that you open a root shell. To access a root shell, open a terminal and run the command su -
, and provide the root password.
Setup
For the duration of the build process, wwitch your system to SELinux permissive mode:
sudo setenforce 0
In order to create Fedora ISO images, you must use a Fedora release that matches the release of the desired ISO images. For example, to create Fedora Rawhide images, you need to be running Fedora Rawhide. The examples in this document use mock
to simulate the target environment and create ISO images. If you already have a system available running the target release, the use of mock is not required.
- First, install the necessary packages
dnf install mock
- Adjust the mock configuration to allow bind mounts needed to support compose image generation. Add the following lines to the appropriate mock configuration. For example, for Fedora Rawhide, update
/etc/mock/fedora-rawhide-x86_64.cfg
to include the following:config_opts['plugin_conf']['bind_mount_enable'] = True config_opts['plugin_conf']['bind_mount_opts']['dirs'].append(('/dev','/dev/')) config_opts['plugin_conf']['bind_mount_opts']['dirs'].append(('/dev/pts','/dev/pts/')) config_opts['plugin_conf']['bind_mount_opts']['dirs'].append(('/dev/shm','/dev/shm/'))
- Initialize the mock chroot
mock -r fedora-rawhide-$(uname -m) --init
- Prepare the mock chroot for running
pungi
by installing packages into the chrootmock -r fedora-rawhide-$(uname -m) --install spin-kickstarts pungi ${EDITOR:-vi}
Create a local mirror (optional)
This section is optional. You can use a nearby official Fedora mirror over a broadband connection. However, you may find it useful to mirror Rawhide locally if you regularly participate in testing. Note that the mirrormanager
package may be useful in some situations. Refer to the detailed MirrorManager page for more information.
- If you don't have Rawhide available on a fast, local link, you may want to mirror it locally using
rsync
. Find a nearby mirror at http://mirrors.fedoraproject.orgmkdir -p /var/www/fedora/linux/development/$(uname -m)/os cd /var/www/fedora/linux/development/$(uname -m)/os rsync -Pavy --delete-after <MIRROR_NEAR_YOU>::/pub/fedora/linux/development/rawhide/$(uname -m)/os/ .
- In the mock chroot, edit the kickstart configuration file used by pungi.
mock -r fedora-rawhide-$(uname -m) --shell ${EDITOR:-vi} /usr/share/spin-kickstarts/fedora-install-fedora.ks
-
Remove (or comment out) the existing
repo --name=fedora
line and add a new entry for the local mirror. Using the example above, you would end up with ...repo --name=fedora --baseurl=file:///var/www/fedora/linux/development/$basearch/os
- When finished, save your changes and exit the chroot by pressing
Ctrl-D
or typinglogout
Build a boot.iso
This section assumes you have installed the mock
package and prepared the mock chroot as suggested in #Setup. If you haven't completed those steps, please do so now. This section provides instruction on creating PXEboot and boot.iso
images only. To create an installable -DVD.iso
image, see #Build_a_DVD_ISO.
Option a) Using pungi
pungi
is what Fedora Release Engineering uses when creating an install image.
- Activate a shell inside the mock chroot
mock -r fedora-rawhide-$(uname -m) --shell
- Next, create a DVD (this may take a while)
pungi --nosource --nodebuginfo -G -C -B \ --flavor Fedora --name Fedora --ver rawhide \ -c /usr/share/spin-kickstarts/fedora-install-fedora.ks
- If the previous command completed without errors, you now have PXEboot images and a
boot.iso
available in your chroot. Exit the mock shell, and copy the ISO image out of the chroot.mock -r fedora-rawhide-$(uname -m) --copyout /rawhide/Fedora/$(uname -m)/os/images/boot.iso /tmp/
Option b) Using lorax
lorax
allows you to create the install image quicker without all of the pungi
overhead.
The lorax command is:
sudo lorax -p Fedora -v 37 -r 37 --repo=/etc/yum.repos.d/fedora.repo --repo=/etc/yum.repos.d/side.repo --rootfs-size 3 ./results
where 37
is the Fedora version for which you want to create the image. side.repo
is a repository containing extra packages you want to include on top of standard stable packages, must be created beforehand. ./results
is a results directory which must not exist when running the command.
Build a DVD.iso
This section assumes you have installed the mock
package and prepared the mock chroot as suggested in #Setup. If you haven't completed those steps, please do so now.
- Activate a shell inside the mock chroot
mock -r fedora-rawhide-$(uname -m) --shell
- Next, create a DVD (this may take a while)
pungi --nosource --nodebuginfo \ --flavor Fedora --name Fedora --ver rawhide \ -c /usr/share/spin-kickstarts/fedora-install-fedora.ks
- If the previous command completed without errors, you now have a DVD ISO image in your chroot. Before proceeding, validate the ISO images using the
sha256sum
commandcd /rawhide/Fedora/$(uname -m)/iso sha256sum -c Fedora-rawhide-$(uname -m)-CHECKSUM
- Exit the mock shell, and copy the ISO image out of the chroot and have fun ...
mock -r fedora-rawhide-$(uname -m) --copyout /rawhide/Fedora/$(uname -m)/iso/Fedora-rawhide-$(uname -m)-DVD.iso /tmp/
Build process teardown
Don't forget to switch your system back to SELinux enforcing mode after the build is complete:
sudo setenforce 1
Testing a release candidate
As indicated in the release engineering schedule, special candidate ISO images are made available for QA at the dl.fedoraproject.org staging site. You can simply download a release candidate from this site. Depending on your transfer speeds, you may have to wait a while to complete the download.
One solution is to use the rsync
command to upgrade your local Fedora DVD ISO image to match the remote image. The assumes you have already built or downloaded a Fedora DVD ISO image, and the contents of your image are reasonably close to the state of the remote ISO image.
After running rsync
, the resulting DVD ISO image can be verified as identical using the sha256sum
command.
- Get the official file name of the DVD from the mirror. Note the directory location and the file name.
- Rename your local DVD ISO image to match the file name used on the remote location.
mv Fedora-rawhide-$(uname -m)-DVD.iso Fedora-16-$(uname -m)-DVD.iso
- Use
rsync
to download the required bits to match your DVD to the original. The switches below deliver stats as you download, and effectively minimize the amount of downloading. Note that the location shown is an example only.rsync -Pavy dl.fedoraproject.org::fedora-stage/16-Final.RC1/Fedora/$(uname -m)/iso/Fedora-16-$(uname -m)-DVD.iso .
- Use the
sha256sum
command to test the image for integrity. The resulting checksum should be identical to that shown in the*-CHECKSUM
file that accompanies the image on the staging site.sha256sum Fedora-16-x86_64-DVD.iso
References
- For additional information on using
pungi
, see the Pungi documentation. - For additional information on using
mock
, see Projects/Mock.