Post Reply 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Useful Scripts
2012-06-28, 09:13 (This post was last modified: 2012-06-28 09:26 by ZeroQI.)
Post: #4
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...

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

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 6) iSCSI Boot iso (int 0x13 or iSCSI driver managed)
echo 7) http sanbooot (Currently fails with)
echo 8) memdisk http load
echo 9) Reboot (if compiled in kernel)
echo 0) Exit to iPXE shell prompt
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

chain show_all_variables.ipxe
goto menu

chain speed_test.ipxe
goto menu

chain /pxelinux.cfg/3.86/vesamenu.c32 ../skin/default/graphics.conf ../default ../pxelinux-not-loaded
prompt Press a key to continue...
goto menu

set 209:string ../pxelinux-loader
set 210:string pxelinux.cfg/3.86/
chain ${210:string}pxelinux.0
goto end

set 209:string ../pxelinux-loader
set 210:string pxelinux.cfg/4.04/
chain ${210:string}/pxelinux.0
goto end

#ipxe ibft support passing 1 parameter only
set keep-san 1
#set initiator-iqn
sanboot --drive 0x81 iscsi:${next-server}${next-server}-recovery
Goto end

#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

#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
#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

goto end

reboot ||

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...


goto host_${hostname} || goto unknown



echo Unknown host ${hostname}

#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}${next-server}-test
set root-path iscsi:${initiator-iqn}-test

#sanhook --drive 0x80 --no-describe
#sanboot --drive 0x81 --no-describe

sanhook iscsi:${next-server}${next-server}-${net0/mac:hexhyp} ||
sanboot --drive 0x81 --no-describe iscsi:${next-server}${next-server}-esx41
sanboot ${root-path} ||
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
Useful Scripts - ZeroQI - 2012-06-20, 15:23
RE: Useful Scripts - robinsmidsrod - 2012-06-27, 08:03
RE: Useful Scripts - ZeroQI - 2012-06-27, 10:16
Speed_test.ipxe - ZeroQI - 2012-06-28 09:13

User(s) browsing this thread: 1 Guest(s)