Today is the third guest article in a row, and is one more article about Kickstart. There will be more Kickstart articles, but we’ll release those in time. This is the third one in a row, so we’ll try to mix it up a bit.
By now, we should all have at least a little familiarity with Kickstart. Frankly, I’ve still not had a chance to use it – but it does seem like it’d be fun to play around with it. If I were an admin of anything major, I’d definitely look to Kickstart as a solution. Again, if you read this on day one, be sure to check back later as the author may suggest some edits.
See the previous articles here:
Guest Article: Kickstart Vol. I
Guest Article: Kickstart Vol. II
Now we need to create a menu for your Kickstart, so you can select which OS you want to install.
cd /var/lib/tftpboot/efi
Now edit a new file named grub.cfg. It must be named grub.cfg. Here is an example of what it should look like.
function load_video { insmod efi_gop insmod efi_uga insmod video_bochs insmod video_cirrus insmod all_video insmod gfxterm terminal_output gfxterm loadfont fonts/unicode.pf2 insmod gfx_term_background insmod png background_image -m stretch splash.png } load_video set gfxpayload=keep insmod gzio set default="1" set timeout="4" menuentry 'Install Fedora32' { echo "Loading efi/fed32/vmlinuz" linuxefi efi/fed32/vmlinuz inst.repo=http://192.168.7.227/pub/fed32srv/dvd/ ip=dhcp inst.ks=http://192.168.7.227/pub/fed32srv/fed32.cfg inst.text echo "Loading efi/fed32/initrd.img" initrdefi efi/fed32/initrd.img echo "Booting installation kernel" } menuentry 'Install Fedora35' { echo "Loading efi/fed35/vmlinuz" linuxefi efi/fed35/vmlinuz inst.repo=http://192.168.7.227/pub/fed35srv/dvd/ ip=dhcp inst.ks=http://192.168.7.227/pub/fed35srv/fed35.cfg inst.text echo "Loading efi/fed35/initrd.img" initrdefi efi/fed35/initrd.img echo "Booting installation kernel"}menuentry 'Install Redhat9' { echo "Loading efi/rh9/vmlinuz" linuxefi efi/rh9/vmlinuz inst.repo=http://192.168.7.227/pub/rh9srv/dvd/ ip=dhcp inst.ks=http://192.168.7.227/pub/rh9srv/rh9.cfg inst.text echo "Loading efi/rh9/initrd.img" initrdefi efi/rh9/initrd.img echo "Booting installation kernel"}
The set-default lets you pick which is the default install, it starts at zero, so the options here would be 0, 1 and 2.
Note the IP address of my Kickstart server is here, the path to my extracted iso directory is here, and the location of my boot kernels is here.You can change all of these to fit your needs.
Now we need the actual anaconda-kickstart.cfg files, this is what actually does all the work.The location of these, is set in the grub.cfg file above. You will want these to be in the extracted iso directory, but not in the “dvd” sub-directory.
Here is an example of what one of these would look like. This one is fairly basic.
# Generated by Anaconda 35.22.2 # Generated by pykickstart v3.34 #version=DEVEL # repo --name="OSupdates" --baseurl=http://192.168.7.227/pub/fed35srv/OSupdates # Use graphical install text skipx # Keyboard layouts keyboard --vckeymap=us --xlayouts='us' # System language lang en_US.UTF-8 # Network information network --bootproto=dhcp --device=enp0s25 --ipv6=auto --activate network --hostname=lenovoX1 url --url="http://192.168.7.227/pub/fed35srv/dvd" %packages @^server-product-environment @headless-management lshw inxi tree %end # SELinux selinux --disabled # Run the Setup Agent on first boot firstboot --disable reboot # Generated using Blivet version 3.4.2 ignoredisk --only-use=sda # Partition clearing information clearpart --all --initlabel --drives=sda --disklabel gpt # Disk partitioning information part /home --fstype="xfs" --ondisk=sda --size=122880 part /boot/efi --fstype="efi" --ondisk=sda --size=195 --fsoptions="umask=0077,shortname=winnt" part / --fstype="xfs" --ondisk=sda --size=25600 part /space --fstype="xfs" --ondisk=sda --size=61440 part swap --fstype="swap" --ondisk=sda --size=8192 part /boot --fstype="xfs" --ondisk=sda --size=2560 part /var --fstype="xfs" --ondisk=sda --size=20480 # System timezone timezone America/Los_Angeles --utc # Root password rootpw --iscrypted $y$j9T$NGj.3h2k8ejecjn3hfh8fESuYQn4fSQcigRhb2vkkG23kXWvETOB user --name=elvisp --password=$y$j9T$OlWK198c8ufhfhhf930jDFSvKFwSJzZcn60 --iscrypted --gecos="Elvis Presley"
Again you see the IP address of my kickstart server here, you see the location of my extracted iso files here.Now there are a few things you will need to know in advance.
What I typically do, is install the OS from a USB the first time.In the case of fedora/redhat/CentOS there will be a file at /root/anaconda.cfg. You can copy this file as a starting template for your kickstart of this OS.
scp /root/anaconda.cfg root@192.168.7.227/pub/fed35srv/fed35.cfg
(Yes I am re-naming the file here.)
Also you will need the password has strings for your users.
cat /etc/shadow | grep rootcat /etc/shadow | grep elvisp
(Or whatever user name you use.)
You will need to know the name of the LAN interface, and you will need to know the size of your hard, and how big the partitions should be.All of these things will be in your anaconda.cfg file
Now change and edit a few things in your fed35srv/fed35.cfg file now.
Change the graphical install to..testskipx This uses a cli interface, not a GUI when installing.
Change the url line to the location of your extracted iso directory in your web server. Note you don’t put the full path, only the path from your webroot.
I like to turn off seLinux, but you can delete that line if you like.
Change your timezone to whatever is appropriate for you.
Using the two example user lines above (those aren’t real hashes, I just typed a bunch of random characters to simulate what it looks like). Edit the user lines to be whatever your values are.
That’s it, you’re don! Now boot your test computer on the kickstart network. A Kickstart menu should appear. Select the appropriate OS.
I’ve found this usually works best with a few settings on the test computer. CSM should be disabled. Network stack should be enabled. Some UEFI settings let you pick PXEboot IPv4 as a boot option. This is preferred. I’ve found it works best with a freshly formatted hard-drive, that way it doesn’t try to boot into the installed OS.
Good luck!
And there you have it! You have a guest article, from dos2unix, about Kickstart. There are now three of them and there are a couple of others sitting in the potential queue. We’ll get to them. These few days off have been a very welcomed respite!
Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.
Today we'll cover one way to enable or disable your network interface in the Linux…
Today's exercise is a nice and simple exercise where we check your NIC speed in…
Have you ever wanted to easily monitor your wireless connection? Well, now you can learn…
I think I've covered this before with the ls command but this time we'll count…
Today we'll be learning about a basic Linux command that's known as 'uname' and it…
If you've used hardinfo in the past, it may interest you to know that hardinfo…