sirius' blog

Build a custom CentOS 5 install CD

computer/linux : 2009/02/10 22:10

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/ \
-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!


Added by sirius at 2010.10.29

stage2.img : squashfs
$ mount -o loop -t squashfs stage2.img ./tmp

참고 :
참고 :
참고 :
참고 :

squashfs 다루기 : rpm -Uvh squashfs-tools-3.0-4.x86_64.rpm

ssl 파일 다루기 : rpm -Uvh syslinux-3.11-4.x86_64.rpm netpbm-progs-10.35.58-8.el5.x86_64.rpm

png to lss : pngtopnm img.png | ppmtolss16 > splash.lss
lss to png : lss16toppm < splash.lss | pnmtopng > img.png

참고 :



: 1 : 2 : 3 : 4 : 5 : ... 13 :