tftp+syslinux 6.x 搭建PXE系统(支持EFI模式):
apt-get install tftpd-hpa
apt-get install make gcc
apt-get install nasm uuid-dev
wget https://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.03.tar.gz
tar zxfv syslinux-6.03.tar.gz
cd syslinux-6.03
make
make install
非EFI:
mkdir /var/lib/tftpboot/bios
cp -rv syslinux-6.03/bios/core/pexlinux.0 /var/lib/tftpboot/bios/
cp -rv syslinux-6.03/bios/com32/elflink/ldlinux/ldlinux.c32 /var/lib/tftpboot/bios/
cp -rv syslinux-6.03/bios/com32/lib/libcom32.c32 /var/lib/tftpboot/bios/
cp -rv syslinux-6.03/bios/com32/libutil/libutil.c32 /var/lib/tftpboot/bios/
cp -rv syslinux-6.03/bios/com32/menu/vesamenu.c32 /var/lib/tftpboot/bios/
cp -rv syslinux-6.03/bios/com32/modules/pxechn.c32 /var/lib/tftpboot/bios/
mkdir /var/lib/tftpboot/bios/pxelinux.cfg
vi /var/lib/tftpboot/bios/pxelinux.cfg/default
DEFAULT vesamenu.c32
TIMEOUT 0
ONTIMEOUT BootLocal
PROMPT 0
MENU TITLE PXE Menu
NOESCAPE 1
LABEL 1. UBT14043-sda
kernel tftp://10.0.0.2/images/UBT14043-x86_64/linux
append initrd=tftp://10.0.0.2/images/UBT14043-x86_64/initrd.gz ksdevice=bootif lang= locale=en_US priority=critical netcfg/choose_interface=em1 netcfg/dhcp_timeout=120 url=tftp://10.0.0.2/preseeds/ubt14043_sda.seed hostname=shandtestG8 domain=spreadtrum.com
ENDTEXT
:wq
mkdir /var/lib/tftpboot/preseeds (该目录下放Ubuntu的seed文件)
DHCP指向文件为bios/pxelinux.0
EFI:
mkdir /var/lib/tftpboot/efi64
cp -rv syslinux-6.03/efi64/efi/syslinux.efi /var/lib/tftpboot/efi64/
cp -rv syslinux-6.03/efi64/com32/elflink/ldlinux/ldlinux.c32 /var/lib/tftpboot/efi64/
cp -rv syslinux-6.03/efi64/com32/lib/libcom32.c32 /var/lib/tftpboot/efi64/
cp -rv syslinux-6.03/efi64/com32/libutil/libutil.c32 /var/lib/tftpboot/efi64/
cp -rv syslinux-6.03/efi64/com32/menu/vesamenu.c32 /var/lib/tftpboot/efi6/
cp -rv syslinux-6.03/efi64/com32/modules/pxechn.c32 /var/lib/tftpboot/efi64/
cp -rv /var/lib/tftpboot/bios/pxelinux.cfg /var/lib/tftpboot/efi64/
DHCP指向文件为efi64/pxelinux.efi
本文转自linux博客51CTO博客,原文链接http://blog.51cto.com/yangzhiming/2062092如需转载请自行联系原作者
yangzhimingg