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