升级系统(减少漏洞等,建议采用新的):
# yum -y update
安装所需要的软件:
# yum -y install nfs-utils tftp-server xinetd dhcp syslinux dracut-network
为后面生成initrd.img时需要打开NFS-root支持做准备,上面dracut-network包安装后在/etc/dracut.conf文件中添加:
add_dracutmodules+="nfs"
关闭SELinux:
修改/etc/selinux/config,设置SELINUX=disabled:# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
必要时需要重启系统,以便使其生效。
配置TFTP服务(通过xinetd启动):
设置/etc/xinetd.d/tftp文件:
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot #-s 表示用/var/lib/tftpboot作为tftp服务的根目录
disable = no #要修改成no,以便启动
per_source = 11
cps = 100 2
flags = IPv4
}
重启xinetd服务:
# systemctl restart xinetd