When testing things, like in the QA Fedora team, sometimes could be useful the creation of a Fedora iso. This post is about live-media-creator. I mean, for instance, think to anaconda: a new version land on koji, or in updates-testing repository, and you want to test it as soon as possible, without having to wait for a new compose (that is a nightly build).
These are the steps to create a Live iso, with updated packages, and also additional packages. Refer to this previous post in order to set up a local dnf repository containing an updated or an additional rpm package to include in the live iso.
Disclaimer: I don’t know what I’m doing, so refer to https://fedoraproject.org/wiki/Livemedia-creator-_How_to_create_and_use_a_Live_CD to get more information (I grab the following steps from this wiki page). The following steps worked for me.
sudo dnf install mock mock-core-configs
sudo usermod -a -G mock <youruser>
Here you can find the profiles you can build /etc/mock/
You can trick the tool configuration, by creating this configuration file mkdir ~/.config
vi ~/.config/mock.cfg
For example you can use your home directory (maybe there is more disk space) instead of the default location (/var/lib/mock/
)
config_opts['basedir'] = '/home/<user>/tmp/var/lib/mock/'
config_opts['cache_topdir'] = '/home/<user>/tmp/var/cache/mock'
Continue with these steps
sudo setenforce 0
mock -r fedora-29-x86_64 --init
mock -r fedora-29-x86_64 --install lorax-lmc-novirt vim-minimal pykickstart spin-kickstarts
mock -r fedora-29-x86_64 --shell --old-chroot
cd /usr/share/spin-kickstarts
Add the local dnf repository
echo "repo --name=test --baseurl=http://127.0.0.1:8000" >> fedora-repo-not-rawhide.ks
Edit this file if you want to include additional packages in the live iso fedora-workstation-common.ks
, and add the packages names under
%packages
...
python-fedora
gcc
git
koji
“Merge” (by mean of the includes, let’s create a single ks file) the kickstart files
ksflatten --config fedora-live-workstation.ks -o flat-fedora-live-workstation.ks --version F28
livemedia-creator --ks flat-fedora-live-workstation.ks --no-virt --resultdir /var/lmc --project Fedora-Workstation-live-test --make-iso --volid Fedora-Workstation-29-test --iso-only --iso-name Fedora-Workstation-29-live-test-x86_64.iso --releasever 29 --title Fedora-Workstation-live-test --macboot
After a while, supposing that there were no problems, exit from the chroot and you should find the iso here:
~/tmp/var/lib/mock/fedora-29-x86_64/root/var/lmc/Fedora-Workstation-29-live-test-x86_64.iso
Quickly test if the iso works
qemu-system-x86_64 -enable-kvm -localtime -m 2G -vga std -drive file=tmp/var/lib/mock/fedora-rawhide-x86_64/root/var/lmc/Fedora-Workstation-29-live-test-x86_64.iso,readonly,cache=none,format=raw,if=virtio