smorgasbork

 
  • Increase font size
  • Default font size
  • Decrease font size

Building a custom CentOS 6 kickstart disc, part 3

E-mail Print

Note: this series of articles applies to CentOS 6; for CentOS 5, see this series. 

Now that you've compiled your RPMs, you need to build a disk image from which to perform the kickstart.

Create the repository

Install createrepo so that you can create a repository. If you've copied all the RPMs to ~kickstart_build/all_rpms as suggested earlier, just do this:

cd ~kickstart_build/all_rpms
rpm -Uvh createrepo*rpm deltarpm*rpm python-deltarpm*rpm

You need to build the repodata for your install disc. These files provide the installer information about the available packages. On your build machine, you should have already copied the repodata/comps.xml file from the CentOS disc 1 to ~/kickstart_build. Use createrepo to build the repository info.

cd ~/kickstart_build/isolinux
declare -x discinfo=`head -1 .discinfo`
createrepo -u "media://$discinfo" -g ~/kickstart_build/comps.xml .

This will create a repodata directory under ~/kickstart_build/isolinux with the repository data files in it.

Build the ISO

We're finally ready to build the ISO image that we can burn to CD.

cd ~/kickstart_build
mkisofs -o custom.iso -b isolinux.bin -c boot.cat -no-emul-boot \
-boot-load-size 4 -boot-info-table -R -J -v -T isolinux/
/usr/lib/anaconda-runtime/implantisomd5 custom.iso

You should now have an ISO image in custom.iso.

Testing the ISO

Rather than spending the time to burn the CD and perform a physical installation, you can test the ISO using a virtual machine, which you can run under a program like VirtualBox.

When the system (virtual or physical) boots up, you'll see your standard CentOS installation prompt. Before the countdown expires, hit ESC and type

linux ks=cdrom:/ks/ks.cfg

If you chose to use some other name for your kickstart config file, replace ks.cfg with the name of your configuration file. You may choose to name your configuration files based on hostname or server class. If you have to use a test configuration file to get around the SATA limitations of qemu, you may call that file test.cfg or something similar.

Your installation should proceed automatically.

Now you have a working custom kickstart disc. To really take advantage of the power of kickstart, you'll most likely need a custom postinstallation script to configure the system according to your specs. We'll cover that in the next installment in this series.

Part 1  •  Part 2  •  Part 3  •  Part 4  

Comments

avatar Bryan
Great tutorial; it's worth noting that implantisomd5 is now located in /usr/bin/.
Name *
Email
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
avatar Mike
Can I delete the all_rpms directory?
Name *
Email
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
avatar Jason
You can -- it's pretty huge. But if you can afford the disk space, I'd keep those RPMs around. You never know if you might want to modify your kickstart disc and add a few RPMs.
Name *
Email
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
avatar mijohnst
This is a great guide and I've learned a little something but I still can't get mine to work right. I'm using RHEL6. I assumed that this guide you made would work with but no luck so far. Has anyone tried and succeeded with RHEL 6.2? Thanks for the post!
Name *
Email
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
avatar Jason
We actually had somebody on our team do it recently with CentOS 6.3. He said there were a couple of inaccuracies, but nothing he couldn't work around. Some time when I have a couple of hours to spare, I'll step through it myself to polish up the instructions.
Name *
Email
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
avatar CJ
I have followed the instructions as written, and am getting the following error when I go to install from the created iso.

Unable to read package metadata. This may be due to a missing repodata directory. Please ensure that your install tree has been correctly generated.

From some web searching, people say it could be the download of the originial image was bad. I have now redownloaded, checksum verified, and tested, the image, several times. All were good.

Any ideas?
Name *
Email
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
avatar mike
find a line in the ks.cfg file that says repo=CentOS or something similar. Delete that line
Name *
Email
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
avatar Jason
See Bob's comment on Part 1. I may have to go back and review these procedures.
Name *
Email
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
avatar Mark
Hi,
I have followed the steps starting from 6.4 centos. It starts, I input the linux line but it comes out the cdrom is not found and it gets stuck. In the terminal F3 I see copy the ks, check the cdrom, and then eject it.
Any suggestions? I pretty sure is a simple matter but it is driving me crazy
Name *
Email
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
avatar Mark
Hi,
I followed all the steps, I started the iso into a VM, I input the 'linux ks=cdrom:ks.cfg' string, but then it comes out a CDROM not found warning message. On F3 terminal I can see that tests the CD (dev/sr0) copy the ks.cfg, and then ejects it by not being able to access the CD anymore. I have tried to remount it back from the VM but it does the same thing.
The final message is: CD tray is open and should be closed
Do you have any ideas how to move on?
really appreciate the help
Name *
Email
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
avatar rootr9
I am facing a the same issue
did anybody faced such a thing and resolved ?
:(
Name *
Email
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
Name *
Email
Code   
Submit Comment