centos7 pxe {uefi,legacy} boot装机

本文介绍了如何使用PXE进行CentOS7的UEFI和Legacy模式装机,通过shell脚本pxe.sh配合ks.cfg配置文件,结合安装光盘挂载,实现自动化安装。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

pxe装机shell脚本,将脚本保存为pxe.sh,将ks.cfg、efi.ks.cfg文件与pxe.sh放在同一目录,挂载centos7安装光盘

#!/bin/bash
#pxe install script
#version:v1.0
#
if [ -f $PWD/ks.cfg ]  && [ -f $PWD/efi.ks.cfg ]
then
  echo "ks.cfg and efi.ks.cofg file exists!"
  break
elif [ -f $PWD/ks.cfg ]
then
  echo "ks.cfg file exists!"
  break
elif [ -f $PWD/efi.ks.cfg ]
then
  echo "efi.ks.cfg file exists!"
  break
else
  echo "efi.ks.cfg or ks.cfg file does not exist!"
  exit
fi

##########function definition##########
#tftp file
TFTP_FILE(){
   
cat > $PWD/pxe_install/tftp << EOF
# default: off
# description: The tftp server serves files using the trivial file transfer \
#       protocol.  The tftp protocol is often used to boot diskless \
#       workstations, download configuration files to network-aware printers, \
#       and to start the installation process for some operating systems.
service tftp
{
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        serve
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值