|
option domain-name "mydomain";
ddns-update-style none;
max-lease-time 7200;
server-name "bootserver";
default-lease-time 600;
allow booting;
allow bootp;
subnet 192.168.138.0 netmask 255.255.255.0 {
range 192.168.138.1 192.168.138.254;
deny unknown-clients;
}
group pxe {
filename "pxelinux.0";
host testserver { hardware ethernet 00: 0C :29:70:24:5B; fixed-address
192.168.138.30; }
}
|
[root@bsvr] #service dhcpd restart
|
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
disable = no
}
|
[root@bsvr]#mkdir /mnt/iso
[root@bsvr]#mount -o loop,ro RHEL4-U2-i386-AS-disc1.iso /mnt/iso
[root@bsvr]#cp /mnt/iso/isolinux/initrd.img /tftpboot
[root@bsvr]#cp /mnt/iso/isolinux/vmlinuz /tftpboot
[root@bsvr]#mv /tftpboot/initrd.img /tftpboot/initrd-rhel4u2-i386.img
[root@bsvr]#mv /tftpboot/vmlinuz /tftpboot/vmlinuz-rhel4u2-i386
|
[root@bsvr]#cp /usr/lib/syslinux/pxelinux.0 /tftpboot/
|
C 0A 88A 1E > C 0A 88A 1 > … > C0 > C > default
|
DEFAULT rhel4u2-i386
DISPLAY pxelinux.cfg/list
PROMPT 1
LABEL rhel3u6-i386
KERNEL vmlinuz-rhel3u6-i386
APPEND initrd=initrd-rhel3u6-i386.img
LABEL rhel3u6-x86_64
KERNEL vmlinuz-rhel3u6-x86_64
APPEND initrd=initrd-rhel3u6-x86_64.img devfs=nomount ramdisk_size=9216
LABEL rhel4u2-i386
KERNEL vmlinuz-rhel4u2-i386
APPEND initrd=initrd-rhel4u2-i386.img ramdisk_size=8192
|
Choose one of the following Linux distributions for your installation:
Name Distribution Arch. Installation media
-------------------------------------------------------------------------
rhel3u6-i386 RHEL 3 AS U6 i386 192.168.138.1:/instsvr/i386/rhel3u6
rhel3u6-x86_64 RHEL 3 AS U6 x86_64 192.168.138.1:/instsvr/x86_64/rhel3u6
rhel4u2-i386 RHEL 4 AS U2 i386 192.168.138.1:/instsvr/i386/rhel4u2
|
[root@bsvr]#service xinetd restart
|
|
[root@bsvr]#mkdir /instsvr
[root@bsvr]#mv RHEL4-U2-i386-AS-disc1.iso /instsvr/i386/rhel4u2
[root@bsvr]#mv RHEL4-U2-i386-AS-disc2.iso /instsvr/i386/rhel4u2
[root@bsvr]#mv RHEL4-U2-i386-AS-disc3.iso /instsrv/i386/rhel4u2
[root@bsvr]#mv RHEL4-U2-i386-AS-disc4.iso /instsrv/i386/rhel4u2
|
/instsvr *(ro,no_root_squash,sync)
|
[root@bsvr]# service portmap restart; service nfs restart
|
[root@bsvr]#showmount -e localhost
Export list for localhost:
/instsrv *
|
注意:笔者在此处删除了原文的kickstart样例,因为,不同公司 有不同的安装需求,放一个样例在这里实在没有什么意思。
对于kickstart文件,有一点值得我们注意,那就是 %post 以后代表完成系统安装之后将要执行的命令,我们可以在此配置系统,比如调整内核参数,配置主机防火墙等等。
|
nfs:192.168.138.1:/instsvr/ks/ks.cfg
|
LABEL rhel4u2-i386
KERNEL vmlinuz-rhel4u2-i386
APPEND ks=nfs:192.168.138.1:/instsvr/ks/ks.cfg initrd=initrd-rhel4u2-i386.img
ramdisk_size=8192
|