git: 9front

Download patch

ref: 8b7f059c562dc192c77cb7a241151560d0850318
parent: d40194f978486b914c1e1251686891577f0860dd
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Tue Aug 21 10:23:52 EDT 2012

9bootpxe: try /cfg/pxe/default if /cfg/pxe/$ether fails before breaking to the prompt.

--- a/sys/man/8/9boot
+++ b/sys/man/8/9boot
@@ -83,10 +83,12 @@
 .IR 9bootpxe
 will read the file
 .B /cfg/pxe/$ether
+or, if this file is not present,
+.B /cfg/pxe/default
 from the tftp server, where
 .B $ether
 is the MAC address of the client's network card
-in lower case hex, and use this as its
+in lower case hex, and uses this as its
 .IR plan9.ini (8)
 file.
 .SH FILES
--- a/sys/src/boot/pc/pxe.c
+++ b/sys/src/boot/pc/pxe.c
@@ -340,10 +340,11 @@
 	}
 	memmove(path, "/cfg/pxe/", 9);
 	memmove(path+9, mac, 13);
-	if(tftpopen(f = &t, path, yip, sip, gip)){
-		print("no config\r\n");
-		f = 0;
-	}
+	if(tftpopen(f = &t, path, yip, sip, gip))
+		if(tftpopen(f, "/cfg/pxe/default", yip, sip, gip)){
+			print("no config\r\n");
+			f = 0;
+		}
 	for(;;){
 		kern = configure(f, path); f = 0;
 		if(tftpopen(&t, kern, yip, sip, gip)){
--