Creating a Custom Fedora Server ISO with MATE Desktop Modifications

Daniel-TI-LINUX

New Member
Joined
Aug 25, 2024
Messages
10
Reaction score
2
Credits
104
Hello everyone, I started a project to modify a Fedora to suit my company, and we decided to use Fedora Server. I installed the MATE desktop environment, but I would like to know how I can create an ISO with the modifications I have already made so that it can become an installable ISO with these changes?
 


This can get tricky.
I personally would do something like this with kickstart.

It could be done with two USB sticks also.

A good starting point is your anaconda.cfg file in /root

Code:
cat anaconda-ks.cfg
# Generated by Anaconda 41.35
# Generated by pykickstart v3.58
#version=DEVEL

# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8

# Network information
network --bootproto=dhcp --device=enp38s0 --ipv6=auto --activate
network --hostname=absTower

%packages
@^kde-desktop-environment
@admin-tools
@c-development
@development-tools
@domain-client
@firefox
@games
@headless-management
@kde-apps
@kde-media
@kde-pim
@libreoffice
@office
@rpm-development-tools
@text-internet

%end

# Run the Setup Agent on first boot
firstboot --enable

# Generated using Blivet version 3.11.0
ignoredisk --only-use=sdb
# Partition clearing information
clearpart --none --initlabel
# Disk partitioning information
part swap --fstype="swap" --ondisk=sdb --size=12288
part /var --fstype="xfs" --ondisk=sdb --size=35840
part / --fstype="xfs" --ondisk=sdb --size=46080
part /boot/efi --fstype="efi" --ondisk=sdb --size=340 --fsoptions="umask=0077,shortname=winnt"
part /home --fstype="xfs" --ondisk=sdb --size=394240
part /boot --fstype="xfs" --ondisk=sdb --size=3072

# System timezone
timezone America/Los_Angeles --utc

# Root password
rootpw --iscrypted --allow-ssh $y$j9T$abcdefghijklmnopqrstuvwxyz123456789
user --groups=wheel --name=elvis --password=$y$j9T$$123456789abcdefghijklmnopqrstuvwxy

This is mine, obviously I'm not using MATE, but you get the idea. The password strings have been changed.
Use yours as a baseline.

Now the second question is.. are all of the rpms you installed on the vendor iso image?
If you're using a netinstall, are all of the packages included in the fedora repos?

If not, you'll have to add some custom repos.
 
Last edited:
Here is a MATE one I did a couple of years ago, with a custom repo.

Code:
# Generated by Anaconda 39.32.6
# Generated by pykickstart v3.48
#version=DEVEL
url --url='http://ftp-chi.osuosl.org/pub/fedora/linux/releases/39/Everything/x86_64/os/'
repo --name="custom" --baseurl='http://192.168.7.129/pub/fedora39srv/extras/'
# Use graphical install
graphical
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8
# SElinux Status
selinux --disabled
# Systemd Services
services --enabled='sshd'
# Firewall Settings
# firewall --enabled
# Network information
network --bootproto=dhcp --device=eno2 --ipv6=auto --activate
network --bootproto=dhcp --device=enp0s20f0u1 --ipv6=auto --activate
network --hostname=dell-lt
%packages
@^mate-desktop-environment
@compiz
@editors
@headless-management
@libreoffice
@mate-applications
@office
@rpm-development-tools
@text-internet
-nano-default-editor
vim-default-editor
wine
ansible
rpmfusion-free-release
rpmfusion-nonfree-release
%end
# Run the Setup Agent on first boot
firstboot --disable
eula --agreed
# Reboot after installation
reboot
# Generated using Blivet version 3.8.1
ignoredisk --only-use=nvme0n1
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --fstype="xfs" --ondisk=nvme0n1 --size=3072
part /boot/efi --fstype="efi" --ondisk=nvme0n1 --size=220 --fsoptions="umask=0077,shortname=winnt"
part pv.370 --fstype="lvmpv" --ondisk=nvme0n1 --size=485093
volgroup fedora39_lvm --pesize=4096 pv.370
logvol /home --fstype="xfs" --size=20480 --name=home --vgname=fedora39_lvm
logvol swap --fstype="swap" --size=8192 --name=swap --vgname=fedora39_lvm
logvol / --fstype="xfs" --size=25600 --name=root --vgname=fedora39_lvm
logvol /pub --fstype="xfs" --size=397022 --name=pub --vgname=fedora39_lvm
logvol /var --fstype="xfs" --size=18432 --name=var --vgname=fedora39_lvm
# System timezone
timezone America/Los_Angeles --utc
# Root password
rootpw --iscrypted $y$j9T$abc123
user --groups=wheel --name=willywonka --password=$y$j9T$123abc --iscrypted --gecos="willy"

It is a little interesting that you are running xWindows on a server. Not a problem.

You can add a post section at the bottom of this file. Run some custom commands in here.
This example just copies a dhcpd.conf file over so that dhcpd will automatically start.

Code:
# Reboot when finished
reboot

%post --erroronfail --log=/root/post-install.log

dnf config-manager --set-enabled crb

rm /etc/dhcp/dhcpd.conf
cd /etc/dhcp
wget http://192.168.7.129/pub/kickstart/dhcpd.conf

systemctl enable dhcpd.service

rm /etc/nginx/nginx.conf
cd /etc/nginx
wget http://192.168.7.129/pub/kickstart/nginx.conf
ln -s /pub /usr/share/nginx/html/pub

cd /var/lib/tftpboot
wget -r --no-parent -nH --cut-dirs=2 -P /var/lib/tftpboot http://192.168.7.129/pub/tftpboot/
chmod -R 777 /var/lib/tftpboot
find /var/lib/tftpboot -type f -name 'index.html' -exec rm -f {} \;

cd /pub
wget -r --no-parent -nH --cut-dirs=1 -P /pub http://192.168.7.129/pub/
chmod 777 *
find /pub -type f -name 'index.html' -exec rm -f {} \;

cd /root
wget http://192.168.7.129/pub/firstboot/kickstart-srv/firstboot.sh
chmod 744 firstboot.sh
echo "@reboot root /bin/bash /root/firstboot.sh" >> /etc/crontab

%end
 
Last edited:
You can create a USB drive ( the smaller the better, it will only have one very small file on it )
Format it in fat32.
Important: Label it "OEMDRV"
Copy your customized anaconda.cfg to the root directory of this drive.

Now when you boot from the installer, it will read this file.

 

Members online


Latest posts

Top