diff options
author | dfr <dfr@FreeBSD.org> | 1999-05-03 09:36:29 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 1999-05-03 09:36:29 +0000 |
commit | 57de21f5b6b954e56b40ea467115d06dad8da9ef (patch) | |
tree | d614b9aa032d7ad1de477d0d315641d61b252ebb /sys/boot | |
parent | 29a7fdd934f8d66f6d7f1a99338b23a5783cd3ce (diff) | |
download | FreeBSD-src-57de21f5b6b954e56b40ea467115d06dad8da9ef.zip FreeBSD-src-57de21f5b6b954e56b40ea467115d06dad8da9ef.tar.gz |
Changes to support diskless booting on the alpha:
* Make the network code in the bootstrap more chatty (helps debugging)
* Add nfs root stuff to cpu_rootconf(). I also added a check to make sure
it really was netbooting which allows the use of the same kernel for local
and network boots.
* Tweak the de driver so that it takes the speed setting from the console
for the alpha (some PWSs have broken de chipsets). This is the same
behaviour as NetBSD/alpha.
Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
Diffstat (limited to 'sys/boot')
-rw-r--r-- | sys/boot/common/dev_net.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/sys/boot/common/dev_net.c b/sys/boot/common/dev_net.c index d4b8a9c..a66523a 100644 --- a/sys/boot/common/dev_net.c +++ b/sys/boot/common/dev_net.c @@ -1,5 +1,5 @@ /* - * $Id: dev_net.c,v 1.2 1998/08/22 10:31:01 dfr Exp $ + * $Id: dev_net.c,v 1.3 1998/09/20 21:46:19 dfr Exp $ * From: $NetBSD: dev_net.c,v 1.12 1997/12/10 20:38:37 gwr Exp $ */ @@ -65,6 +65,7 @@ #include <netinet/in_systm.h> #include <stand.h> +#include <string.h> #include <net.h> #include <netif.h> #include <bootparam.h> @@ -206,6 +207,8 @@ net_getparams(sock) int sock; { char buf[MAXHOSTNAMELEN]; + char temp[FNAME_SIZE]; + int i; n_long smask; #ifdef SUPPORT_BOOTP @@ -218,7 +221,7 @@ net_getparams(sock) if (try_bootp) bootp(sock); if (myip.s_addr != 0) - return (0); + goto exit; if (debug) printf("net_open: BOOTP failed, trying RARP/RPC...\n"); #endif @@ -262,9 +265,23 @@ net_getparams(sock) printf("net_open: bootparam/getfile RPC failed\n"); return (EIO); } - + exit: printf("net_open: server addr: %s\n", inet_ntoa(rootip)); - printf("net_open: server path: %s\n", rootpath); + /* + * If present, strip the server's address off of the rootpath + * before passing it along. This allows us to be compatible with + * the kernel's diskless (BOOTP_NFSROOT) booting conventions + */ + + for(i=0; i<FNAME_SIZE; i++) + if(rootpath[i] == ':') + break; + if(i && i != FNAME_SIZE) { + i++; + bcopy(&rootpath[i], &temp[0], strlen(&rootpath[i])+1); + bcopy(&temp[0], &rootpath[0], strlen(&rootpath[i])+1); + } + printf("net_open: server path: %s\n", rootpath); return (0); } |