============
Here is a small test showing me how long it takes in seconds to transfer files of different sizes, to compare FTP, TFTP, and HTTP performance...
Code:
#!ipxe
echo ===============================================================================
time imgfetch tftp://${next-server}/diag/test/1MB && imgfree && set tftp 1 ||
time imgfetch http://${next-server}/diag/test/1MB && imgfree && set http 1 ||
time imgfetch ftp://serva:serva@${next-server}:21/diag/test/1MB && imgfree && set ftp 1 ||
#echo ===============================================================================
#isset $(tftp) && time imgfetch tftp://${next-server}/diag/test/5MB && imgfree ||
#isset $(hftp) && time imgfetch http://${next-server}/diag/test/5MB && imgfree ||
#isset $(ftp) && time imgfetch ftp://serva:serva@${next-server}/diag/test/5MB && imgfree ||
echo ===============================================================================
isset $(tftp) && time imgfetch tftp://${next-server}/diag/test/10MB && imgfree ||
isset $(hftp) && time imgfetch http://${next-server}/diag/test/10MB && imgfree ||
isset $(ftp) && time imgfetch ftp://serva:serva@${next-server}/diag/test/10MB && imgfree ||
#echo ===============================================================================
#isset $(tftp) && time imgfetch tftp://${next-server}/diag/test/20MB && imgfree ||
#isset $(hftp) && time imgfetch http://${next-server}/diag/test/20MB && imgfree ||
#isset $(ftp) && time imgfetch ftp://serva:serva@${next-server}/diag/test/20MB && imgfree ||
#echo ===============================================================================
#isset $(tftp) && time imgfetch tftp://${next-server}/diag/test/50MB && imgfree ||
#isset $(hftp) && time imgfetch http://${next-server}/diag/test/50MB && imgfree ||
#isset $(ftp) && time imgfetch ftp://serva:serva@${next-server}/diag/test/50MB && imgfree ||
echo ===============================================================================
isset $(tftp) && time imgfetch tftp://${next-server}/diag/test/100MB && imgfree ||
isset $(hftp) && time imgfetch http://${next-server}/diag/test/100MB && imgfree ||
isset $(ftp) && time imgfetch ftp://serva:serva@${next-server}/diag/test/100MB && imgfree ||
echo ===============================================================================
prompt Press a key to continue...
=======
Before
menu command i made a small menu that would be called, allowing me to load either PXElinux 3.86 or PXElinux 4.04 with the same menu, so it is easy to carry out tests...
Might be useful for people using older versions of iPxe
Code:
:menu
echo iPXE menu
echo =========
echo 1) Show_all_variables.ipxe
echo 2) Speed_test.ipxe
echo ===============================================
echo 3) iPXE -> Vesamenu.c32 [no pxelinux, exit when runnin script]
echo 4) TFTP Chainload PXElinux 3.86 [Com32]
echo 5) TFTP Chainload PXElinux 4.04 [Com32R]
echo
echo 6) iSCSI Boot iso (int 0x13 or iSCSI driver managed)
echo 7) http sanbooot (Currently fails with)
echo 8) memdisk http load
echo
echo 9) Reboot (if compiled in kernel)
echo 0) Exit to iPXE shell prompt
echo
echo -n Please select the option:
read key
goto option_${key} || goto menu # loop back if empty or wrong
#iseq option_${key} option_ && goto menu || #loop back if empty choice only
echo "goto" support not implemented option for key "${key}" doesn't exist
prompt Press a key to continue...
reboot ||
echo "reboot" support not implemented
autoboot
:option_1
chain show_all_variables.ipxe
goto menu
:option_2
chain speed_test.ipxe
goto menu
:option_3
chain /pxelinux.cfg/3.86/vesamenu.c32 ../skin/default/graphics.conf ../default ../pxelinux-not-loaded
prompt Press a key to continue...
goto menu
:option_4
set 209:string ../pxelinux-loader
set 210:string pxelinux.cfg/3.86/
chain ${210:string}pxelinux.0
goto end
:option_5
set 209:string ../pxelinux-loader
set 210:string pxelinux.cfg/4.04/
chain ${210:string}/pxelinux.0
goto end
:option_6
#ipxe ibft support passing 1 parameter only
set keep-san 1
#set initiator-iqn iqn.1998-01.com.vmware:ipxe.testlab.bv.ar.us.local
#sanhook iscsi:192.168.65.2::::iqn.1991-05.com.microsoft:ipxe-target
sanboot --drive 0x81 iscsi:${next-server}::::iqn.2008-08.com.starwindsoftware:${next-server}-recovery
Goto end
:option_7
#sanboot --drive 0x81 --no-describe http://${next-server}/iso/Utilities/7rd32.iso
imgfetch iso/Windows_Tiny7.iso
chain pxelinux.cfg/3.86/memdisk iso raw
goto end
:option_8
#imgfetch http://${next-server}/iso/ReflashUtility1-10.iso
#chain http://${next-server}/pxelinux.cfg/3.86/memdisk iso raw
#syno_hw_version=DS1010+v20 ihd_num=2 init=/sbin/init /etc/sh
###loadbusybox
#kernel /synology/kernel/vmlinuz2
#initrd /synology/kernel/rd.gz
#imgargs vmlinuz2 root=/dev/sda1 init=/bin/sh raid=noautodetect
kernel /synology/kernel/vmlinuz2
initrd /synology/kernel/rd.gz
imgargs vmlinuz2 root=/dev/sda1 init=/bin/sh
imgstat
boot
goto end
:option_9
reboot ||
:option_0
:end
echo "menu.ipxe: End of script"
shell ||
Here is the iSCSI code i wrote when using
starwind software iSCSI solution...
I thought it could help somebody doing the same...
Code:
#!ipxe
dhcp
goto host_${hostname} || goto unknown
:host_thinclient1
sanboot iscsi:192.168.0.1::::iqn.2010-04.org.ipxe:winxp
:host_thinclient2
sanboot iscsi:192.168.0.1::::iqn.2010-04.org.ipxe:win7
:unknown
echo Unknown host ${hostname}
#!ipxe
#to enable when embedded, use cache set to 1 if kkpxe, not for kpxe due to dropped pxe stack
#set use-cached 0
#dhcp net0
set keep-san 1
set initiator-iqn ${next-server}::::iqn.2008-08.com.starwindsoftware:${next-server}-test
set root-path iscsi:${initiator-iqn}-test
#sanhook --drive 0x80 --no-describe iscsi:10.0.0.1::::iqn.2008-08.com.starwindsoftware:10.0.0.1-test
#sanboot --drive 0x81 --no-describe iscsi:10.0.0.1::::iqn.2008-08.com.starwindsoftware:10.0.0.1-esx41
sanhook iscsi:${next-server}::::iqn.2008-08.com.starwindsoftware:${next-server}-${net0/mac:hexhyp} ||
sanboot --drive 0x81 --no-describe iscsi:${next-server}::::iqn.2008-08.com.starwindsoftware:${next-server}-esx41
sanboot ${root-path} ||