FAI (Fully Automatic Installation)

Print Friendly

Installation

Installtion prerequisites :

Dhcp server
Debian local mirror

TFTP on DHCP Server

Install tftpd-hpa :

apt-get install tftpd-hpa

During the installation specify the tftp folder

/var/fai

FAI on NFS Server

Install FAI :

apt-get install fai-client fai-server fai-doc

Copy example files :

mkdir -p /tftp/config

cp -a /usr/share/doc/fai-doc/examples/simple/* /tftp/config

Create config directory « squeeze » for each arch :

cp -a /etc/fai /etc/fai-amd64-squeeze
cp -a /etc/fai /etc/fai-i386-squeeze

Configuring FAI

add the following line (in the first section « PACKAGES aptitude ») in /etc/fai-*-squeeze/NFSROOT :

firmware-bnx2 firmware-linux firmware-linux-nonfree firmware-qlogic firmware-realtek

Create the following file : /etc/fai-amd64-squeeze/apt_arch.conf

APT {
	Architecture "amd64";
}

and create the following file : /etc/fai-i386-squeeze/apt_arch.conf

APT {
	Architecture "i386";
}

Edit /etc/fai-*-squeeze/apt/sources.list :

deb http://debian.it.fr.eve/debian squeeze main contrib non-free
deb http://debian.it.fr.eve/multimedia squeeze main non-free
deb http://debian.it.fr.eve/security squeeze/updates main contrib non-free

Edit /etc/fai-*-squeeze/fai.conf :

#NFS server
FAI_CONFIG_SRC=nfs://172.16.96.143/tftp/config
#Local configuration directory on the client
FAI=/var/lib/fai/config

Edit /etc/fai-amd64-squeeze/make-fai-nfsroot.conf :

NFSROOT=/tftp/nfsroot-amd64-squeeze
TFTPROOT=/tftp
FAI_CONFIGDIR=/tftp/config
FAI_DEBOOTSTRAP="squeeze http://debian.it.fr.eve/debian"
FAI_ROOTPW='$1$kBnWcO.E$djxB128U7dMkrltJHPf6d1'
FAI_DEBOOTSTRAP_OPTS="--exclude=info --arch amd64"
APT_CONFIG=/etc/fai-amd64-squeeze/apt_arch.conf

Edit /etc/fai-i386-squeeze/make-fai-nfsroot.conf :

NFSROOT=/tftp/nfsroot-i386-squeeze
TFTPROOT=/tftp
FAI_CONFIGDIR=/tftp/config
FAI_DEBOOTSTRAP="squeeze http://debian.it.fr.eve/debian"
FAI_ROOTPW='$1$kBnWcO.E$djxB128U7dMkrltJHPf6d1'
FAI_DEBOOTSTRAP_OPTS="--exclude=info --arch i386"
APT_CONFIG=/etc/fai-i386-squeeze/apt_arch.conf

Lauch the following command in order to create the minimal filesystem for clients :

for i386 :

make-fai-nfsroot -C /etc/fai-i386-squeeze/ -v

for amd64 :

make-fai-nfsroot -C /etc/fai-amd64-squeeze/ -v

Fix lvm issue under lenny/squeeze release : The lvm2 configuration doesn’t work under lenny/squeeze, you must specify a cache and lock folder different from the default : edit /tftp/nfsroot-*-squeeze/live/filesystem.dir/etc/lvm/lvm.conf

replace

cache_dir = "/etc/lvm/cache"
by 
cache_dir = "/tmp/lvm/cache"

And replace

locking_dir = "/var/lock/lvm"
by
locking_dir = "/tmp/lock/lvm"

FAI CLASS

Define class (/tftp/config/class):

Create the following class /tftp/config/class/SQUEEZE.var

# default values for installation. You can override them in your *.var files
# allow installation of packages from unsigned repositories
FAI_ALLOW_UNSIGNED=1
CONSOLEFONT=
KEYMAP=fr-latin9
# Set UTC=yes if your system clock is set to UTC (GMT), and UTC=no if not.
UTC=yes
TIMEZONE=Europe/Paris
# root password for the new installed linux system; md5 and crypt are possible
# pw is "fai"
ROOTPW='$1$58l2iwPu$.0k/AeH0HGGuYtX1hsynK/'
# MODULESLIST contains modules that will be loaded by the new system,
# not during installation these modules will be written to /etc/modules
# If you need a module during installation, add it to $kernelmodules
# in 20-hwdetect.source. But discover should do most of this job
MODULESLIST="usbkbd ehci-hcd ohci-hcd uhci-hcd usbhid psmouse"
# erros in tasks greater than this value will cause the installation to stop
STOP_ON_ERROR=700
# use the new partitioning tool
USE_SETUP_STORAGE=1

FAI DEBCONF

cd /tftp/config/debconf :

Create file SQUEEZE :

passwd passwd/shadow boolean true
exim4-config exim4/dc_eximconfig_configtype select local delivery only; not on a network
locales locales/default_environment_locale select fr_FR.UTF-8
locales locales/locales_to_be_generated multiselect fr_FR.UTF-8 UTF-8
xserver-xorg xserver-xorg/config/inputdevice/keyboard/model string pc105
xserver-xorg    xserver-xorg/autodetect_monitor         boolean false
xserver-xorg    xserver-xorg/autodetect_keyboard        boolean true
xserver-xorg    xserver-xorg/autodetect_mouse           boolean true
xserver-xorg    xserver-xorg/autodetect_video_card      boolean true
sun-java6-jre	shared/accepted-sun-dlj-v1-1		boolean true
sun-java6-bin	shared/accepted-sun-dlj-v1-1		boolean true
ssmtp		ssmtp/root				string	root@eve-team.com
ssmtp		ssmtp/mailhub				string	smtp.it.fr.eve
ssmtp		ssmtp/rewritedomain			string	eve-team.com
nslcd		nslcd/ldap-uris				string	'ldaps://ldap.eve/'
nslcd		nslcd/ldap-base				string	'passwd ou=People,dc=eve-team,dc=com'
nslcd		nslcd/ldap-base				string	'shadow ou=People,dc=eve-team,dc=com'
nslcd		nslcd/ldap-base				string	'group ou=Group,dc=eve-team,dc=com'
nslcd		nslcd/ldap-bindpw			string	'ccpRDByv5fCfwsp'
nslcd		nslcd/ldap-binddn			string	'cn=authuser,dc=eve-team,dc=com'
nslcd		nslcd/ldap-reqcert			select	allow
gdm3		shared/default-x-display-manager	select	gdm3
kdm		shared/default-x-display-manager	select	gdm3
virtuoso-opensource-6.1	virtuoso-opensource-6.1/dba-password		password	nwJabJ7A55oTWLpS
virtuoso-opensource-6.1	virtuoso-opensource-6.1/dba-password-again	password	nwJabJ7A55oTWLpS
postfix		postfix/main_mailer_type		select	Satellite system
postfix		postfix/relayhost			string	smtp.it.fr.eve
postfix		postfix/root_address			string	root@eve-team.com

FAI disk_config

Disk configuration

cd /tftp/config/disk_config

Create file WORKSTATION (for workstation’s storage) :

#example of new config file for setup-storage
#
#        
# Simple LVM example
disk_config sda  bootable:1
primary / 5G ext3 rw,noatime,errors=remount-ro tuneopts="-c 0 -i 0"
primary swap 4096 swap rw
primary - 4096-  -       -
#disk_config lvm  preserve_reinstall:%%HOSTNAME%%-home
disk_config lvm
vg %%HOSTNAME%%        sda3
%%HOSTNAME%%-tmp     /tmp       5G    ext3 rw
%%HOSTNAME%%-usr     /usr      10G    ext3 rw
%%HOSTNAME%%-rhel4	/chroot/rhel4	9G	ext3	defaults
%%HOSTNAME%%-rhel5	/chroot/rhel5	8G	ext3	defaults
%%HOSTNAME%%-suse10	/chroot/suse10	5G	ext3	defaults
%%HOSTNAME%%-suse11	/chroot/suse11	6G	ext3	defaults
%%HOSTNAME%%-home	/home	%%HOMESIZE%%	ext3	defaults

Create file COMPIL (for compil’s storage :

#example of new config file for setup-storage
#
#        
# Simple LVM example
disk_config sda  bootable:1
primary / 5G ext3 rw,noatime,errors=remount-ro tuneopts="-c 0 -i 0"
primary swap 4096 swap rw
primary -       4096-   -       -
#disk_config lvm  preserve_reinstall:%%HOSTNAME%%-home
disk_config lvm
vg %%HOSTNAME%%        sda3
%%HOSTNAME%%-tmp     /tmp       5G    ext3 rw
%%HOSTNAME%%-usr     /usr      2G    ext3 rw
%%HOSTNAME%%-rhel4	/chroot/rhel4	9G	ext3	defaults
%%HOSTNAME%%-rhel5	/chroot/rhel5	8G	ext3	defaults
%%HOSTNAME%%-suse10	/chroot/suse10	5G	ext3	defaults
%%HOSTNAME%%-suse11	/chroot/suse11	6G	ext3	defaults
%%HOSTNAME%%-home	/home	%%HOMESIZE%%	ext3	defaults

FAI Hooks

disk_confg’s hooks :

cd /tftp/config/hooks :

Create file partition.WORKSTATION :

#!/bin/bash
ip=`ip -f inet addr | grep eth0$ | awk '{print$2}' | cut -d '/' -f1`
name=`host $ip | awk '{print $5}' | cut -d "." -f1`
export HOSTNAME=$name
vg_name=vg_$name
disk_size_bytes=`fdisk /dev/sda -l | grep ^Disk.*bytes$ | awk '{print$5}'`
disk_size_go=$(( $disk_size_bytes/1024/1024/1024 ))
home_size=$(( $disk_size_go - 72 ))G
mkramdisk /var/lib/fai/config/disk_config
sed -i "s/%%HOSTNAME%%/$vg_name/" /var/lib/fai/config/disk_config/WORKSTATION
sed -i "s/%%HOMESIZE%%/$home_size/" /var/lib/fai/config/disk_config/WORKSTATION

Create file partition.COMPIL :

#!/bin/bash
ip=`ip -f inet addr | grep eth0$ | awk '{print$2}' | cut -d '/' -f1`
name=`host $ip | awk '{print $5}' | cut -d "." -f1`
export HOSTNAME=$name
vg_name=vg_$name
disk_size_bytes=`fdisk /dev/sda -l | grep ^Disk.*bytes$ | awk '{print$5}'`
disk_size_go=$(( $disk_size_bytes/1024/1024/1024 ))
home_size=$(( $disk_size_go - 67 ))G
mkramdisk /var/lib/fai/config/disk_config
sed -i "s/%%HOSTNAME%%/$vg_name/" /var/lib/fai/config/disk_config/COMPIL
sed -i "s/%%HOMESIZE%%/$home_size/" /var/lib/fai/config/disk_config/COMPIL

Chroot installtion :

cd /tftp/config/hooks :

Create file : instsoft.CHROOT :

#! /bin/bash
[ -s $target/etc/kernel-img.conf ] || fcopy -Bi /etc/kernel-img.conf

ftar /chroot/rhel4 && echo "/chroot/rhel4"
ftar /chroot/rhel5 && echo "/chroot/rhel5"
ftar /chroot/suse10 && echo "/chroot/suse10"
ftar /chroot/suse11 && echo "/chroot/suse11"

FAI Package_config

package configuration :

cd /tftp/config/package_config :

Create file COMPIL : compil.tar

Create file WORKSTATION : workstation.tar
FAI Scripts

Scripts :

cd /tftp/config/scripts

create directory COMPIL

cp /tftp/config/scripts/FAIBASE/* /tftp/config/scripts/COMPIL/
cd /tftp/config/scripts/COMPIL

Create file 50-eve-config :

#! /bin/bash

mkdir -p $target/root/.ssh
touch $target/root/.ssh/authorized_keys
fcopy -i /etc/apt/sources.list

ip=`ip -f inet addr | grep eth0$ | awk '{print$2}' | cut -d '/' -f1`
name=`host $ip | awk '{print $5}' | cut -d "." -f1`
export HOSTNAME=$name
vg_name=vg_$name

####FSTAB########
cat >> $target/etc/fstab <> $target/etc/apt/sources.list < $target/etc/hosts < $target/etc/rc.local <

cd /tftp/config/scripts

create directory WORKSTATION

cp /tftp/config/scripts/FAIBASE/* /tftp/config/scripts/WORKSTATION/

cd /tftp/config/scripts/WORKSTAION

Create file 50-eve-config :

#! /bin/bash

mkdir -p $target/root/.ssh
touch $target/root/.ssh/authorized_keys
fcopy -i /etc/apt/sources.list

ip=`ip -f inet addr | grep eth0$ | awk '{print$2}' | cut -d '/' -f1`
name=`host $ip | awk '{print $5}' | cut -d "." -f1`
export HOSTNAME=$name
vg_name=vg_$name

####FSTAB########
cat >> $target/etc/fstab <> $target/etc/apt/sources.list < $target/etc/hosts < $target/etc/rc.local <

install_fai.sh.tar
sge_create_allusers_homedirs.sh.tar
FAI Files

Files :

cd /tftp/config/files :

mkdir -p chroot/rhel4
mkdir -p chroot/rhel5
mkdir -p chroot/suse10
mkdir -p chroot/suse11

copy rhel4 archive in chroot/rhel4/CHROOT.tgz do the same with rhel5, suse10, suse11

List of file in files folder :

.
|-- chroot
|   |-- rhel4
|   |   |-- CHROOT.tgz
|   |   `-- etc
|   |       `-- skel
|   |-- rhel5
|   |   |-- CHROOT.tgz
|   |   `-- etc
|   |       `-- skel
|   |-- ssmtp.tgz
|   |   `-- CHROOT
|   |-- suse10
|   |   |-- CHROOT.tgz
|   |   `-- etc
|   |       `-- skel
|   `-- suse11
|       |-- CHROOT.tgz
|       `-- etc
|           `-- skel
|-- etc
|   |-- cups
|   |   `-- client.conf
|   |       `-- SQUEEZE
|   |-- default
|   |   |-- keyboard
|   |   |   `-- SQUEEZE
|   |   |-- puppet
|   |       `-- SQUEEZE
|   |-- exports
|   |   `-- SQUEEZE
|   |-- init.d
|   |   `-- sgeexecd
|   |       `-- SQUEEZE
|   |-- ldap
|   |   `-- ldap.conf
|   |       `-- SQUEEZE
|   |-- locale.gen
|   |   `-- SQUEEZE
|   |-- network
|   |   `-- interfaces
|   |       `-- SQUEEZE
|   |-- nscd.conf
|   |   `-- SQUEEZE
|   |-- nslcd.conf
|   |   `-- SQUEEZE
|   |-- nsswitch.conf
|   |   `-- SQUEEZE
|   |-- ntp.conf
|   |   `-- SQUEEZE
|   |-- pam.d
|   |   |-- common-account
|   |   |   `-- SQUEEZE
|   |   |-- common-auth
|   |   |   `-- SQUEEZE
|   |   |-- common-password
|   |   |   `-- SQUEEZE
|   |   `-- common-session
|   |       `-- SQUEEZE
|   |-- polkit-1
|   |   `-- localauthority
|   |       `-- 50-local.d
|   |           `-- shutdown_restart.pkla
|   |               `-- SQUEEZE
|   |-- puppet
|   |   `-- puppet.conf
|   |       `-- SQUEEZE
|   |-- schroot
|   |   |-- default
|   |   |   |-- copyfiles
|   |   |   |   `-- SQUEEZE
|   |   |   `-- fstab
|   |   |       `-- SQUEEZE
|   |   `-- schroot.conf
|   |       `-- SQUEEZE
|   |-- security
|   |-- skel
|   |-- ssh
|   |   |-- ssh_config
|   |   |   `-- SQUEEZE
|   |   `-- sshd_config
|   |       `-- SQUEEZE
|   |-- ssl
|   |   `-- certs
|   |       |-- eve_ca.crt
|   |       |   `-- SQUEEZE
|   |       `-- eve_root_ca.crt
|   |           `-- SQUEEZE
|   `-- sudoers
|       `-- SQUEEZE
|-- known_hosts
|-- root
|   `-- ssh
|       `-- id_dsa
|           `-- SQUEEZE
`-- usr
    `-- share
        `-- vim
            `-- vim72
                `-- plugin
                    `-- cvscommand.vim
                        `-- SQUEEZE

files.tar.gz (all files except chroot)
PXE

Copy initrd and vmlinuz on tftp server :

scp /tftp/initrd.img-2.6.32-5-486 /tftp/initrd.img-2.6.32-5-amd64 /tftp/vmlinuz-2.6.32-5-486 /tftp/vmlinuz-2.6.32-5-amd64  /tftp/pxelinux.0  tftpserver:/var/fai/

On tftp server :

cd /var/fai
mkdir -p pxelinux.cfg/menu
cd pxelinux.cfg

create file default :

DEFAULT pxelinux.cfg/menu/vesamenu.c32
MENU BACKGROUND pxelinux.cfg/menu/eve-logo.png
KBDMAP pxelinux.cfg/menu/fr.kbd
MENU TITLE [EVE] NETWORK UTILITIES
LABEL MEMTEST
        MENU LABEL Memtest86+
        KERNEL ../MEMTEST/memtest86+
	MENU SEPARATOR
LABEL IT
	MENU LABEL Network Install
	KERNEL pxelinux.cfg/menu/vesamenu.c32
	APPEND pxelinux.cfg/menu/it.conf
	MENU PASSWD $1$BKTeoA0I$wjgIbmIv5a8sZi52Btv081
	MENU SEPARATOR
LABEL TOOLS
        MENU LABEL Tools
        KERNEL pxelinux.cfg/menu/vesamenu.c32
        APPEND pxelinux.cfg/menu/tools.conf
	MENU SEPARATOR
LABEL bootlocal
	MENU LABEL Local Boot
	COM32 pxelinux.cfg/menu/chain.c32
	APPEND hd0 0
	MENU SEPARATOR
LABEL REBOOT
	MENU LABEL Reboot
	KERNEL pxelinux.cfg/menu/reboot.c32

for memdisk, reboot.c32, chain.c32, vesamenu.c32 you can find this files in the following package : syslinux-4.03.tar.gz

http://ftp.free.fr/mirrors/ftp.kernel.org/linux/boot/syslinux/4.xx/

extract the archive and copy the previous file in pxelinux.cfg/menu/

for the french keyboard copy kr.kbd in pxelinux.cfg/menu/

http://www.guim.info/dokuwiki/_media/debian/fr.kbd

cd menu

create file it.conf :

DEFAULT pxelinux.cfg/menu/vesamenu.c32
MENU BACKGROUND pxelinux.cfg/menu/install.png
MENU TITLE [EVE] NETWORK INSTALL
LABEL DEBIAN
        MENU LABEL DEBIAN
        KERNEL pxelinux.cfg/menu/vesamenu.c32
        APPEND pxelinux.cfg/menu/squeeze.conf
LABEL RHEL4
        MENU LABEL RHEL4
        KERNEL pxelinux.cfg/menu/vesamenu.c32
        APPEND pxelinux.cfg/menu/rhel4.conf
LABEL RHEL5
        MENU LABEL RHEL5
        KERNEL pxelinux.cfg/menu/vesamenu.c32
        APPEND pxelinux.cfg/menu/rhel5.conf
LABEL RHEL6
        MENU LABEL RHEL6
        KERNEL pxelinux.cfg/menu/vesamenu.c32
        APPEND pxelinux.cfg/menu/rhel6.conf
LABEL Netinstall
        MENU LABEL DEBIAN NETBOOT
        KERNEL pxelinux.cfg/menu/vesamenu.c32
        APPEND pxelinux.cfg/menu/netboot.conf
LABEL back_menu
	MENU LABEL Back
	KERNEL pxelinux.cfg/menu/vesamenu.c32
	APPEND pxelinux.cfg/default

Create netboot.conf :

MENU TITLE DEBIAN NETBOOT
MENU BACKGROUND pxelinux.cfg/menu/splash.png
LABEL DEBIAN STABLE i386
	MENU LABEL DEBIAN SQUEEZE i386
	kernel ../DEBIAN_NETBOOT/i386/stable/debian-installer/i386/linux
	append vga=normal initrd=../DEBIAN_NETBOOT/i386/stable/debian-installer/i386/initrd.gz ramdisk_size=9424 root=/dev/rd/0 devfs=mount,dall rw --
LABEL DEBIAN STABLE amd64
	MENU LABEL DEBIAN SQUEEZE amd64
	kernel ../DEBIAN_NETBOOT/amd64/stable/debian-installer/amd64/linux
	append vga=normal initrd=../DEBIAN_NETBOOT/amd64/stable/debian-installer/amd64/initrd.gz ramdisk_size=9424 root=/dev/rd/0 devfs=mount,dall rw --
LABEL DEBIAN TESTING i386
	MENU LABEL DEBIAN WHEEZY i386
	kernel ../DEBIAN_NETBOOT/i386/testing/debian-installer/i386/linux
	append vga=normal initrd=../DEBIAN_NETBOOT/i386/testing/debian-installer/i386/initrd.gz ramdisk_size=9424 root=/dev/rd/0 devfs=mount,dall rw --
LABEL DEBIAN TESTING amd64
	MENU LABEL DEBIAN WHEEZY amd64
	kernel ../DEBIAN_NETBOOT/amd64/testing/debian-installer/amd64/linux
	append vga=normal initrd=../DEBIAN_NETBOOT/amd64/testing/debian-installer/amd64/initrd.gz ramdisk_size=9424 root=/dev/rd/0 devfs=mount,dall rw --
LABEL back_menu
	MENU LABEL Back
	KERNEL pxelinux.cfg/menu/vesamenu.c32
	APPEND pxelinux.cfg/menu/it.conf

Create rhel4.conf :

MENU TITLE RedHat Entreprise Linux 4 Update 8
MENU BACKGROUND pxelinux.cfg/menu/redhat.png
LABEL RHEL4-64bits-eve
	MENU LABEL RHEL 4 Update 8 64bits EVE
        kernel ../RHEL/RHEL4.8-64bits/vmlinuz
        append ks=nfs:172.16.96.143:/tftp/RHEL/config/rhel4/ks_rhel4_64bits_eve initrd=../RHEL/RHEL4.8-64bits/initrd.img
LABEL RHEL4-64bits-eve
	MENU LABEL RHEL 4 Update 8 64bits EVE NIC Intel e1000e (bird*)
        kernel ../RHEL/RHEL4.8-64bits/vmlinuz
        append ks=nfs:172.16.96.143:/tftp/RHEL/config/rhel4/ks_rhel4_64bits_eve_e1000e initrd=../RHEL/RHEL4.8-64bits/initrd.img.gz ramdisk_size=20000000
LABEL RHEL4-64bits-base
	MENU LABEL RHEL 4 Update 8 64bits BASE
        kernel ../RHEL/RHEL4.8-64bits/vmlinuz
        append ks=nfs:172.16.96.143:/tftp/RHEL/config/rhel4/ks_rhel4_64bits_base initrd=../RHEL/RHEL4.8-64bits/initrd.img
LABEL RHEL4-64bits-base
	MENU LABEL RHEL 4 Update 8 64bits BASE NIC Intel e1000e (bird*)
        kernel ../RHEL/RHEL4.8-64bits/vmlinuz
        append ks=nfs:172.16.96.143:/tftp/RHEL/config/rhel4/ks_rhel4_64bits_base_e1000e initrd=../RHEL/RHEL4.8-64bits/initrd.img.gz ramdisk_size=20000000
LABEL back_menu
	MENU LABEL Back
	KERNEL pxelinux.cfg/menu/vesamenu.c32
	APPEND pxelinux.cfg/menu/it.conf

Create rhel5.conf :

MENU TITLE RedHat Entreprise Linux 5 Update 6
MENU BACKGROUND pxelinux.cfg/menu/redhat.png
LABEL RHEL5-64bits-eve
	MENU LABEL RHEL 5 Update 6 64bits EVE
        kernel ../RHEL/RHEL5.6-64bits/vmlinuz
        append ks=nfs:172.16.96.143:/tftp/RHEL/config/rhel5/ks_rhel5_64bits_eve initrd=../RHEL/RHEL5.6-64bits/initrd.img
LABEL RHEL5-64bits-base
	MENU LABEL RHEL 5 Update 6 64bits BASE
        kernel ../RHEL/RHEL5.6-64bits/vmlinuz
        append ks=nfs:172.16.96.143:/tftp/RHEL/config/rhel5/ks_rhel5_64bits_base initrd=../RHEL/RHEL5.6-64bits/initrd.img
LABEL back_menu
	MENU LABEL Back
	KERNEL pxelinux.cfg/menu/vesamenu.c32
	APPEND pxelinux.cfg/menu/it.conf

Create rhel6.conf :

MENU TITLE RedHat Entreprise Linux 6 Update 0
MENU BACKGROUND pxelinux.cfg/menu/redhat.png
LABEL RHEL6-64bits-eve
	MENU LABEL RHEL 6 Update 0 64bits EVE
        kernel ../RHEL/RHEL6.0-64bits/vmlinuz
        append ks=nfs:172.16.96.143:/tftp/RHEL/config/rhel6/ks_rhel6_64bits_eve initrd=../RHEL/RHEL6.0-64bits/initrd.img
LABEL RHEL6-64bits-base
	MENU LABEL RHEL 6 Update 0 64bits BASE
        kernel ../RHEL/RHEL6.0-64bits/vmlinuz
        append ks=nfs:172.16.96.143:/tftp/RHEL/config/rhel6/ks_rhel6_64bits_base initrd=../RHEL/RHEL6.0-64bits/initrd.img
LABEL back_menu
	MENU LABEL Back
	KERNEL pxelinux.cfg/menu/vesamenu.c32
	APPEND pxelinux.cfg/menu/it.conf

Create squeeze.conf :

MENU TITLE Debian 6.0
MENU BACKGROUND pxelinux.cfg/menu/splash.png
LABEL DEBIAN SQUEEZE-64bits
        kernel vmlinuz-2.6.32-5-amd64
        append initrd=initrd.img-2.6.32-5-amd64 ip=dhcp  root=/dev/nfs nfsroot=172.16.96.143:/tftp/nfsroot-amd64-squeeze boot=live  FAI_FLAGS=verbose,sshd,createvt FAI_ACTION=install
LABEL DEBIAN SQUEEZE-32bits
        kernel vmlinuz-2.6.32-5-486
        append initrd=initrd.img-2.6.32-5-486 ip=dhcp  root=/dev/nfs nfsroot=172.16.96.143:/tftp/nfsroot-i386-squeeze boot=live  FAI_FLAGS=verbose,sshd,createvt FAI_ACTION=install
LABEL back_menu
        MENU LABEL Back
        KERNEL pxelinux.cfg/menu/vesamenu.c32
        APPEND pxelinux.cfg/menu/it.conf

Create tools.conf :

MENU TITLE Tools
MENU BACKGROUND pxelinux.cfg/menu/utilities.png
LABEL systemrescue
        MENU LABEL System Rescue CD 2.0.1 32bits
        KERNEL ../RESCUECD/isolinux/rescuecd
        APPEND root=/dev/nfs verbose ip=dhcp initrd=../RESCUECD/isolinux/initram.igz nfsboot=172.16.96.143:/tftp/TOOLS/RESCUECD
LABEL systemrescue
        MENU LABEL System Rescue CD 2.0.1 64bits
        KERNEL ../RESCUECD/isolinux/rescue64
        APPEND root=/dev/nfs verbose ip=dhcp initrd=../RESCUECD/isolinux/initram.igz nfsboot=172.16.96.143:/tftp/TOOLS/RESCUECD
LABEL Ultimate Boot CD
	MENU LABEL Ultimate Boot CD 5.03
	KERNEL pxelinux.cfg/menu/memdisk
	APPEND initrd=../UBCD/ubcd503.iso iso raw
LABEL Clonzilla
	MENU LABEL CloneZilla 1.2.6 i686
	KERNEL pxelinux.cfg/menu/memdisk
	APPEND initrd=../CLONEZILLA/clonezilla-live-1.2.6-59-i686.iso
LABEL HIREN
	MENU LABEL Hiren's Boot CD 13.1
	KERNEL pxelinux.cfg/menu/memdisk
	APPEND initrd=../HIREN/bootcd13.1.iso iso raw
LABEL BIOS
	MENU LABEL Update BIOS
	KERNEL pxelinux.cfg/menu/memdisk
	APPEND initrd=../BIOS/fdos_boot.img
	TEXT HELP
	D9200-2-5-3.EXE,V200-1-0-16.EXE (yap*),P690-A08.EXE (kea*)
	O760-A10.EXE (ata*),PE2950-020700C.EXE (kapa*)
	PER610-020312C.EXE (lulu*),PE1950-020700C.EXE (nevis*)
	PER410--010504.EXE (big*),V400-1-0-15.EXE,O980-A07.EXE (bird*)
	ENDTEXT
LABEL HDT
	MENU LABEL Hardware Detection Tool
	KERNEL ../HDT/hdt_0_4_1.c32
LABEL back_menu
	MENU LABEL Back
	KERNEL pxelinux.cfg/menu/vesamenu.c32
	APPEND pxelinux.cfg/default

Configuration PXE

RHEL :

cd /var/fai
mkdir -p RHEL/RHEL4.8-64bits RHEL/RHEL5.6-64bits RHEL/RHEL6.0-64bits

copy initrd and vmlinuz from dvds (foler images/pxeboot/) in each RHEL folder.

DEBIAN NETBOOT :

cd /var/fai
mkdir -p DEBIAN_NETBOOT/amd64/stable/debian-installer/amd64
mkdir -p DEBIAN_NETBOOT/amd64/testing/debian-installer/amd64
mkdir -p DEBIAN_NETBOOT/i386/stable/debian-installer/i386
mkdir -p DEBIAN_NETBOOT/i386/testing/debian-installer/i386

example for netboot amd64 stable :

download initrd.gz and linux files and copy those files in /var/fai/DEBIAN_NETBOOT/amd64/stable/debian-installer/amd64/

netboot available here : http://ftp.nl.debian.org/debian/dists/squeeze/main/installer-amd64/current/images/netboot/debian-installer/amd64/

TOOLS :

on tftpserver :

RESCUECD :

cd /var/fai
mkdir -p RESCUECD/isolinux

copy from iso of rescuecd : isolinux/initram.igz isolinux/rescue64 isolinux/rescuecd in /var/fai/RESCUECD/isolinux/

UBCD :

mkdir /var/fai/UBCD copy ubcd.iso in /var/fai/UBCD

MEMTEST : mkdir /var/fai/MEMTEST copy /boot/memtest86+ (available on a livecd for exaple) in /var/fai/MEMTEST

HIREN : mkdir /var/fai/HIREN copy bootcd13.1.iso (Hiren iso) in /var/fai/HIREN/

HDT (hardware detection tools): mkdir -p /var/fai/HDT copy hdt_0_4_1.c32 in /var/fai/HDT/

hdt available here : http://syslinux.zytor.com/wiki/index.php/Hdt_(Hardware_Detection_Tool)#Download

CLONEZILLA :

mkdir -p /var/fai/CLONEZILLA copy clonezilla-live-1.2.6-59-i686.iso in /var/fai/CLONEZILLA

available here : http://clonezilla.org/downloads.php

On nfsserver :

cd /tftp mkdir ISO : copy rhel-client-5.6-x86_64-dvd1.iso, rhel-client-5.6-x86_64-dvd2.iso, rhel-workstation-4.8-x84_64-dvd.iso, rhel-workstation-6.0-x86_64-dvd.iso, systemrescuecd_2.0.1_11859.iso in /tftp/ISO

mkdir -p /tftp/RHEL/RHEL4.8-64bits mkdir -p /tftp/RHEL/RHEL6.0-64bits mkdir -p /tftp/TOOLS/RESCUECD

add in /etc/fstab :

/tftp/ISO/systemrescuecd_2.0.1_11859.iso	/tftp/TOOLS/RESCUECD	iso9660	loop	0	0
/tftp/ISO/rhel-workstation-4.8-x84_64-dvd.iso	/tftp/RHEL/RHEL4.8-64bits	iso9660	loop	0	0
/tftp/ISO/rhel-workstation-6.0-x86_64-dvd.iso	/tftp/RHEL/RHEL6.0-64bits	iso9660	loop	0	0

mount -a

Exports :

add the following line in /etc/exports

/tftp/scripts	*(ro,no_subtree_check,no_root_squash)
/tftp/TOOLS/RESCUECD	*(ro,no_subtree_check)
/tftp/config *(async,ro,no_subtree_check)
/tftp/nfsroot-amd64-squeeze *(async,ro,no_subtree_check,no_root_squash)
/tftp/nfsroot-i386-squeeze *(async,ro,no_subtree_check,no_root_squash)
/tftp/RHEL/RHEL4.8-64bits *(ro,no_subtree_check)
/tftp/RHEL/RHEL6.0-64bits *(ro,no_subtree_check)

RHEL Kickstart :

mkdir -p /tftp/RHEL/config/rhel4 mkdir -p /tftp/RHEL/config/rhel5 mkdir -p /tftp/RHEL/config/rhel6

cd /tftp/RHEL/config/rhel4 create file ks_rhel4_64bits_base :

ks_rhel4_64bits_base.tar

Create file ks_rhel4_64bits_eve :

ks_rhel4_64bits_eve.tar

cd /tftp/RHEL/config/rhel5 create file ks_rhel5_64bits_base :

ks_rhel5_64bits_base.tar

Create file ks_rhel5_64bits_eve :

ks_rhel5_64bits_eve.tar

cd /tftp/RHEL/config/rhel6 create file ks_rhel6_64bits_base :

ks_rhel6_64bits_base.tar

Create ks_rhel6_64bits_eve :

ks_rhel6_64bits_eve.tar
Scripts Admin

mkdir /tftp/scripts create file updateclass.sh :

#!/bin/bash
# assign classes hosts
compil=`ldapsearch -H ldap://ldap.eve -x -b ou=compilation,ou=hosts,dc=eve-team,dc=com description=*amd64* | grep ^cn | awk -F " " '{print$2}' | tr '\n' '|' | sed "s/.$//"`
workstation=`ldapsearch -H ldap://ldap.eve -x -b ou=workstations,ou=hosts,dc=eve-team,dc=com description=*amd64* | grep ^cn | awk -F " " '{print$2}' | tr '\n' '|' | sed "s/.$//"`
prod=`ldapsearch -H ldap://ldap.eve -x -b ou=prod,ou=hosts,dc=eve-team,dc=com description=*amd64* | grep ^cn | awk -F " " '{print$2}' | tr '\n' '|' | sed "s/.$//"`
i386=`ldapsearch -H ldap://ldap.eve -x -b ou=hosts,dc=eve-team,dc=com "(&(cn=*)(description=*i386*)(|(ou=run)(ou=prod)(ou=workstation)(ou=compilation)))" | grep ^cn | awk -F " " '{print$2}' | tr '\n' '|' | sed "s/.$//"`

cat > /tftp/config/class/50-host-classes <> /tftp/config/class/50-host-classes
cat >> /tftp/config/class/50-host-classes <> /tftp/config/class/50-host-classes
cat >> /tftp/config/class/50-host-classes <> /tftp/config/class/50-host-classes
cat >> /tftp/config/class/50-host-classes <> /tftp/config/class/50-host-classes
cat >> /tftp/config/class/50-host-classes <

Client Configuration

On ldap, add for each client :

dhcpStatements: filename "pxelinux.0"
dhcpOption: host-name "ata11"

You may also like...

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *