[syslinux] multiple tftp request
Aaron McSorley
aaron.mcsorley at amd.com
Tue Nov 11 14:21:51 PST 2003
Not sure how easy you want it but, you could also
try using the source. The file to look at is pxelinux.asm.
Basically you just comment out the part where it looks for
the config files, then send it straight to default.
You could also change the name of the file from default
to anything you want (default_str) and change the path
prefix where it looks for the file (cfgprefix).
This came in very handy with the large menu system that
we use to select our network installs/images.
Isn't source neat.
Oh, and I've attached a diff to pxelinux.asm that we use from syslinux 2.06
that goes straight to default file. So, you could do this:
patch -p0 < pxelinux-just-default.diff
make pxelinux.0
We are not big programmers so somebody let me know if this breaks something
I didn't think about.
-Aaron
On Tue, 11 Nov 2003, H. Peter Anvin wrote:
> Dirk Haus wrote:
> > Hi Folks,
> >
> > from PXELINUX FAQ.
> >
> > -----------------
> > As an example, for 192.0.2.91, it will try C000025B,
> > C000025, C00002, C0000, C000, C00, C0, C, and default,
> > in that order.
> > -----------------
> >
> > Is there a easy way to modify PXELINUX to get only the
> > default file?
> >
>
> The easiest is to send it a DHCP option to get the file you want.
> Another option is to make your TFTP server ignore the filename (possible
> using tftp-hpa filename remapping, for example.)
>
> -hpa
>
>
> _______________________________________________
> SYSLINUX mailing list
> Submissions to SYSLINUX at zytor.com
> Unsubscribe or set options at:
> http://www.zytor.com/mailman/listinfo/syslinux
> Please do not send private replies to mailing list traffic.
>
>
-------------- next part --------------
--- pxelinux.asm Fri Aug 22 19:04:21 2003
+++ pxelinux-just-default.asm Tue Nov 11 15:50:20 2003
@@ -800,68 +800,91 @@
mov cx,cfgprefix_len
rep movsb
-;
+;************************************** Commented out by JimWink
+;************************************** The following commented routine trys to
+;************************************** find a config file based on MAC address
+;************************************** and then the IP.
; Begin looking for configuration file
;
-config_scan:
- test byte [DHCPMagic], 02h
- jz .no_option
+;config_scan:
+; test byte [DHCPMagic], 02h
+; jz .no_option
; We got a DHCP option, try it first
- push di
- mov si,trying_msg
- call writestr
- mov di,ConfigName
- mov si,di
- call writestr
- call crlf
- call open
- pop di
- jnz .success
+; push di
+; mov si,trying_msg
+; call writestr
+; mov di,ConfigName
+; mov si,di
+; call writestr
+; call crlf
+; call open
+; pop di
+; jnz .success
+
+;.no_option: ; Have to guess config file name
+ ; Try loading by MAC address
+; push di
+; mov si,MACStr
+; mov cx,(3*17+1)/2
+; rep movsw
+; mov si,trying_msg
+; call writestr
+; mov di,trackbuf
+; mov si,di
+; call writestr
+; call crlf
+; call open
+; pop di
+; jnz .success
+
+;.scan_ip:
+; mov cx,8
+; mov eax,[MyIP]
+; xchg ah,al ; Convert to host byte order
+; ror eax,16
+; xchg ah,al
+;.hexify_loop: rol eax,4
+; push eax
+; and al,0Fh
+; cmp al,10
+; jae .high
+;.low: add al,'0'
+; jmp short .char
+;.high: add al,'A'-10
+;.char: stosb
+; pop eax
+; loop .hexify_loop
+;
+; mov cx,9 ; Up to 9 attempts
-.no_option: ; Have to guess config file name
- ; Try loading by MAC address
- push di
- mov si,MACStr
- mov cx,(3*17+1)/2
- rep movsw
- mov si,trying_msg
- call writestr
- mov di,trackbuf
- mov si,di
- call writestr
- call crlf
- call open
- pop di
- jnz .success
+;.tryagain: mov byte [di],0
+; cmp cx,byte 1
+; jne .not_default
+; pusha
+; mov si,default_str
+; mov cx,default_len
+; rep movsb ; Copy "default" string
+; popa
+;.not_default: pusha
+; mov si,trying_msg
+; call writestr
+; mov di,trackbuf
+; mov si,di
+; call writestr
+; call crlf
+; call open
+; popa
+; jnz .success
+; dec di
+; loop .tryagain
+; jmp no_config_file
-.scan_ip:
- mov cx,8
- mov eax,[MyIP]
- xchg ah,al ; Convert to host byte order
- ror eax,16
- xchg ah,al
-.hexify_loop: rol eax,4
- push eax
- and al,0Fh
- cmp al,10
- jae .high
-.low: add al,'0'
- jmp short .char
-.high: add al,'A'-10
-.char: stosb
- pop eax
- loop .hexify_loop
-
- mov cx,9 ; Up to 9 attempts
-
-.tryagain: mov byte [di],0
- cmp cx,byte 1
- jne .not_default
+;**************************** Added by JimWink
pusha
mov si,default_str
mov cx,default_len
- rep movsb ; Copy "default" string
+ rep movsb
popa
-.not_default: pusha
+ pusha
mov si,trying_msg
call writestr
@@ -873,12 +896,8 @@
popa
jnz .success
- dec di
- loop .tryagain
-
jmp no_config_file
-
+;**************************** End Add
.success:
-;
; Now we have the config file open. Parse the config file and
; run the user interface.
More information about the Syslinux
mailing list