Build A Custom CentOS 5 Install CD
Jul 03
Linux, Servers and Networking No Comments
I needed a custom install disc for CentOS 5 in order to bundle some additional RPMs. Revisor has the promise, but it remains unstable and mostly unusable many months after I first gave it a shot. So until they knock out those issues, here are the instructions for rolling your own. I couldn’t find anything specific to C5, so based this loosely on some CentoS 4.1 instructions. Since a few of the tools have been updated since that release, I figured someone else could benefit.
Grab Disc 1 of the CentOS 5 installer and download to your machine.
Copy the contents to your hard drive:
$ mount -t iso9660 /dev/hdc /media/c5disc1
$ mkdir ~/build/c5disc1
$ cd/media/c5disc1
$ tar -cf – . | ( cd ~/build/c5disc1 ; tar -xvpf – )
$ umount /media/c5disc1
NOTE: Make sure you have the file .discinfo in ~/build/c5disc1. If it’s missing, the ISO will fail with a very non-intuitive error that: “The CentOS CD was not found in any of your CDROM drives. Please insert the CentOS CD and press OK to retry.” This file is apparently critical to how anaconda reads the file, but it’s not trapping that error in a useful way. Oh well. Just copy it from the original disc and put it in your build root, and all will be well.
Make sure you have the anaconda packages:
$ sudo yum -y install anaconda anaconda-help anaconda-runtime
Copy the custom packages into the new folder:
$ cp mypackage-x.y-z.i386.rpm ~/build/c5disc1/CentOS
Here’s where things start to differ from the C4 instructions. The createrepo command wraps some of the individual steps previously needed (the entire Step 4 from the C4 post), so all you need to do is:
$ cd ~/build/c5disc1
$ discinfo=`head -1 ~/build/c5disc1/.discinfo`
$ createrepo -u “media://$discinfo” -g repodata/comps.xml ~/build/c5disc1
Make the ISO using this command set:
$ isofilename = ~/build/c5-custom.iso
$ mkisofs -r -R -J -T -v \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-V “My Custom Linux 1.0″ -p “Cool Dude” \
-A “My Custom Linux 1.0 – 2007/12/11″ \
-b isolinux/isolinux.bin -c isolinux/boot.cat \
-x “lost+found” -o $isofilename ~/build/c5disc1
$ implantisomd5 $isofilename
To quickly test your new ISO, use qemu (as outlined in another post)
That’s it, so good luck!
RSS
Twitter









































































