How to build Sway ISO
How to
This is a guide how you can easily build the Sway Live iso from this repository. Follow the steps below and everything should went well.
Setup
Two packages are required to build the ISO.
-
pykickstart
-
ksflatten
tool is required to merge %includes in the kickstart file
-
-
lorax-lmc-virt
- The
livemedia-creator
tool to run the machinery
- The
RPM based system
You need to have pykickstart
and lorax-lmc-virt
in your system.
sudo dnf install -y pykickstart lorax-lmc-virt
OSTree base system
You need this packages too but you can use podman
to avoid layering. However the LMC tool requires loop devices pre-created before the container creation. So we need to prepare them before creating the container (the container then remembers them even between reboots of the host and can freely work with them).
To create the loop devices:
sudo mknod -m 0660 /dev/loop0 b 7 0
sudo mknod -m 0660 /dev/loop1 b 7 1
And then create the container by this call in the base of this repository:
sudo podman run -ti --privileged --name=lorax \
--tmpfs /var/tmp:rw,mode=1777 \
-w /work \
-v $PWD:/work:z \
fedora:37
In the container install the packages mentioned above:
dnf install -y pykickstart lorax-lmc-virt
You are all done. For future ISO builds you can just run sudo podman start --attach lorax
.
Get the ISO for building
The lorax-lmc-virt
will build the ISO by running Anaconda in the VM with the given kickstart file. For that to happen you need to have an ISO with the Anaconda. Any installation boot.iso
(net install) will work here but you need ISO from the given release.
First create a build directory:
mkdir build
Then download the ISO (change the fedora version based on what you want to build):
curl -L https://dl.fedoraproject.org/pub/fedora/linux/development/37/Everything/x86_64/iso/Fedora-Everything-netinst-x86_64-37-20220816.n.0.iso -o ./build/f37-boot.iso
Build the Live ISO
Follow the guide here to build the container. For OSTree based systems run these inside of the container created above.
Add our repositories
You need to add our copr repository and device if you want to build Rawhide or not. The easiest way is to change fedora-repo.ks
. Comment/uncomment lines to include rawhide or non-rawhide version and add:
url --url=https://download.copr.fedorainfracloud.org/results/@sway-sig/sway-spin-dev/fedora-$releasever-$basearch/
to the file.
Merge kickstart files
Use the ksflatten
tool for this:
ksflatten -c ./fedora-live-sway.ks -o ./build/out.ks
The fedora-live-sway.ks
kickstart file is the leaf of the includes. This command will generate out.ks
having everything in one file.
Build!
To start the build run:
cd build
livemedia-creator --ks=./out.ks \
--project=Fedora-Sway-Live \
--make-iso \
--volid=Fedora-Sway-Live-37 \
--iso-only \
--iso=./f37-boot.iso \
--releasever=37 \
--macboot \
--resultdir ./result
The build is harder to follow but just give it a time and in case of failure the installation output is in ./build/virt-install.log
.
Happy Live ISO building.