Pull up revisions 1.65-1.66 (requested by manu in ticket #635). netbsd-4
authorjdc <jdc@NetBSD.org>
Sun, 13 May 2007 10:30:31 +0000
branchnetbsd-4
changeset 261298 0798bd3099f5
parent 261297 39350fd05ba0
child 261299 45978d4ef165
Pull up revisions 1.65-1.66 (requested by manu in ticket #635). Add the TFTPROOT kernel option for TFTP'ing root RAMdisk at root mount time. This allows working around situations where a kernel with embedded RAMdisk cannot be booted by the bootloader because the RAMdisk is too big. Fix build (broken by a fix introduced in the wrong file...)
sys/nfs/nfs_boot.c
--- a/sys/nfs/nfs_boot.c	Sun May 13 10:30:08 2007 +0000
+++ b/sys/nfs/nfs_boot.c	Sun May 13 10:30:31 2007 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_boot.c,v 1.63 2006/03/01 12:38:32 yamt Exp $	*/
+/*	$NetBSD: nfs_boot.c,v 1.63.18.1 2007/05/13 10:30:31 jdc Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1997 The NetBSD Foundation, Inc.
@@ -42,9 +42,10 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_boot.c,v 1.63 2006/03/01 12:38:32 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_boot.c,v 1.63.18.1 2007/05/13 10:30:31 jdc Exp $");
 
 #include "opt_nfs.h"
+#include "opt_tftproot.h"
 #include "opt_nfs_boot.h"
 
 #include <sys/param.h>
@@ -112,7 +113,7 @@
 	struct lwp *lwp;
 {
 	struct ifnet *ifp;
-	int error;
+	int error = 0;
 
 	/*
 	 * Find the network interface.
@@ -158,6 +159,10 @@
 	if (nd->nd_gwip.s_addr)
 		nfs_boot_defrt(&nd->nd_gwip);
 
+#ifdef TFTPROOT
+	if (nd->nd_nomount)
+		goto out;
+#endif
 	/*
 	 * Now fetch the NFS file handles as appropriate.
 	 */
@@ -166,6 +171,9 @@
 	if (error)
 		nfs_boot_cleanup(nd, lwp);
 
+#ifdef TFTPROOT
+out:
+#endif
 	return (error);
 }