How do I create a Custom Fedora ISO

How do I create a custom Fedora ISO with a KickStart file ?

So far everything I have tried has resulted in me being stuck in bootmenu.

Steps I have taken:

  1. Copy all the files from a Fedora Workstation image into a folder.

  2. Copy the Kickstart file into the folder where the images were copied.

  3. Run the following command generate the ISO file:

genisoimage -U -r -v -T -J -joliet-long -V "Fedora-WS-Live-31-1-9" -volset "Fedora-WS-Live-31-1-9" -A "Fedora-WS-Live-31-1-9" -b isolinux/isolinux.bin -c isolinux/[boot.cat](http://boot.cat/) -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot -o ../Fedora_Custom.iso .

  1. Use the image for booting.

Booting does not work I am stuck on this menu
d2438a220f54a237eda3b1218b4d2a8d75266ad8.png

I dont know what I am wrong, as there is (almost) no difference between the Fedora Workstation image and my custom ISO.

What am I doing wrong ?

Thanks.

You may have better output following the instructions on this page. I’ve created custom Live ISO images before using livecd-tools. They were successful. Try that

You have to tell the boot load to actually look for the kickstart file. Otherwise it will not be picked up.
So the grub boot config should come along with something like inst.ks=...:/ks.cfg

In case if Fedora 31 and UEFI boot, and given that your kickstart file is in the root of the image and is called kickstart.ks, change EFI/BOOT/grub.cfg from:

menuentry 'Install Fedora 31' --class fedora --class gnu-linux --class gnu --class os {
	linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=Fedora-S-dvd-x86_64-31 quiet
	initrdefi /images/pxeboot/initrd.img
}

to

menuentry 'Install Fedora 31' --class fedora --class gnu-linux --class gnu --class os {
	linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=Fedora-S-dvd-x86_64-31 quiet inst.ks=hd:LABEL=Fedora-S-dvd-x86_64-31:/kickstart.ks
	initrdefi /images/pxeboot/initrd.img
}
1 Like

@sreyan32 In your first post you mentioned that you copied the kickstart file. That is what is meant with .ks files, it is just your kickstart file.

Also what you have shown is for GRUB, how do I do that for ISOLINUX ?

You add the same term to the append line.

The documentation is horrible. If I was allowed to swear I would. THE DOCS ARE HORRIBLE.

I am not even sure if this is documented with Fedora. What documentation were you using if I may ask? Also, the RHEL 7 documentation is as usual awesome, and can be easily adopted to Fedora.

I don’t mean anything personally to you, but the I am amazed at how you get around to customizing anything in Fedora.

Personally, why would you try to create customized iso images? If you need to do customization, isn’t the way better way to do a minimum installation and connect the machines to an automation system to do the rest?

Diligence pays off … especially when you’re learning/running Fedora. If you are in a hurry, some documentation will appear aggravating. It becomes easy to miss vital information that is right under your nose. Your questions were actually answered in that page I shared above.

Just before the section titled “Making the Image” you’ll see Creating a kickstart file. That should be relevant too.

For convenience, you can install reference *.ks files for study or composing Spins with dnf. Simply do:

sudo dnf install custom-kickstarts fedora-kickstarts

You can find the reference *.ks files with:
sudo rpm -ql custom-kickstarts

Patience. Enjoy Fedora

2 Likes

Do you really need to create your custom Live ISO or would it be sufficient to be able to install Fedora following a kickstart recipe?

2 Likes

I’m curious. How does a Netinstall route differ from the kickstart recipe?

Fedora Wiki

If I don’t create custom images then how can I install from a Kickstart file ? Tell me something, without using an FTP server how can I load a Kickstart file ?

Please just tell me how I can use a Kickstart file without using a FTP server.

There is no docs that I found that tell me how to use a Kickstart file from the install ISO.

I mean the file has to present for me to do inst.ks=, so how do I supply that to it ?

I am curious as to why you think Netinstall is similar to the kickstart recipe ?

Can you format a partition with LUKS2 in NetInstall ?

You know what I dont like about the Fedora Documentation - its incomplete. Even the tutorial that you shared won’t work.

It itself had a bug that I had to correct:

livecd-creator --verbose \
--config=/path/to/kickstart/file.ks \
--fslabel=Image-Label \
--cache =/var/cache/live

The above won’t work because there is a bug in a dependent package that livecd-creator uses called pykickstart.

Specifically in this line of pykickstart/load.py:

def _load_file(filename):
    '''Load a file's contents and return them as a string'''

    try:
        if six.PY3:
            with open(filename, 'rb') as fh:
                contents = fh.read().decode("utf-8")
        else:
            with open(filename, 'r') as fh:
                contents = fh.read()
    except IOError as e:
        raise KickstartError(_('Error opening file: %s') % str(e))

    return contents

The filename variable is passed in without the path information so every filename refers to the current working directory.

Thankfully, this Python and not C, so I can patch the file without any compilation nonsense.

So I add in the line:

filename = '/use/share/spin-kickstarts/' + filename
just at the start of the function.

But wait, its not over.

Now the livecd-creator command now works, but while running the command I find that

bcm283x-firware
is not found. So I have go into to /usr/share/spin-kickstarts/fedora-disk-base.ks and comment out the above package.

Yeah and all this does not answer my question,

can you add certain files to the custom ISO ?

Wonder if all of Open Source is like this ? :cry:

1 Like

define “certain files”

Of course you can.

The distribution is only as good as its community. It is the community’s task to fix and complete the documentation. Don’t hesitate to contribute!!

2 Likes

Like adding a kickstart file.

How do I do that ?

1 Like

Really ? Would you plese tell me how to do that ?

If its anything like this then please note that its LUKS1 and not LUKS2.

But if I am wrong and you know how to create a LUKS2 partition and then use LVM on it, please let me know IMMEDIATELY.

I would LOVE TO.

In fact the documentation is missing certain things like how to create LVM on LUKS and the bug I mentioned earlier. Just tell me how I can contribute. Problem is I have never actually contributed hence I am unfamiliar with the whole process.

2 Likes

https://docs.fedoraproject.org/en-US/fedora-docs/contributing/

For wiki, you need to be in a group other than CLA related ones.

According to this change tracker, the default should be LUKS2. See also Issue #282: F30 System-Wide Change: Switch cryptsetup default metadata format to LUKS2 - release-notes - Pagure.io

The issue could be the following. Grub cannot yet handle LUKS, so if your /boot resides in the encrypted LUKS2 you won’t be able to boot using Fedora’s default grub. Seems like GNU is working on a fix: GNU GRUB - Bugs: bug #55093, Add LUKS2 support [Savannah]. See the setup example in the Arch wiki here

May I ask you why LUKS2?

What do you mean by CLA ? I dont understand.

In order to contribute to Fedora, you need to sign a CLA (Contributor License Aggreement) at the FAS website. There are groups in the FAS, and you need to be a member of a group other than CLA related ones in order to edit wiki.
https://fedoraproject.org/wiki/Help:Editing#Gaining_Edit_Access

1 Like

The change tracker lists out the exact problem I have. Now, please note that my /boot is in an completely unencrypted partition. Therefore, I can’t understand why you won’t use LUKS2. Also the /boot directory contains all my bootable kernels. So I really don’t see any reason why LUKS2 cannot be used, as it was promised.

Because I want to be on the latest and greatest and seems weird that LUKS2 has been around for a fair amount of time and still not fully supported by Anaconda.

The last post on the above link basically tells you why. Efficiency is the main reason.