工作环境: rhel 5.4
1.挂载系统的光盘
mkdir -pv /mnt/cdrom
mount /dev/cdrom /mnt/cdrom
或者将iso 文件上传到root的家目录执行
mount -o loop /root/rhel.iso /mnt/cdrom
2.配置yum源。安装所需的工作.
vim /etc/yum.repos.d/rhel-local.repo
如下:
[rhel-Server]
name=Red Hat Enterpise Server
baseurl=file:///mnt/cdrom/Server
enabled=1
gpgcheck=1
gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release
[rhel-Cluster]
name=Red Hat Enterpise Cluster
baseurl=file:///mnt/cdrom/Cluster
enabled=1
gpgcheck=1
gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release
[rhel-ClusterStorage]
name=Red Hat Enterpise ClusterStorage
baseurl=file:///mnt/cdrom/ClusterStorage
enabled=1
gpgcheck=1
gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release
[rhel-VT]
name=Red Hat Enterpise VT
baseurl=file:///mnt/cdrom/VT
enabled=1
gpgcheck=1
gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release
可以通过yum repolist 来查看系统所有的 软件仓库
3.安装所需的软件:
system-config-kickstart
dhcpd
vsftpd
tftp
执行如下命令
yum install vsftpd dhcpd tftp* system-config-kickstart -y
4.配置所有的软件
kickstart 运行执行运行system-config-kickstart 来定义自己的ks.cfg
dhcpd 配置/etc/dhcpd.conf r dhcpd.conf.sample 文件
vsftpd把/mnt/cdrom 所有的文件拷贝到/var/ftp/pub cp -r ./var/ftp/pub
tftp配置/etc/xined.d/tftp 把disable 修改为no
5. 执行
service vsftpd restart
service dhcpd restart
service xinetd restart
6.查看 系统的/tftpboot
先拷贝驱动
cp /usr/lib/syslinux/pxelinux.0 /tftpboot
cp /mnt/cdrom/images/pxeboot/{vmlinuz,initrd.img} /tftpboot
mkdir -pv pxelinux.cfg
cd pxelinux.cfg
cp /mnt/cdrom/isolinux/isolinux.cfg pxelinux.cfg/default
cd pxelinux.cfg/default
vim default
修改如下:
default linux
prompt 1
timeout 6
display boot.msg
F1 boot.msg
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg
label linux
kernel vmlinuz
append ks=ftp://192.168.145.100/pub/ks.cfg ksdevice=eth0 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 -