summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhpa <hpa>2001-04-13 22:07:51 +0000
committerhpa <hpa>2001-04-13 22:07:51 +0000
commit73ef62df11d0ce805744a1cd22d34e793035725b (patch)
treecf60ca325cae72364e813c042c356f5a29c29220
parent1ffb303127d9a832e2868f4cb040399cedae83c4 (diff)
downloadsyslinux-73ef62df11d0ce805744a1cd22d34e793035725b.tar.gz
Add DHCP option to set PXELINUX reset timeout.syslinux-1.62-pre1
-rw-r--r--pxelinux.asm25
-rw-r--r--pxelinux.doc9
2 files changed, 31 insertions, 3 deletions
diff --git a/pxelinux.asm b/pxelinux.asm
index c7f6d1c4..74ca65f7 100644
--- a/pxelinux.asm
+++ b/pxelinux.asm
@@ -349,6 +349,7 @@ KernelSize resd 1 ; Size of kernel (bytes)
Stack resd 1 ; Pointer to reset stack
PXEEntry resd 1 ; !PXE API entry point
SavedSSSP resd 1 ; Our SS:SP while running a COMBOOT image
+RebootTime resd 1 ; Reboot timeout, if set by option
FBytes equ $ ; Used by open/getc
FBytes1 resw 1
FBytes2 resw 1
@@ -2604,15 +2605,22 @@ kaboom:
call getchar
jmp short .drain
.drained:
+ mov edi,[RebootTime]
+ mov al,[DHCPMagic]
+ and al,09h ; Magic+Timeout
+ cmp al,09h
+ jne .not_set
+ mov edi,REBOOT_TIME
+.not_set:
mov cx,18
.wait1: push cx
- mov cx,REBOOT_TIME
+ mov ecx,edi
.wait2: mov dx,[BIOS_timer]
.wait3: call pollchar
jnz .keypress
cmp dx,[BIOS_timer]
je .wait3
- loop .wait2
+ a32 loop .wait2 ; a32 means use ecx as counter
mov al,'.'
call writechr
pop cx
@@ -4270,6 +4278,19 @@ parse_dhcp_options:
jmp short .copyoption
.not_pl_prefix:
+ cmp dl,179 ; PXELINUX REBOOTTIME option
+ jne .not_pl_timeout
+ cmp al,4
+ jne .opt_done
+ mov edx,[si]
+ xchg dl,dh ; Convert to host byte order
+ rol edx,16
+ xchg dl,dh
+ mov [RebootTime],edx
+ or byte [DHCPMagic], byte 8 ; Got RebootTime
+ ; jmp short .opt_done
+
+.not_pl_timeout
; Unknown option. Skip to the next one.
.opt_done:
add si,ax
diff --git a/pxelinux.doc b/pxelinux.doc
index 9e1a7d26..96e95cbf 100644
--- a/pxelinux.doc
+++ b/pxelinux.doc
@@ -248,14 +248,20 @@ Option 178 pxelinux.pathprefix
needs to end in whatever character the TFTP server OS uses
as a pathname separator, e.g. slash (/) for Unix.
+Option 179 pxelinux.reboottime
+ - Specifies, in seconds, the time to wait before reboot in the
+ event of TFTP failure. 0 means wait "forever" (in reality,
+ it waits approximately 136 years.)
+
ISC dhcp 3.0 supports a rather nice syntax for specifying custom
options; you can use the following syntax in dhcpd.conf if you are
running this version of dhcpd:
option space pxelinux;
- option pxelinux.magic code 176 = string;
+ option pxelinux.magic code 176 = string;
option pxelinux.configfile code 177 = text;
option pxelinux.pathprefix code 178 = text;
+ option pxelinux.reboottime code 179 = unsigned integer 32;
Then, inside your PXELINUX-booting group or class (whereever you have
the PXELINUX-related options, such as the filename option), you can
@@ -265,6 +271,7 @@ add, for example:
option pxelinux.magic f1:00:74:7e;
option pxelinux.configfile "configs/common";
option pxelinux.pathprefix "/tftpboot/pxelinux/files/";
+ option pxelinux.reboottime 30;
filename "/tftpboot/pxelinux/pxelinux.bin";
Note that the configfile is relative to the pathprefix: this will look