Difference between revisions of "Kickstart"

From Peter Pap's Technowiki
Jump to: navigation, search
(Building the boot CD)
(Building the boot CD)
 
(13 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
 
In this example, our build media will be stored on a local NFS share.
 
In this example, our build media will be stored on a local NFS share.
 +
 +
== Creating the media repository ==
 +
 +
1. Download the latest DVD ISO from your favourite mirror.
 +
 +
2. Either burn the ISO to a DVD or soft mount it on a Linux/Unix server.
 +
 +
3. Make a directory that you want to use as your NFS share
 +
 +
  mkdir /export/centos
 +
  chmod 755 /export/centos
 +
 +
4. Share this directory over NFS.
 +
 +
Clear here for instructions on how to [[Create an NFS share with Solaris]].
 +
 +
5. Create a directory to hold the contents of the DVD
 +
 +
  mkdir -p /export/centos/5.5/os/x86_64
 +
  chmod 755 /export/centos
 +
 +
6. Copy the contents of the DVD in to this directory
 +
 +
  cd /export/centos/5.5/os/x86_64
 +
  cp -pr PATH_TO_DVD/* .
 +
 +
 +
== Make a Kickstart configuration file ==
 +
 +
1. Make a directory to hold the Kickstart configuration file on the NFS server
 +
 +
  mkdir /export/centos/kickstart
 +
 +
2. Create a file in this directory called kickstart.ks.  Click here to see a [[Sample Kickstart Configuration file]]
 +
 +
3. Make the kickstart file world readable
 +
 +
  chmod 644 kickstart.ks
  
 
== Building the boot CD ==
 
== Building the boot CD ==
Line 21: Line 59:
 
5.  Go into the 'isolinux' directory and edit the isolinux.cfg file with the following contents:
 
5.  Go into the 'isolinux' directory and edit the isolinux.cfg file with the following contents:
  
   default vrsn-ks
+
   default my-ks
 
   prompt 5
 
   prompt 5
 
   timeout 15
 
   timeout 15
   label vrsn-ks
+
   label my-ks
 
     kernel vmlinuz
 
     kernel vmlinuz
 
     append ip=dhcp ks=nfs:192.168.1.1:/export/install/centos/ks/kickstart.ks initrd=initrd.img kssendmac ksdevice=eth0 lang=en_US
 
     append ip=dhcp ks=nfs:192.168.1.1:/export/install/centos/ks/kickstart.ks initrd=initrd.img kssendmac ksdevice=eth0 lang=en_US

Latest revision as of 23:53, 15 November 2011

Kickstart is awesome for automating the building CentOS/RedHat servers. There are a number of ways that you can do it, such as PXE booting of the network etc, but the way I choose to do it requires a simple boot CD.

In this example, our build media will be stored on a local NFS share.

Creating the media repository

1. Download the latest DVD ISO from your favourite mirror.

2. Either burn the ISO to a DVD or soft mount it on a Linux/Unix server.

3. Make a directory that you want to use as your NFS share

 mkdir /export/centos
 chmod 755 /export/centos

4. Share this directory over NFS.

Clear here for instructions on how to Create an NFS share with Solaris.

5. Create a directory to hold the contents of the DVD

 mkdir -p /export/centos/5.5/os/x86_64
 chmod 755 /export/centos

6. Copy the contents of the DVD in to this directory

 cd /export/centos/5.5/os/x86_64
 cp -pr PATH_TO_DVD/* .


Make a Kickstart configuration file

1. Make a directory to hold the Kickstart configuration file on the NFS server

 mkdir /export/centos/kickstart

2. Create a file in this directory called kickstart.ks. Click here to see a Sample Kickstart Configuration file

3. Make the kickstart file world readable

 chmod 644 kickstart.ks

Building the boot CD

1. Download the latest DVD ISO of the distro you wish to use. In this case it's CentOS 5.5 x86_64.

2. Either burn the DVD ISO to DVD media or soft mount it on your machine.

3. Make a directory to hold the boot image data

 mkdir bootimage

4. Copy the 'images' and 'isolinux' directories from the DVD into the bootimage folder

 cd bootimage
 cp -pr PATH_TO_DVD/images/ .
 cp -pr PATH_TO_DVD/isolinux/ .

5. Go into the 'isolinux' directory and edit the isolinux.cfg file with the following contents:

 default my-ks
 prompt 5
 timeout 15
 label my-ks
   kernel vmlinuz
   append ip=dhcp ks=nfs:192.168.1.1:/export/install/centos/ks/kickstart.ks initrd=initrd.img kssendmac ksdevice=eth0 lang=en_US
 label linux
   kernel vmlinuz
   append initrd=initrd.img
 label text
   kernel vmlinuz
   append initrd=initrd.img text
 label ks
   kernel vmlinuz
   append ks initrd=initrd.img
 label local
   localboot 1
 label memtest86
   kernel memtest
   append -

In this example, the server will use network interface eth0, will get it's IP from DHCP and will get it's kickstart config file, kickstart.ks, from the nfs server 192.168.1.1 in the specified directory.

If DHCP isn't available, you can specify a static IP like this:

 ip=192.168.1.2 netmask=255.255.255.0 gateway=192.168.1.254 nameserver=192.168.1.253

6. Make a bootable ISO image of this directory:

 cd bootimage
 mkisofs -o ../ks.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v -T .

7. Burn the new ISO, ks.iso, to CD using your favourite burning software.