PXELINUX基本已经没有人在维护了,iPXE在支持HTTP等高级传输协议的同时还支持动态语言php之类的解析,同时还能够烧录在网卡上替代网卡出厂设置。
惟一比PXELINUX复杂的是这玩意须要本身编译,官方释出的版本会一直重复一个死循环。官方网站给的依赖包有问题,同时iPXE有本身的语法,pxeliux.cfg下的文件不能直接拿来用。此次重复搞这些东西基本上把之前踩过的坑从新都踩了一次,记录一下省得下次又浪费时间php
http://ipxe.org/cmd Download and boot a Linux kernel with an initrd
kernel http://192.168.0.1/vmlinuz
initrd http://192.168.0.1/initrd.img
boothtml
[root@kickstart ks]# uname -a
Linux kickstart.share.demo 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
yum -y install gcc binutils make perl liblzma xz-devel mtools mkisofsshell
[root@kickstart ~]# cd ipxe/src/
[root@kickstart src]# cat demo.ipxe
#!ipxe
dhcp
chain http://kickstart.share.demo/ks/boot.ipxecentos
[root@kickstart src]# make bin/undionly.kpxe EMBED=demo.ipxeapp
[root@kickstart src]# cat /var/www/html/ks/boot.ipxe
#!ipxedom
echo product...........: ${product}
echo manufacturer......: ${manufacturer}
echo platform..........: ${platform}
echo chip .............: ${chip}
echo serial............: ${serial}
echo asset.............: ${asset}
echo mac...............: ${mac}
echo ip................: ${ip}
echo netmask...........: ${netmask}
echo gateway...........: ${gateway}
echo dns...............: ${dns}
echo domain............: ${domain}
echo dhcp-server.......: ${dhcp-server}
echo filename..........: ${filename}
echo next-server.......: ${next-server}
echo boot menu will show in 5 seconds
sleep 5ide
#login
#iseq ${username} fire && goto start || goto error网站
:start
menu
item --gap -- Vetting CentOS
item --key 7 CentOS7 7---- CentOS 7
item --key 6 CentOS6 6---- CentOS 6centos7
choose --default CentOS7 --timeout 6000 target && goto ${target}code
:CentOS7
kernel http://kickstart.share.demo/centos7/images/pxeboot/vmlinuz ks=http://kickstart.share.demo/ks/cenos7_text.ks
initrd http://kickstart.share.demo/centos7/images/pxeboot/initrd.img
boot
:CentOS6
kernel http://kickstart.share.demo/centos6/images/pxeboot/vmlinuz ks=http://kickstart.share.demo/ks/centos6_text.ks
initrd http://kickstart.share.demo/centos6/images/pxeboot/initrd.img
boot
:localsanboot --no-describe --drive 0x80 || goto start:shellshell || goto start:rebootreboot || goto start:errorecho You are not intened to be hereecho This is for TEST use onlyecho Which will destory ALL YOU HARDDISK DATAecho If you still believe you need credentialsecho blame jere@echo Warning will be disappeared in 30 secondsecho And your computer will start from local hard disk automaticallysleep 30local || reboot