In order to build images in koji you need to have a kickstart file. This page will try to help you avoid too much frustration by telling you what options you need and why.
all of the kickstart options are laid out in the anaconda teams kickstart page that can be found Anaconda/Kickstart Here
Required Kickstart Arguments
Anaconda of course requires many commands to be defined in the kickstart file. If you're starting from scratch you should review the reference linked above, or use an existing kickstart file in the spin-kickstarts git repo. It is critically important that the installation be completely automated, if Anaconda has to prompt for input for any reason, the build will fail because you cannot send input to the guest. Some of the kickstart commands are optional to Anaconda, but are required in koji for your build to succeed. Here's the list and the reasons why.
- zerombr: You must tell Anaconda to wipe out the MBR in the virtual block device, if you don't Anaconda will ask you.
- clearpart --all --initlabel: Anaconda has to be told to wipe out all data on the virtual block device we install on otherwise it will ask for confirmation to do so. Since it is blank anyway this is harmless.
- reboot: When the installation completes, the guest is rebooted. ImageFactory is specifically looking for this behavior to conclude the installation completed. Anaconda's default behavior is to wait for a key press to reboot the system, but this is impossible from outside of Brew.
- You have to lock the root account (rootpw --lock) or create a non-root user (user), otherwise Anaconda will prompt for one.
- Be careful with the url command. The repo commands are overridden by koji to point to internal Koji repos, or what you specified on the command line with --repo, it does not override the url command if you provided it. If Koji sees an RPM was installed that was not built in the system, it will fail the build.
- If you want to ship the image as part of Fedora SELinux must be enabled and enforcing.
Recommended Kickstart Arguments
Often you want a %post section in your kickstart to perform post-installation configuration steps. Review that section of the reference and note that you can specify --log and --interpreter. Both of these are recommended (but not required) to assist with the development and debugging process. Here are some other recommendations:
- You probably want the network to use dhcp, sshd to be started, and port 22 opened in the firewall to allow access as well.
- Images that will be used in cloud deployments like OpenStack or EC2 should have cloud-init in the package list.
- It is discouraged to have root passwords in plaintext in your kickstart file.
- If your %post section is written in bash, consider setting -x.
- For images that have multiple partitions, use the --asprimary option for the part command that defines the root file system. This will ensure it is the first partition on the image, which is a requirement in some cloud environments like EC2.
Getting Help
As usual ask rel-eng@lists.fedoraproject.org for help via email, file a ticket in trac https://fedorahosted.org/rel-eng/ or ask in #fedora-releng on Freenode