├── README.md ├── files ├── ini.vbs ├── ipxe-i386.efi ├── ipxe-snponly-i386.efi ├── ipxe-snponly-x86-64.efi ├── ipxe-undionly.kpxe ├── ipxe-x86_64.efi ├── ipxe.dsk ├── ipxe.iso ├── ipxe.lkrn ├── ipxe.pxe ├── ipxe.usb ├── memdisk.php ├── memdisk.vbs ├── menu-php.ipxe ├── menu-vbs.ipxe ├── menu.ipxe ├── sanboot.php ├── sanboot.vbs ├── wimboot ├── wimboot.i386 └── wimboot.vbs └── pxesrv.zip /README.md: -------------------------------------------------------------------------------- 1 | # tinypxeserver 2 | 3 | A small portable dhcp server including a tftp and a http server.
4 |
5 | This is freeware (and will always be), should be opensource and the unique here idea is to share and contribute.
6 |
7 | -dhcp daemon supports an alternative filename based on the user-class thus enabling chainloading (gpxe->pxelinux, ipxe->script, etc), and also support settings dhcp options (which can then be used by your boot loader)
8 | -tftp daemon supports tsize and blksize commands.
9 | -http daemon support head, range (mandatory for ipxe sanboot options) and over 2gb iso.
10 | -new in version 1.0.0.7 : BINL (RIS & WDS) support
11 | -new in version 1.0.0.10 : DNS daemon
12 | -new in version 1.0.0.14 : ProxyDHCP option
13 | -new in version 1.0.0.18 : support pcbios/EFI mode
14 | -new in version 1.0.0.23 : php,vbs,py files can be processed server side using php, vbs, py entries under web section
15 |
16 | Discuss it here : hhttp://reboot.pro/index.php?showtopic=18962 .
17 | -------------------------------------------------------------------------------- /files/ini.vbs: -------------------------------------------------------------------------------- 1 | Function ReadIni( myFilePath, mySection, myKey ) 2 | ' This function returns a value read from an INI file 3 | ' 4 | ' Arguments: 5 | ' myFilePath [string] the (path and) file name of the INI file 6 | ' mySection [string] the section in the INI file to be searched 7 | ' myKey [string] the key whose value is to be returned 8 | ' 9 | ' Returns: 10 | ' the [string] value for the specified key in the specified section 11 | ' 12 | ' CAVEAT: Will return a space if key exists but value is blank 13 | ' 14 | ' Written by Keith Lacelle 15 | ' Modified by Denis St-Pierre and Rob van der Woude 16 | 17 | Const ForReading = 1 18 | Const ForWriting = 2 19 | Const ForAppending = 8 20 | 21 | Dim intEqualPos 22 | Dim objFSO, objIniFile 23 | Dim strFilePath, strKey, strLeftString, strLine, strSection 24 | 25 | Set objFSO = CreateObject( "Scripting.FileSystemObject" ) 26 | 27 | ReadIni = "" 28 | strFilePath = Trim( myFilePath ) 29 | strSection = Trim( mySection ) 30 | strKey = Trim( myKey ) 31 | 32 | If objFSO.FileExists( strFilePath ) Then 33 | Set objIniFile = objFSO.OpenTextFile( strFilePath, ForReading, False ) 34 | Do While objIniFile.AtEndOfStream = False 35 | strLine = Trim( objIniFile.ReadLine ) 36 | 37 | ' Check if section is found in the current line 38 | If LCase( strLine ) = "[" & LCase( strSection ) & "]" Then 39 | strLine = Trim( objIniFile.ReadLine ) 40 | 41 | ' Parse lines until the next section is reached 42 | Do While Left( strLine, 1 ) <> "[" 43 | ' Find position of equal sign in the line 44 | intEqualPos = InStr( 1, strLine, "=", 1 ) 45 | If intEqualPos > 0 Then 46 | strLeftString = Trim( Left( strLine, intEqualPos - 1 ) ) 47 | ' Check if item is found in the current line 48 | If LCase( strLeftString ) = LCase( strKey ) Then 49 | ReadIni = Trim( Mid( strLine, intEqualPos + 1 ) ) 50 | ' In case the item exists but value is blank 51 | If ReadIni = "" Then 52 | ReadIni = " " 53 | End If 54 | ' Abort loop when item is found 55 | Exit Do 56 | End If 57 | End If 58 | 59 | ' Abort if the end of the INI file is reached 60 | If objIniFile.AtEndOfStream Then Exit Do 61 | 62 | ' Continue with next line 63 | strLine = Trim( objIniFile.ReadLine ) 64 | Loop 65 | Exit Do 66 | End If 67 | Loop 68 | objIniFile.Close 69 | Else 70 | WScript.Echo strFilePath & " doesn't exists. Exiting..." 71 | Wscript.Quit 1 72 | End If 73 | End Function 74 | 75 | Sub WriteIni( myFilePath, mySection, myKey, myValue ) 76 | ' This subroutine writes a value to an INI file 77 | ' 78 | ' Arguments: 79 | ' myFilePath [string] the (path and) file name of the INI file 80 | ' mySection [string] the section in the INI file to be searched 81 | ' myKey [string] the key whose value is to be written 82 | ' myValue [string] the value to be written (myKey will be 83 | ' deleted if myValue is ) 84 | ' 85 | ' Returns: 86 | ' N/A 87 | ' 88 | ' CAVEAT: WriteIni function needs ReadIni function to run 89 | ' 90 | ' Written by Keith Lacelle 91 | ' Modified by Denis St-Pierre, Johan Pol and Rob van der Woude 92 | 93 | Const ForReading = 1 94 | Const ForWriting = 2 95 | Const ForAppending = 8 96 | 97 | Dim blnInSection, blnKeyExists, blnSectionExists, blnWritten 98 | Dim intEqualPos 99 | Dim objFSO, objNewIni, objOrgIni, wshShell 100 | Dim strFilePath, strFolderPath, strKey, strLeftString 101 | Dim strLine, strSection, strTempDir, strTempFile, strValue 102 | 103 | strFilePath = Trim( myFilePath ) 104 | strSection = Trim( mySection ) 105 | strKey = Trim( myKey ) 106 | strValue = Trim( myValue ) 107 | 108 | Set objFSO = CreateObject( "Scripting.FileSystemObject" ) 109 | Set wshShell = CreateObject( "WScript.Shell" ) 110 | 111 | strTempDir = wshShell.ExpandEnvironmentStrings( "%TEMP%" ) 112 | strTempFile = objFSO.BuildPath( strTempDir, objFSO.GetTempName ) 113 | 114 | Set objOrgIni = objFSO.OpenTextFile( strFilePath, ForReading, True ) 115 | Set objNewIni = objFSO.CreateTextFile( strTempFile, False, False ) 116 | 117 | blnInSection = False 118 | blnSectionExists = False 119 | ' Check if the specified key already exists 120 | blnKeyExists = ( ReadIni( strFilePath, strSection, strKey ) <> "" ) 121 | blnWritten = False 122 | 123 | ' Check if path to INI file exists, quit if not 124 | strFolderPath = Mid( strFilePath, 1, InStrRev( strFilePath, "\" ) ) 125 | If Not objFSO.FolderExists ( strFolderPath ) Then 126 | WScript.Echo "Error: WriteIni failed, folder path (" _ 127 | & strFolderPath & ") to ini file " _ 128 | & strFilePath & " not found!" 129 | Set objOrgIni = Nothing 130 | Set objNewIni = Nothing 131 | Set objFSO = Nothing 132 | WScript.Quit 1 133 | End If 134 | 135 | While objOrgIni.AtEndOfStream = False 136 | strLine = Trim( objOrgIni.ReadLine ) 137 | If blnWritten = False Then 138 | If LCase( strLine ) = "[" & LCase( strSection ) & "]" Then 139 | blnSectionExists = True 140 | blnInSection = True 141 | ElseIf InStr( strLine, "[" ) = 1 Then 142 | blnInSection = False 143 | End If 144 | End If 145 | 146 | If blnInSection Then 147 | If blnKeyExists Then 148 | intEqualPos = InStr( 1, strLine, "=", vbTextCompare ) 149 | If intEqualPos > 0 Then 150 | strLeftString = Trim( Left( strLine, intEqualPos - 1 ) ) 151 | If LCase( strLeftString ) = LCase( strKey ) Then 152 | ' Only write the key if the value isn't empty 153 | ' Modification by Johan Pol 154 | If strValue <> "" Then 155 | objNewIni.WriteLine strKey & "=" & strValue 156 | End If 157 | blnWritten = True 158 | blnInSection = False 159 | End If 160 | End If 161 | If Not blnWritten Then 162 | objNewIni.WriteLine strLine 163 | End If 164 | Else 165 | objNewIni.WriteLine strLine 166 | ' Only write the key if the value isn't empty 167 | ' Modification by Johan Pol 168 | If strValue <> "" Then 169 | objNewIni.WriteLine strKey & "=" & strValue 170 | End If 171 | blnWritten = True 172 | blnInSection = False 173 | End If 174 | Else 175 | objNewIni.WriteLine strLine 176 | End If 177 | Wend 178 | 179 | If blnSectionExists = False Then ' section doesn't exist 180 | objNewIni.WriteLine 181 | objNewIni.WriteLine "[" & strSection & "]" 182 | ' Only write the key if the value isn't empty 183 | ' Modification by Johan Pol 184 | If strValue <> "" Then 185 | objNewIni.WriteLine strKey & "=" & strValue 186 | End If 187 | End If 188 | 189 | objOrgIni.Close 190 | objNewIni.Close 191 | 192 | ' Delete old INI file 193 | objFSO.DeleteFile strFilePath, True 194 | ' Rename new INI file 195 | objFSO.MoveFile strTempFile, strFilePath 196 | 197 | Set objOrgIni = Nothing 198 | Set objNewIni = Nothing 199 | Set objFSO = Nothing 200 | Set wshShell = Nothing 201 | End Sub -------------------------------------------------------------------------------- /files/ipxe-i386.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erwan2212/tinypxeserver/d406c46ddd2ae44a91cebccb8d6c7bf02417cd91/files/ipxe-i386.efi -------------------------------------------------------------------------------- /files/ipxe-snponly-i386.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erwan2212/tinypxeserver/d406c46ddd2ae44a91cebccb8d6c7bf02417cd91/files/ipxe-snponly-i386.efi -------------------------------------------------------------------------------- /files/ipxe-snponly-x86-64.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erwan2212/tinypxeserver/d406c46ddd2ae44a91cebccb8d6c7bf02417cd91/files/ipxe-snponly-x86-64.efi -------------------------------------------------------------------------------- /files/ipxe-undionly.kpxe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erwan2212/tinypxeserver/d406c46ddd2ae44a91cebccb8d6c7bf02417cd91/files/ipxe-undionly.kpxe -------------------------------------------------------------------------------- /files/ipxe-x86_64.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erwan2212/tinypxeserver/d406c46ddd2ae44a91cebccb8d6c7bf02417cd91/files/ipxe-x86_64.efi -------------------------------------------------------------------------------- /files/ipxe.dsk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erwan2212/tinypxeserver/d406c46ddd2ae44a91cebccb8d6c7bf02417cd91/files/ipxe.dsk -------------------------------------------------------------------------------- /files/ipxe.iso: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erwan2212/tinypxeserver/d406c46ddd2ae44a91cebccb8d6c7bf02417cd91/files/ipxe.iso -------------------------------------------------------------------------------- /files/ipxe.lkrn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erwan2212/tinypxeserver/d406c46ddd2ae44a91cebccb8d6c7bf02417cd91/files/ipxe.lkrn -------------------------------------------------------------------------------- /files/ipxe.pxe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erwan2212/tinypxeserver/d406c46ddd2ae44a91cebccb8d6c7bf02417cd91/files/ipxe.pxe -------------------------------------------------------------------------------- /files/ipxe.usb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erwan2212/tinypxeserver/d406c46ddd2ae44a91cebccb8d6c7bf02417cd91/files/ipxe.usb -------------------------------------------------------------------------------- /files/memdisk.php: -------------------------------------------------------------------------------- 1 | 1) {$root = $argv[1];} 10 | if ($root=="") { 11 | $ini = parse_ini_file("config.ini"); 12 | #current directory + root variable from config.ini 13 | $root=getcwd()."/".$ini['root']."//"; 14 | #echo $root."\n"; 15 | } 16 | $directory = new RecursiveDirectoryIterator($root); 17 | $display = Array ( 'iso' ); #could be Array ( 'iso', 'raw' ) 18 | $count = 0; 19 | foreach(new RecursiveIteratorIterator($directory) as $file) 20 | { 21 | if (in_array(strtolower(array_pop(explode('.', $file))), $display)) 22 | echo "item ". $count . " " . array_pop(explode("/", $file)) . "\n"; 23 | $count += 1; 24 | } 25 | echo "item back back\n"; 26 | echo "choose os && goto \${os}\n"; 27 | $count = 0; 28 | foreach(new RecursiveIteratorIterator($directory) as $file) 29 | { 30 | if (in_array(strtolower(array_pop(explode('.', $file))), $display)){ 31 | $filename= array_pop(explode("/", $file)); 32 | $filename = ltrim($filename, chr(92)); 33 | echo ":". $count."\n"; 34 | #memdisk, memdisk iso, or memdisk raw ? 35 | $pos = strpos($file, '.iso'); 36 | if ($pos !== false) { 37 | echo "kernel \${boot-url}/memdisk iso\n"; 38 | } else { 39 | echo "kernel \${boot-url}/memdisk raw\n"; 40 | } 41 | echo "initrd \${boot-url}/".$filename."\n"; 42 | echo "boot\n"; 43 | } 44 | $count += 1; 45 | } 46 | echo ":back\nchain menu-php.ipxe\n"; 47 | ?> -------------------------------------------------------------------------------- /files/memdisk.vbs: -------------------------------------------------------------------------------- 1 | Option Explicit 2 | on error resume next 3 | ' ********************* functions *********************** 4 | 5 | Sub Include (strFile) 6 | 'Create objects for opening text file 7 | dim objFSO 8 | Set objFSO = CreateObject("Scripting.FileSystemObject") 9 | dim objTextFile 10 | Set objTextFile = objFSO.OpenTextFile(strFile, 1) 11 | 12 | 'Execute content of file. 13 | ExecuteGlobal objTextFile.ReadAll 14 | 15 | 'CLose file 16 | objTextFile.Close 17 | 18 | 'Clean up 19 | Set objFSO = Nothing 20 | Set objTextFile = Nothing 21 | End Sub 22 | 23 | Sub getInfo(pCurrentDir,s) 24 | dim aItem 25 | For Each aItem In pCurrentDir.Files 26 | 'wscript.Echo aItem.Name 27 | If LCase(Right(Cstr(aItem.Name), 3)) = "iso" Then 28 | c=c+1 29 | if s=1 then wscript.echo "item " & c & chr(9) & aItem.name 30 | dim path 31 | path=replace(replace(aItem.path,strweb,""),"\","/") 32 | path=replace(path,"#","%23") 33 | path=replace(path," ","%20") 34 | if s=2 then 35 | wscript.echo ":" & c 36 | wscript.echo "kernel ${boot-url}/memdisk iso" 37 | wscript.echo "initrd ${boot-url}/" & path 38 | wscript.echo "boot" 39 | end if 40 | End If 41 | Next 42 | 43 | For Each aItem In pCurrentDir.SubFolders 44 | 'wscript.Echo aItem.Name & " passing recursively" 45 | call getInfo(aItem,s) 46 | Next 47 | 48 | End Sub 49 | 50 | '************************************************ 51 | dim fso 52 | Set FSO = CreateObject("Scripting.FileSystemObject") 53 | 54 | dim ScriptPath 55 | ScriptPath= Wscript.ScriptFullName 56 | dim objFile 57 | Set objFile = FSO.GetFile(ScriptPath) 58 | dim ScriptFolder 59 | ScriptFolder = FSO.GetParentFolderName(objFile) 60 | 'wscript.echo "strFolder:" & strFolder 61 | 62 | Include(ScriptFolder & "\ini.vbs") 63 | 64 | dim CurrentDirectory 65 | CurrentDirectory = fso.GetAbsolutePathName(".") 66 | 'wscript.echo "CurrentDirectory:" & CurrentDirectory 67 | 68 | dim root 69 | root= ReadIni( CurrentDirectory & "\config.ini", "dhcp", "root" ) 70 | 'wscript.echo "root:" & root 71 | 72 | dim strweb 73 | if instr(root,"\")>0 then strweb = root 74 | if instr(root,"\")=0 then strweb = CurrentDirectory & "\" & root 75 | 'wscript.echo "strweb:" & strweb 76 | 77 | dim objDir 78 | Set objDir = FSO.GetFolder(strweb) 79 | '***************** lets generate the ipxe script ************** 80 | 81 | wscript.echo "#!ipxe" 82 | wscript.echo "set boot-url http://${next-server}" 83 | wscript.echo "set iscsi-server ${next-server}" 84 | wscript.echo "set iqn iqn.2008-08.com.starwindsoftware:target1" 85 | wscript.echo "set iscsi-target iscsi:${iscsi-server}::::${iqn}" 86 | wscript.echo "set menu-timeout 5000" 87 | wscript.echo "set submenu-timeout ${menu-timeout}" 88 | wscript.echo "isset ${menu-default} || set menu-default exit" 89 | wscript.echo ":start" 90 | wscript.echo "menu Welcome to iPXE's Boot Menu" 91 | 'wscript.echo "item" 92 | 'wscript.echo "item --gap -- ------------------------- ISO ------------------------------" 93 | 94 | dim c 95 | c=0 96 | call getInfo(objDir,1) 97 | 98 | wscript.echo "item top back to top menu" 99 | wscript.echo "choose --default exit --timeout 30000 target && goto ${target}" 100 | 101 | c=0 102 | call getInfo(objDir,2) 103 | 104 | 105 | wscript.echo ":top chain menu-vbs.ipxe" 106 | wscript.echo "goto start" -------------------------------------------------------------------------------- /files/menu-php.ipxe: -------------------------------------------------------------------------------- 1 | #!ipxe 2 | 3 | set boot-url http://${next-server} 4 | 5 | # Setup some basic convenience variables 6 | set menu-timeout 5000 7 | set submenu-timeout ${menu-timeout} 8 | 9 | # Ensure we have menu-default set to something 10 | isset ${menu-default} || set menu-default exit 11 | 12 | ######## MAIN MENU ################### 13 | :start 14 | menu Welcome to iPXE's Boot Menu 15 | item 16 | item sanboot_php look for iso files and boot via sanboot 17 | item memdisk_php look for iso files and boot via memdisk 18 | item wimboot_php look for wim files and boot via wimboot 19 | item --gap -- ------------------------------ Advanced --------------------------------- 20 | item config Configure settings 21 | item shell Enter iPXE shell 22 | item reboot Reboot 23 | item exit Exit (boot local disk) 24 | choose --default exit --timeout 30000 target && goto ${target} 25 | 26 | ########## UTILITY ITEMS #################### 27 | :shell 28 | echo Type exit to get the back to the menu 29 | shell 30 | set menu-timeout 0 31 | goto start 32 | 33 | :failed 34 | echo Booting failed, dropping to shell 35 | goto shell 36 | 37 | :reboot 38 | reboot 39 | 40 | :exit 41 | exit 42 | 43 | :config 44 | config 45 | goto start 46 | ########################################################### 47 | :sanboot_php 48 | chain ${boot-url}/sanboot.php?files// || goto failed 49 | goto start 50 | 51 | :memdisk_php 52 | chain ${boot-url}/memdisk.php?files// || goto failed 53 | goto start 54 | 55 | :wimboot_php 56 | chain ${boot-url}/wimboot.php || goto failed 57 | #chain ${boot-url}/wimboot.php?files// || goto failed 58 | goto start 59 | 60 | goto start 61 | -------------------------------------------------------------------------------- /files/menu-vbs.ipxe: -------------------------------------------------------------------------------- 1 | #!ipxe 2 | 3 | #set boot-url http://${proxydhcp}/next-server 4 | set boot-url http://${next-server} 5 | 6 | # Setup some basic convenience variables 7 | set menu-timeout 5000 8 | set submenu-timeout ${menu-timeout} 9 | 10 | # Ensure we have menu-default set to something 11 | isset ${menu-default} || set menu-default exit 12 | 13 | ######## MAIN MENU ################### 14 | :start 15 | menu Welcome to iPXE's Boot Menu 16 | item 17 | item sanboot-iso Boot ISO via sanboot 18 | item memdisk-iso Boot ISO via memdisk 19 | item wimboot-wim Boot WIM 20 | item --gap -- ------------------------------ Advanced --------------------------------- 21 | item config Configure settings 22 | item shell Enter iPXE shell 23 | item reboot Reboot 24 | item exit Exit (boot local disk) 25 | choose --default exit --timeout 30000 target && goto ${target} 26 | 27 | ########## UTILITY ITEMS #################### 28 | :shell 29 | echo Type exit to get the back to the menu 30 | shell 31 | set menu-timeout 0 32 | goto start 33 | 34 | :failed 35 | echo Booting failed, dropping to shell 36 | goto shell 37 | 38 | :reboot 39 | reboot 40 | 41 | :exit 42 | exit 43 | 44 | :cancel 45 | echo You cancelled the menu, dropping you to a shell 46 | 47 | :config 48 | config 49 | goto start 50 | 51 | :back 52 | set submenu-timeout 0 53 | clear submenu-default 54 | goto start 55 | 56 | ######################################## 57 | :sanboot-iso 58 | chain ${boot-url}/sanboot.vbs 59 | goto start 60 | 61 | :memdisk-iso 62 | chain ${boot-url}/memdisk.vbs 63 | goto start 64 | 65 | :wimboot-wim 66 | chain ${boot-url}/wimboot.vbs 67 | goto start 68 | 69 | goto start 70 | 71 | -------------------------------------------------------------------------------- /files/menu.ipxe: -------------------------------------------------------------------------------- 1 | #!ipxe 2 | 3 | #set boot-url http://${proxydhcp}/next-server 4 | set boot-url http://${next-server} 5 | set iscsi-server ${next-server} 6 | set iqn iqn.2008-08.com.starwindsoftware:target1 7 | set iscsi-target iscsi:${iscsi-server}::::${iqn} 8 | set nfs-server ${next-server} 9 | set cifs-server //${next-server} 10 | 11 | # Setup some basic convenience variables 12 | set menu-timeout 5000 13 | set submenu-timeout ${menu-timeout} 14 | 15 | # Ensure we have menu-default set to something 16 | isset ${menu-default} || set menu-default exit 17 | 18 | ######## MAIN MENU ################### 19 | :start 20 | menu Welcome to iPXE's Boot Menu 21 | item 22 | item --gap -- ------------------------- Utilities ------------------------------ 23 | #item bootsan Boot On San (${iscsi-target}) 24 | item bootaoe Boot On AOE (e0.0) 25 | #item iscsi setup, sanhook or sanboot iscsi 26 | item iscsi Boot On San 27 | item pxelinux pxelinux 28 | item grub4dos grub4dos 29 | item grub2 grub2 30 | #item grub_cd boot to dvd (via grub4dos) 31 | #item grub_startrom boot to startrom.0 (via grub4dos) 32 | item grub_floppy boot floppy (via grub4dos) 33 | item grub_hd0 boot to hd0 (via grub4dos) 34 | item hdt hdt 35 | #item netbootme Netboot.Me 36 | #item undi_dos undi_dos 37 | item disk_util Disk Utilities 38 | item winpe Live Systemes 39 | item linux Install Linux Distros 40 | item --gap -- ------------------------------ Advanced --------------------------------- 41 | item config Configure settings 42 | item shell Enter iPXE shell 43 | item reboot Reboot 44 | item exit Exit (boot local disk) 45 | choose --default exit --timeout 30000 target && goto ${target} 46 | 47 | ########## UTILITY ITEMS #################### 48 | :shell 49 | echo Type exit to get the back to the menu 50 | shell 51 | set menu-timeout 0 52 | goto start 53 | 54 | :failed 55 | echo Booting failed, dropping to shell 56 | goto shell 57 | 58 | :reboot 59 | reboot 60 | 61 | :exit 62 | exit 63 | 64 | :cancel 65 | echo You cancelled the menu, dropping you to a shell 66 | 67 | :config 68 | config 69 | goto start 70 | 71 | :back 72 | set submenu-timeout 0 73 | clear submenu-default 74 | goto start 75 | 76 | ################################ disk utilities 77 | :disk_util 78 | menu Disk Utilities 79 | item disk Boot a disk img (memdisk) 80 | item flash Flash Bios (memdisk) 81 | item macrium Boot macrium linux (sanboot) 82 | item grubfm Boot grubfm (sanboot) 83 | item hbcd Boot hbcd (memdisk) 84 | item partlogic Boot partlogic (memdisk) 85 | item pmagic Boot pmagic (memdisk) 86 | item systemrescuecd Boot systemrescuecd via HTTP 87 | item gparted Boot gparted via http 88 | item redobackup Boot redobackup via NFS 89 | item clonezilla Boot clonezilla via HTTP 90 | item partition_wizard Boot Partition Wizard (memdisk) 91 | item acronis Boot Acronis True Image 2013 (memdisk) 92 | item back Back to top menu... 93 | iseq ${menu-default} menu-recovery && isset ${submenu-default} && goto menu-recovery-timed || 94 | choose selected && goto ${selected} || goto start 95 | :menu-recovery-timed 96 | choose --timeout ${submenu-timeout} --default ${submenu-default} selected && goto ${selected} || goto start 97 | 98 | :disk 99 | initrd /images/disk.img 100 | kernel /memdisk raw || goto failed 101 | boot || goto failed 102 | goto start 103 | 104 | :flash 105 | initrd ${boot-url}/images/5CJ977A.iso 106 | kernel ${boot-url}/memdisk iso || goto failed 107 | boot || goto failed 108 | goto start 109 | 110 | :macrium 111 | sanboot --no-describe ${boot-url}/_iso/rescue.iso 112 | goto start 113 | 114 | :grubfm 115 | sanboot --no-describe ${boot-url}/grubfm.iso 116 | goto start 117 | 118 | :gparted 119 | kernel ${boot-url}/_ISO/gparted/vmlinuz boot=live config union=aufs noswap noprompt vga=788 fetch=${boot-url}/_ISO/gparted/filesystem.squashfs || goto failed 120 | initrd ${boot-url}/_ISO/gparted/initrd.img || goto failed 121 | boot || goto failed 122 | goto start 123 | 124 | :systemrescuecd 125 | kernel ${boot-url}/_ISO/sysrcd-4.1.0/isolinux/rescue32 dodhcp netboot=${boot-url}/_ISO/sysrcd-4.1.0/sysrcd.dat || goto failed 126 | #kernel ${boot-url}/_ISO/sysrcd-4.1.0/isolinux/rescue32 dodhcp netboot=http://192.168.1.248/sysrcd.dat || goto failed 127 | #kernel ${boot-url}/_ISO/sysrcd-4.1.0/isolinux/rescue32 dodhcp nfsboot=${next-server}:/g/_ISO/sysrcd-4.1.0 || goto failed 128 | initrd ${boot-url}/_ISO/sysrcd-4.1.0/isolinux/initram.igz || goto failed 129 | boot || goto failed 130 | goto start 131 | 132 | :partlogic 133 | initrd ${boot-url}/images/partlogic-0.71.img 134 | kernel ${boot-url}/memdisk || goto failed 135 | boot || goto failed 136 | goto start 137 | 138 | :pmagic 139 | #sanboot ${boot-url}/images/pmagic/pmagic_2013_02_28.iso || goto failed #halts on "probing EDD" 140 | #dhcp net0 #if chainloaded 141 | #initrd ${boot-url}/images/pmagic/pmagic_2013_02_28.iso #last public iso 142 | kernel ${boot-url}/memdisk iso || goto failed 143 | initrd ${boot-url}/images/pmagic/pmagic_2014_04_28.iso 144 | boot || goto failed 145 | goto start 146 | 147 | :partition_wizard 148 | initrd ${boot-url}/_iso/pwhe8.iso 149 | kernel ${boot-url}/memdisk iso || goto failed 150 | boot || goto failed 151 | goto start 152 | 153 | :redobackup 154 | kernel ${boot-url}/_ISO/redobackup/casper/vmlinuz boot=casper netboot=nfs nfsroot=${nfs-server}:/g/_ISO/redobackup 155 | #kernel ${boot-url}/_ISO/redobackup/casper/vmlinuz boot=casper netboot=cifs nfsroot=${cifs-server}/PXE/redobackup NFSOPTS=-ouser=erwan,pass=xxxx,ro ip=dhcp ro 156 | #kernel ${boot-url}/_ISO/redobackup/casper/vmlinuz boot=casper netboot=nfs #you then need to specify /g/_ISO/redobackup in option 17 157 | initrd ${boot-url}/_ISO/redobackup/casper/initrd.lz 158 | boot || goto failed 159 | goto start 160 | 161 | :clonezilla 162 | initrd ${boot-url}/_ISO/clonezilla/live/initrd.img || goto failed 163 | kernel ${boot-url}/_ISO/clonezilla/live/vmlinuz boot=live config noswap nolocales edd=on nomodeset vga=788 nosplash noprompt fetch=${boot-url}/_ISO/clonezilla/live/filesystem.squashfs || goto failed 164 | boot || goto failed 165 | goto start 166 | 167 | :hbcd 168 | #open iso with iso editor and remove pmagic to make it ligther 169 | initrd ${boot-url}/images/hbcd152.iso 170 | kernel ${boot-url}/memdisk iso raw || goto failed 171 | boot || goto failed 172 | goto start 173 | 174 | :acronis 175 | #open iso with iso editor and remove pmagic to make it ligther 176 | initrd ${boot-url}/_iso/acronismedia.iso 177 | kernel ${boot-url}/memdisk iso raw || goto failed 178 | boot || goto failed 179 | goto start 180 | 181 | 182 | ################################# winpe 183 | :winpe 184 | menu Boot WinPe 185 | #item xpe Boot xpe 186 | #item openthinclient Boot Openthinclient 187 | #item puppy Boot puppy linux 188 | item xpcli xpcli 189 | item memdisk_winpe memdisk 190 | item sanboot_winpe Boot winpe via sanboot 191 | item wimboot Boot winpe via wimboot 192 | item startrom Boot startrom.0 (edit winnt.sif) 193 | item ubuntu-live ubuntu-live (nfs) 194 | #item ubuntu-live-ftp ubuntu-live (ftp) 195 | item centos centos (ftp) 196 | item ubuntu-cifs ubuntu-live (cifs) 197 | item dsl Damn Small Linux 198 | item grml grml (nfs) 199 | #item archlinux archlinux 200 | item mint mint (nfs) 201 | item mint-cifs mint (cifs) 202 | item back Back to top menu... 203 | iseq ${menu-default} menu-recovery && isset ${submenu-default} && goto menu-recovery-timed || 204 | choose selected && goto ${selected} || goto start 205 | :menu-recovery-timed 206 | choose --timeout ${submenu-timeout} --default ${submenu-default} selected && goto ${selected} || goto start 207 | 208 | :xpcli 209 | initrd ${boot-url}/_images/xpcli.vhd 210 | chain ${boot-url}/memdisk raw || goto failed 211 | goto start 212 | 213 | :wimboot 214 | kernel ${boot-url}/wimboot 215 | #initrd ${boot-url}/BOOTMGR BOOTMGR 216 | #initrd ${boot-url}/bootmgfw.efi bootmgfw.efi 217 | iseq ${platform} pcbios && initrd -n bootmgr.exe ${boot-url}/BOOTMGR.EXE bootmgr.exe || 218 | iseq ${platform} efi && initrd -n bootmgfw.efi ${boot-url}/bootmgfw.EFI bootmgfw.efi || 219 | #initrd ${boot-url}/BOOT/BCD BCD 220 | #initrd ${boot-url}/EFI/MICROSOFT/BOOT/BCD BCD 221 | iseq ${platform} pcbios && initrd -n bcd ${boot-url}/BOOT/BCD bcd || 222 | iseq ${platform} efi && initrd -n bcd ${boot-url}/EFI/MICROSOFT/BOOT/BCD bcd || 223 | initrd ${boot-url}/BOOT/BOOT.SDI BOOT.SDI 224 | iseq ${platform} pcbios && initrd -n boot.wim ${boot-url}/SOURCES/X86/BOOT.WIM BOOT.WIM || 225 | iseq ${platform} efi && initrd -n boot.wim ${boot-url}/SOURCES/x64/BOOT.WIM BOOT.WIM || 226 | #initrd ${boot-url}/SOURCES/x86/BOOT.WIM BOOT.WIM 227 | #initrd ${boot-url}/SOURCES/x64/BOOT.WIM BOOT.WIM 228 | #initrd ${boot-url}/SOURCES/BOOT.WIM BOOT.WIM 229 | boot || goto failed 230 | goto start 231 | 232 | :startrom 233 | chain ${boot-url}/startrom.0 || goto failed 234 | goto start 235 | 236 | :xpe 237 | initrd ${boot-url}/images/256_xpe.img 238 | chain ${boot-url}/memdisk raw || goto failed 239 | goto start 240 | 241 | :memdisk_winpe 242 | #initrd ${boot-url}/images/winpe_${buildarch}.iso 243 | initrd ${boot-url}/images/winpe.iso 244 | chain ${boot-url}/memdisk iso raw || goto failed #loads but halts after windows logo 245 | goto start 246 | 247 | :sanboot_winpe 248 | #sanboot --no-describe ${boot-url}/images/winpe_${buildarch}.iso || goto failed 249 | sanboot --no-describe ${boot-url}/images/winpe.iso || goto failed 250 | goto start 251 | 252 | :archlinux 253 | kernel ${boot-url}/_ISO/archlinux/vmlinuz archisobasedir=arch archiso_http_srv=${boot-url}/_ISO/archlinux/ ip=dhcp 254 | initrd ${boot-url}/_ISO/archlinux/archiso.img 255 | boot || goto failed 256 | goto start 257 | 258 | :mint-cifs 259 | kernel ${boot-url}/_ISO/mint/casper/vmlinuz showmounts toram root=/dev/cifs boot=casper netboot=cifs nfsroot=${cifs-server}/pxe/mint NFSOPTS=-ouser=test,pass=p@ssw0rd,ro ip=dhcp ro 260 | initrd ${boot-url}/_ISO/mint/casper/initrd.lz 261 | boot || goto failed 262 | goto start 263 | 264 | :mint 265 | kernel /_ISO/mint/casper/vmlinuz root=/dev/nfs boot=casper netboot=nfs nfsroot=${nfs-server}:/g/_ISO/mint quiet splash 266 | initrd /_ISO/mint/casper/initrd.lz 267 | boot || goto failed 268 | goto start 269 | 270 | :ubuntu-cifs 271 | #sec=ntlmssp ? 272 | #works only with 12.10, not 13.04 273 | kernel ${boot-url}/ubuntu.12.10/casper/vmlinuz showmounts toram root=/dev/cifs boot=casper netboot=cifs nfsroot=${cifs-server}/pxe/ubuntu.12.10 NFSOPTS=-ouser=test,pass=p@ssw0rd,ro ip=bootp ro 274 | initrd ${boot-url}/ubuntu.12.10/casper/initrd.lz 275 | boot || goto failed 276 | goto start 277 | 278 | :ubuntu-live 279 | kernel ${boot-url}/_ISO/ubuntu.13.04/casper/vmlinuz root=/dev/nfs boot=casper netboot=nfs nfsroot=${nfs-server}:/g/_ISO/ubuntu.13.04 quiet splash 280 | initrd ${boot-url}/_ISO/ubuntu.13.04/casper/initrd.lz 281 | boot || goto failed 282 | goto start 283 | 284 | :centos 285 | kernel ${boot-url}/_ISO/centos/isolinux/vmlinuz0 root=/dev/ram0 ramdisk_size=100000 ksdevice=eth0 ip=dhcp url --url ${boot-url}/_ISO/centos/ ks=${boot-url}/_ISO/centos/centos.cfg 286 | initrd ${boot-url}/_iso/centos/isolinux/initrd0.img 287 | boot || goto failed 288 | goto start 289 | 290 | :puppy 291 | kernel ${boot-url}/_ISO/puppy/vmlinuz PDEV1=rootfs init=/sbin/init ip=dhcp root=/dev/nfs rw nfsroot=${nfs-server}:/g/_ISO/puppy noapic acpi=off 292 | initrd ${boot-url}/_ISO/puppy/initrd.gz 293 | boot || goto failed 294 | goto start 295 | 296 | :grml 297 | initrd ${boot-url}/_iso/grml/boot/grml32small/initrd.img 298 | chain ${boot-url}/_iso/grml/boot/grml32small/vmlinuz root=/dev/nfs rw nfsroot=${nfs-server}:/g/_ISO/grml/live/grml32-small live-media-path=/ boot=live lang=us nomce apm=power-off noprompt noeject vga=791 299 | 300 | :dsl 301 | kernel ${boot-url}/images/dsl4410/linux24 ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=789 nomce noapic quiet nopcmcia noagp noswap base 302 | initrd ${boot-url}/images/dsl4410/minirt24.gz 303 | boot || goto failed 304 | goto start 305 | 306 | 307 | ################################# linux 308 | :linux 309 | menu Install Linux 310 | item ubuntu-installer-bionic ubuntu-installer-bionic over internet (memdisk) 311 | item ubuntu-installer-focal ubuntu-installer-focal over internet (memdisk) 312 | item debian-installer debian-installer over internet (memdisk) 313 | item centos-installer centos-installer over internet (memdisk) 314 | item opensuse-installer opensuse-installer over internet (sanboot) 315 | item fedora-installer fedora-installer bfo (memdisk) 316 | item debian-installer-sanboot debian-installer-sanboot 317 | item ubuntu-installer-sanboot ubuntu-installer-sanboot 318 | item back Back to top menu... 319 | iseq ${menu-default} menu-recovery && isset ${submenu-default} && goto menu-recovery-timed || 320 | choose selected && goto ${selected} || goto start 321 | :menu-recovery-timed 322 | choose --timeout ${submenu-timeout} --default ${submenu-default} selected && goto ${selected} || goto start 323 | 324 | 325 | #http://no.archive.ubuntu.com/ubuntu/dists/ 326 | #https://doc.ubuntu-fr.org/versions 327 | :ubuntu-installer-bionic 328 | cpuid --ext 29 && set arch amd64 || set arch i386 329 | initrd http://no.archive.ubuntu.com/ubuntu/dists/bionic/main/installer-${arch}/current/images/netboot/mini.iso 330 | chain ${boot-url}/memdisk iso || goto failed 331 | #or 332 | #kernel http://no.archive.ubuntu.com/ubuntu/dists/bionic/main/installer-${arch}/current/images/netboot/ubuntu-installer/${arch}/linux 333 | #initrd http://no.archive.ubuntu.com/ubuntu/dists/bionic/main/installer-${arch}/current/images/netboot/ubuntu-installer/${arch}/initrd.gz 334 | boot || goto failed 335 | goto start 336 | 337 | :ubuntu-installer-focal 338 | initrd http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/legacy-images/netboot/mini.iso 339 | chain ${boot-url}/memdisk iso || goto failed 340 | boot || goto failed 341 | goto start 342 | 343 | :debian-installer 344 | cpuid --ext 29 && set arch amd64 || set arch i386 345 | #sanboot --no-describe --keep ${boot-url}/debian-installer/i386/mini.iso || goto failed 346 | #or 347 | initrd http://debian.mirrors.ovh.net/debian/dists/stable/main/installer-${arch}/current/images/netboot/mini.iso 348 | chain ${boot-url}/memdisk iso raw || goto failed 349 | #or 350 | #kernel http://debian.mirrors.ovh.net/debian/dists/stable/main/installer-${arch}/current/images/netboot/debian-installer/${arch}/linux 351 | #initrd http://debian.mirrors.ovh.net/debian/dists/stable/main/installer-${arch}/current/images/netboot/debian-installer/${arch}/initrd.gz 352 | 353 | :centos-installer 354 | initrd ${boot-url}/centos-installer/i386/CentOS-6.4-i386-netinstall.iso 355 | chain ${boot-url}/memdisk iso || goto failed 356 | #kernel ${boot-url}/centos-installer/i386/vmlinuz 357 | #initrd ${boot-url}/centos-installer/i386/initrd.img 358 | #boot 359 | goto start 360 | 361 | :opensuse-installer 362 | sanboot --no-describe --keep ${boot-url}/opensuse-installer/openSUSE-12.3-NET-i586.iso || goto failed 363 | #initrd ${boot-url}/opensuse-installer/openSUSE-12.3-NET-i586.iso 364 | #chain ${boot-url}/memdisk iso raw || goto failed 365 | goto start 366 | 367 | :fedora-installer 368 | #sanboot --no-describe --keep ${boot-url}/fedora-installer/i386/Fedora-18-i386-netinst.iso || goto failed 369 | #or 370 | #initrd ${boot-url}/fedora-installer/i386/Fedora-18-i386-netinst.iso 371 | #chain ${boot-url}/memdisk iso || goto failed 372 | #or 373 | #kernel ${boot-url}/fedora-installer/i386/vmlinuz 374 | #initrd ${boot-url}/fedora-installer/i386/initrd.img 375 | #boot 376 | kernel ${boot-url}/memdisk 377 | initrd ${boot-url}/fedora-installer/i386/bfo.dsk 378 | boot || goto failed 379 | goto start 380 | 381 | :debian-installer-sanboot 382 | cpuid --ext 29 && set arch amd64 || set arch i386 383 | #sanboot http://ftp.fr.debian.org/debian/dists/Debian9.1/main/installer-amd64/current/images/netboot/mini.iso 384 | sanboot http://ftp.fr.debian.org/debian/dists/stable/main/installer-${arch}/current/images/netboot/mini.iso 385 | boot || goto failed 386 | 387 | :ubuntu-installer-sanboot 388 | #sanboot http://archive.ubuntu.com/ubuntu/dists/zesty/main/installer-amd64/current/images/netboot/mini.iso 389 | sanboot http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/legacy-images/netboot/mini.iso 390 | boot || goto failed 391 | 392 | ######################## other items 393 | 394 | :pxelinux 395 | #dhcp 396 | dhcp net0 397 | set 210:string tftp://${next-server}/ 398 | #set 210:string tftp://${dhcp-server}/ 399 | chain ${210:string}pxelinux.0 || goto failed 400 | goto start 401 | 402 | #use menu.ipxe as alt boot file name, not http://${dhcp-server}/menu.ipxe 403 | :grub4dos 404 | dhcp net0 405 | #set netX/next-server 192.168.1.100 406 | set 210:string tftp://${dhcp-server}/ 407 | chain ${210:string}grldr || goto failed 408 | goto start 409 | 410 | :grub2 411 | #needs bootp with proxydhcp disabled unless you reset next-server 412 | dhcp net0 413 | #set 210:string tftp://${next-server}/ 414 | set netX/next-server ${next-server} 415 | set 210:string ${boot-url}/ 416 | iseq ${platform} pcbios && chain ${210:string}grub.img || 417 | iseq ${platform} efi && chain ${210:string}grubx64.efi || 418 | goto start 419 | 420 | :grub_cd 421 | chain ${boot-url}/grub.exe --config-file="cdrom --init;map --hook;root (cd0);chainloader (cd0)" || goto failed 422 | goto start 423 | 424 | :grub_startrom 425 | chain ${boot-url}/grub.exe keeppxe --config-file="pxe detect;chainloader --force --raw (pd)/startrom.0" || goto failed 426 | goto start 427 | 428 | :grub_floppy 429 | chain ${boot-url}/grub.exe keeppxe --config-file="map --mem (pd)/images/98.ima (fd0);map --hook;root (fd0);chainloader+1;boot" || goto failed 430 | goto start 431 | 432 | 433 | :grub_hd0 434 | chain ${boot-url}/grub.exe --config-file="rootnoverify (hd0);chainloader +1" || goto failed 435 | goto start 436 | 437 | :undi_dos 438 | kernel ${boot-url}/memdisk keeppxe ACTION=install NETSHARE=sharename 439 | initrd ${boot-url}/images/undis3c.imz 440 | boot || goto failed 441 | goto start 442 | 443 | :bootsan 444 | #sanhook --drive 0x81 ${root-path} #hook a drive 445 | #sanboot --no-describe iscsi:10.0.4.1:::1:iqn.2010-04.org.ipxe.dolphin:liveinstall #boot from another media 446 | dhcp net0 447 | set keep-san 1 448 | #sanboot iscsi:${iscsi-server}:tcp:3260:0:${iqn} 449 | sanboot iscsi:${iscsi-server}::::${iqn} 450 | #boot || goto failed 451 | goto start 452 | 453 | :bootaoe 454 | dhcp net0 455 | set keep-san 1 456 | sanboot aoe:e0.0 457 | #boot || goto failed 458 | goto start 459 | 460 | :hdt 461 | sanboot --no-describe ${boot-url}/_iso/hdt-0.5.2.iso || goto failed 462 | goto start 463 | 464 | :netbootme 465 | imgfree 466 | chain http://static.netboot.me/gpxe/netbootme.kpxe 467 | 468 | ####################################################### 469 | :iscsi 470 | menu iscsi 471 | item define_ define iscsi-target 472 | item show_ show iscsi-target 473 | item sanhook_ sanhook ${iscsi-target} 474 | item sanhook_nodescribe sanhook --no-describe ${iscsi-target} 475 | item sanboot_ sanboot --keep ${iscsi-target} 476 | item back Back to top menu... 477 | iseq ${menu-default} menu-recovery && isset ${submenu-default} && goto menu-recovery-timed || 478 | choose selected && goto ${selected} || goto start 479 | :menu-recovery-timed 480 | choose --timeout ${submenu-timeout} --default ${submenu-default} selected && goto ${selected} || goto start 481 | 482 | :define_ 483 | echo -n iscsi-target: && read iscsi-target 484 | goto start 485 | 486 | :show_ 487 | echo ${iscsi-target} 488 | prompt a key to continue 489 | goto start 490 | 491 | :sanhook_ 492 | sanhook ${iscsi-target} || goto failed 493 | prompt a key to continue 494 | goto start 495 | 496 | :sanhook_nodescribe 497 | sanhook --no-describe ${iscsi-target} || goto failed 498 | prompt a key to continue 499 | goto start 500 | 501 | :sanboot_ 502 | sanboot --keep ${iscsi-target} || goto failed 503 | goto start 504 | 505 | goto start 506 | 507 | ####################################################### 508 | 509 | #Memdisk via iPXE vs. ISO Boot HTTP via iPXE: 510 | # 511 | #Memdisk via iPXE does the following things: 512 | #1) Emulates a CD-ROM allowing a Network-Based Install. 513 | #2) Masks actual system RAM because the environment memdisk creates "hides" a certain amount of RAM to allow for the ISO - This amount is generally 2x ISO Size (Maximum 2GB - I think). 514 | #3) Preloads the ISO into memory before executing the ISO. This slows boot time a bit. 515 | # 516 | #ISO Boot over HTTP via iPXE: 517 | #1) Does not emulate a CD-ROM. It is a Block Device. 518 | #2) Does not mask system RAM. 519 | #3) Executes as it reads: Faster than memdisk and no "preloading" of the ISO is required. 520 | #4) Does not hold the ISO as a readable device once the ISO is loaded unless loaded into the iBFT. -------------------------------------------------------------------------------- /files/sanboot.php: -------------------------------------------------------------------------------- 1 | 1) {$root = $argv[1];} 9 | if ($root=="") { 10 | $ini = parse_ini_file("config.ini"); 11 | #current directory + root variable from config.ini 12 | $root=getcwd()."/".$ini['root']."//"; 13 | #echo $root."\n"; 14 | } 15 | $directory = new RecursiveDirectoryIterator($root); 16 | $display = Array ( 'iso' ); 17 | $count = 0; 18 | foreach(new RecursiveIteratorIterator($directory) as $file) 19 | { 20 | if (in_array(strtolower(array_pop(explode('.', $file))), $display)) 21 | echo "item ". $count . " " . array_pop(explode("/", $file)) . "\n"; 22 | $count += 1; 23 | } 24 | echo "item back back\n"; 25 | echo "choose os && goto \${os}\n"; 26 | $count = 0; 27 | foreach(new RecursiveIteratorIterator($directory) as $file) 28 | { 29 | if (in_array(strtolower(array_pop(explode('.', $file))), $display)){ 30 | $filename= array_pop(explode("/", $file)); 31 | $filename = ltrim($filename, chr(92)); 32 | #$pos = strpos($file, ':'); 33 | #if ($pos !== false) { 34 | ##absolute path 35 | #echo ":". $count ."\nsanboot \${boot-url}/". substr($file,3) . "\ngoto start\n"; 36 | # } else { 37 | ##relative path 38 | #echo ":". $count ."\nsanboot \${boot-url}/". substr($file,0) . "\ngoto start\n"; 39 | #} 40 | echo ":". $count ."\nsanboot --no-describe \${boot-url}/".$filename. "\ngoto start\n"; 41 | } 42 | $count += 1; 43 | } 44 | echo ":back\nchain menu-php.ipxe\n"; 45 | ?> -------------------------------------------------------------------------------- /files/sanboot.vbs: -------------------------------------------------------------------------------- 1 | Option Explicit 2 | on error resume next 3 | ' ********************* functions *********************** 4 | 5 | Sub Include (strFile) 6 | 'Create objects for opening text file 7 | dim objFSO 8 | Set objFSO = CreateObject("Scripting.FileSystemObject") 9 | dim objTextFile 10 | Set objTextFile = objFSO.OpenTextFile(strFile, 1) 11 | 12 | 'Execute content of file. 13 | ExecuteGlobal objTextFile.ReadAll 14 | 15 | 'CLose file 16 | objTextFile.Close 17 | 18 | 'Clean up 19 | Set objFSO = Nothing 20 | Set objTextFile = Nothing 21 | End Sub 22 | 23 | Sub getInfo(pCurrentDir,s) 24 | dim aItem 25 | For Each aItem In pCurrentDir.Files 26 | 'wscript.Echo aItem.Name 27 | If LCase(Right(Cstr(aItem.Name), 3)) = "iso" Then 28 | c=c+1 29 | if s=1 then wscript.echo "item " & c & chr(9) & aItem.name 30 | dim path 31 | path=replace(replace(aItem.path,strweb,""),"\","/") 32 | path=replace(path,"#","%23") 33 | path=replace(path," ","%20") 34 | if s=2 then wscript.echo ":" & c & chr(9) & "sanboot --no-describe ${boot-url}" & path 35 | End If 36 | Next 37 | 38 | For Each aItem In pCurrentDir.SubFolders 39 | 'wscript.Echo aItem.Name & " passing recursively" 40 | call getInfo(aItem,s) 41 | Next 42 | 43 | End Sub 44 | 45 | '************************************************ 46 | dim fso 47 | Set FSO = CreateObject("Scripting.FileSystemObject") 48 | 49 | dim ScriptPath 50 | ScriptPath= Wscript.ScriptFullName 51 | dim objFile 52 | Set objFile = FSO.GetFile(ScriptPath) 53 | dim ScriptFolder 54 | ScriptFolder = FSO.GetParentFolderName(objFile) 55 | 'wscript.echo "strFolder:" & strFolder 56 | 57 | Include(ScriptFolder & "\ini.vbs") 58 | 59 | dim CurrentDirectory 60 | CurrentDirectory = fso.GetAbsolutePathName(".") 61 | 'wscript.echo "CurrentDirectory:" & CurrentDirectory 62 | 63 | dim root 64 | root= ReadIni( CurrentDirectory & "\config.ini", "dhcp", "root" ) 65 | 'wscript.echo "root:" & root 66 | 67 | dim strweb 68 | if instr(root,"\")>0 then strweb = root 69 | if instr(root,"\")=0 then strweb = CurrentDirectory & "\" & root 70 | 'wscript.echo "strweb:" & strweb 71 | 72 | dim objDir 73 | Set objDir = FSO.GetFolder(strweb) 74 | '***************** lets generate the ipxe script ************** 75 | 76 | wscript.echo "#!ipxe" 77 | wscript.echo "set boot-url http://${next-server}" 78 | wscript.echo "set iscsi-server ${next-server}" 79 | wscript.echo "set iqn iqn.2008-08.com.starwindsoftware:target1" 80 | wscript.echo "set iscsi-target iscsi:${iscsi-server}::::${iqn}" 81 | wscript.echo "set menu-timeout 5000" 82 | wscript.echo "set submenu-timeout ${menu-timeout}" 83 | wscript.echo "isset ${menu-default} || set menu-default exit" 84 | wscript.echo ":start" 85 | wscript.echo "menu Welcome to iPXE's Boot Menu" 86 | 'wscript.echo "item" 87 | 'wscript.echo "item --gap -- ------------------------- ISO ------------------------------" 88 | 89 | dim c 90 | c=0 91 | call getInfo(objDir,1) 92 | 93 | wscript.echo "item top back to top menu" 94 | wscript.echo "choose --default exit --timeout 30000 target && goto ${target}" 95 | 96 | c=0 97 | call getInfo(objDir,2) 98 | 99 | wscript.echo ":top chain menu-vbs.ipxe" 100 | wscript.echo "goto start" -------------------------------------------------------------------------------- /files/wimboot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erwan2212/tinypxeserver/d406c46ddd2ae44a91cebccb8d6c7bf02417cd91/files/wimboot -------------------------------------------------------------------------------- /files/wimboot.i386: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erwan2212/tinypxeserver/d406c46ddd2ae44a91cebccb8d6c7bf02417cd91/files/wimboot.i386 -------------------------------------------------------------------------------- /files/wimboot.vbs: -------------------------------------------------------------------------------- 1 | Option Explicit 2 | on error resume next 3 | ' ********************* functions *********************** 4 | 5 | Sub Include (strFile) 6 | 'Create objects for opening text file 7 | dim objFSO 8 | Set objFSO = CreateObject("Scripting.FileSystemObject") 9 | dim objTextFile 10 | Set objTextFile = objFSO.OpenTextFile(strFile, 1) 11 | 12 | 'Execute content of file. 13 | ExecuteGlobal objTextFile.ReadAll 14 | 15 | 'CLose file 16 | objTextFile.Close 17 | 18 | 'Clean up 19 | Set objFSO = Nothing 20 | Set objTextFile = Nothing 21 | End Sub 22 | 23 | Sub getInfo(pCurrentDir,s) 24 | dim aItem 25 | For Each aItem In pCurrentDir.Files 26 | 'wscript.Echo aItem.Name 27 | If LCase(Right(Cstr(aItem.Name), 3)) = "wim" Then 28 | c=c+1 29 | if s=1 then wscript.echo "item " & c & chr(9) & replace(replace(aItem.path,strweb,""),"\","/") 30 | dim path 31 | path=replace(replace(aItem.path,strweb,""),"\","/") 32 | path=replace(path,"#","%23") 33 | path=replace(path," ","%20") 34 | if s=2 then 35 | wscript.echo ":" & c 36 | wscript.echo "kernel ${boot-url}/wimboot" 37 | wscript.echo "iseq ${platform} pcbios && initrd -n bcd ${boot-url}/BOOT/BCD bcd ||" 38 | wscript.echo "iseq ${platform} efi && initrd -n bcd ${boot-url}/EFI/MICROSOFT/BOOT/BCD bcd ||" 39 | wscript.echo "initrd -n boot.sdi ${boot-url}/BOOT/BOOT.SDI boot.sdi" 40 | wscript.echo "initrd -n boot.wim ${boot-url}" & path & " boot.wim" 41 | wscript.echo "boot" 42 | end if 43 | End If 44 | Next 45 | 46 | For Each aItem In pCurrentDir.SubFolders 47 | 'wscript.Echo aItem.Name & " passing recursively" 48 | call getInfo(aItem,s) 49 | Next 50 | 51 | End Sub 52 | 53 | '************************************************ 54 | dim fso 55 | Set FSO = CreateObject("Scripting.FileSystemObject") 56 | 57 | dim ScriptPath 58 | ScriptPath= Wscript.ScriptFullName 59 | dim objFile 60 | Set objFile = FSO.GetFile(ScriptPath) 61 | dim ScriptFolder 62 | ScriptFolder = FSO.GetParentFolderName(objFile) 63 | 'wscript.echo "strFolder:" & strFolder 64 | 65 | Include(ScriptFolder & "\ini.vbs") 66 | 67 | dim CurrentDirectory 68 | CurrentDirectory = fso.GetAbsolutePathName(".") 69 | 'wscript.echo "CurrentDirectory:" & CurrentDirectory 70 | 71 | dim root 72 | root= ReadIni( CurrentDirectory & "\config.ini", "dhcp", "root" ) 73 | 'wscript.echo "root:" & root 74 | 75 | dim strweb 76 | if instr(root,"\")>0 then strweb = root 77 | if instr(root,"\")=0 then strweb = CurrentDirectory & "\" & root 78 | 'wscript.echo "strweb:" & strweb 79 | 80 | dim objDir 81 | Set objDir = FSO.GetFolder(strweb) 82 | '***************** lets generate the ipxe script ************** 83 | 84 | wscript.echo "#!ipxe" 85 | wscript.echo "set boot-url http://${next-server}" 86 | wscript.echo "set iscsi-server ${next-server}" 87 | wscript.echo "set iqn iqn.2008-08.com.starwindsoftware:target1" 88 | wscript.echo "set iscsi-target iscsi:${iscsi-server}::::${iqn}" 89 | wscript.echo "set menu-timeout 5000" 90 | wscript.echo "set submenu-timeout ${menu-timeout}" 91 | wscript.echo "isset ${menu-default} || set menu-default exit" 92 | wscript.echo ":start" 93 | wscript.echo "menu Welcome to iPXE's Boot Menu" 94 | 'wscript.echo "item" 95 | 'wscript.echo "item --gap -- ------------------------- ISO ------------------------------" 96 | 97 | dim c 98 | c=0 99 | call getInfo(objDir,1) 100 | 101 | wscript.echo "item top back to top menu" 102 | wscript.echo "choose --default exit --timeout 30000 target && goto ${target}" 103 | 104 | c=0 105 | call getInfo(objDir,2) 106 | 107 | wscript.echo ":top chain menu-vbs.ipxe" 108 | wscript.echo "goto start" -------------------------------------------------------------------------------- /pxesrv.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erwan2212/tinypxeserver/d406c46ddd2ae44a91cebccb8d6c7bf02417cd91/pxesrv.zip --------------------------------------------------------------------------------