Jump to content











Photo

Bug Reports, Requests, HowTo's about Tiny PXE Server

pxe network boot

  • Please log in to reply
778 replies to this topic

#776 matso

matso
  • Members
  • 9 posts
  •  
    Sweden

Posted 2 weeks ago

Just like to add that TFTPBlocksize is not implemented on some PXE solutions (for example Vmwares virtual PXE) 

 

Another nice feature to have in the MAP section would be a flag to do only first part of string replacement.

 

IE

/boot/=/demo/  would change

 

/boot/test/something into /demo/test/something but would not change anything in /test/boot/something


Edited by matso, 2 weeks ago.


#777 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13988 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 2 weeks ago

Also full Regular Expression support would be nice .... :whistling:

 

https://xkcd.com/208/

 

;)

:D

 

:duff:

Wonko



#778 erwan.l

erwan.l

    Gold Member

  • Developer
  • 2249 posts
  • Location:Nantes - France
  •  
    France

Posted 2 weeks ago

Also full Regular Expression support would be nice .... :whistling:

 

https://xkcd.com/208/

 

;)

:D

 

:duff:

Wonko

 

I could but "simple" mortals struggle with regular expressions.

Which would mean I should implement some sort of extra logic to detect if the user is using regex or not.

 

For now, this is a very basic search and replace feature with 2 exceptions :

-if the old pattern (to the right of the "=" in [map] section) is contained in the new pattern (left of "=" in the [map] section, nothing will happen - see why in post.

-order (for now) in which the keys under [map] are read is random (which is not helping :) )

procedure TfrmDHCPServer.OnReadFile2 (Sender: TObject; var FileName: String) ;
var
i:byte;
keys:tstringlist;
begin
//here we can modify the requested filename on the fly
//before the request gets to the TFTPD
try
if (h_map<>nil) then //do we have entries in the map section
  begin
  keys:=h_map.Keys ;
  if keys.Count =0 then exit;
  for i:=0 to keys.Count -1 do  //lets loop thru map entries
    begin
    if pos(lowercase(keys [i]),lowercase(filename))>0 then //we have a match
      begin
      if pos(lowercase(h_map.GetString(keys [i])),lowercase(filename))=0 then //lets replace only if filename does not contain our new string
        begin
        filename:=StringReplace(filename,keys [i],h_map.GetString(keys [i]),[rfIgnoreCase]); //NOT rfReplaceAll
        end;//if pos(h_map.GetString(keys [i]),filename)=0 then
       break; //we stop it there as we had a match, whether we actually modified the filename or not
      end;//if pos(keys [i],filename)>0
    end;//for i:=0 to keys.Count -1 do
  end;//if (h_map<>nil) then
except
end;


#779 ktp

ktp

    Silver Member

  • Advanced user
  • 758 posts

Posted 2 weeks ago

@erwan.l
 
Latest TPS version:
pxesrv.exe 
1.0.0.22
11/02/2018 17:39 
8231A2C337A64F6B8D8597E7C2315682
 
looks fine for me:
- switching configuration file (right click): OK.
- optional configuration file on command line: OK.
 
Thank you for your time and effort. Keep up the good work!
 






Also tagged with one or more of these keywords: pxe, network boot

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users