Module Name:    src
Committed By:   msaitoh
Date:           Tue Mar 18 08:17:56 UTC 2014

Modified Files:
        src/share/man/man4 [netbsd-6]: options.4
        src/sys/kern [netbsd-6]: kern_exec.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #1026):
        share/man/man4/options.4: revision 1.433
        sys/kern/kern_exec.c: revision 1.371- 1.372
Add EMUL_NATIVEROOT so that native binaries can be told to search an
"emulation" directory before the real root. This makes easier to test
an amd64 kernel on the top of an i386 root filesystem prior a full
migration.


To generate a diff of this commit:
cvs rdiff -u -r1.411.2.1 -r1.411.2.2 src/share/man/man4/options.4
cvs rdiff -u -r1.339.2.7 -r1.339.2.8 src/sys/kern/kern_exec.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man4/options.4
diff -u src/share/man/man4/options.4:1.411.2.1 src/share/man/man4/options.4:1.411.2.2
--- src/share/man/man4/options.4:1.411.2.1	Thu Feb 23 18:29:52 2012
+++ src/share/man/man4/options.4	Tue Mar 18 08:17:56 2014
@@ -1,4 +1,4 @@
-.\"	$NetBSD: options.4,v 1.411.2.1 2012/02/23 18:29:52 riz Exp $
+.\"	$NetBSD: options.4,v 1.411.2.2 2014/03/18 08:17:56 msaitoh Exp $
 .\"
 .\" Copyright (c) 1996
 .\" 	Perry E. Metzger.  All rights reserved.
@@ -450,6 +450,21 @@ Currently only some system calls which u
 are adjusted and some binaries which use
 .Xr sysctl 3
 to retrieve network details would not work properly.
+.It Cd options EMUL_NATIVEROOT=string
+Just like emulated binaries first try to lookup files in 
+an emulation root (e.g.
+.Pa /emul/linux )
+before looking them up in real root, this option cause native
+binaries to first look up files in an "emulation" directory too.
+This can be useful to test an amd64 kernel on top of an i386 system
+prior full migration: by unpacking the amd64 distribution in e.g.
+.Pa /emul/netbsd64 
+and specifying that location as
+.Cd EMUL_NATIVEROOT ,
+native amd64 binaries can be run while the root filesystem remains
+populated with i386 binaries. Beware of 
+.Pa /dev
+incompatibilities between i386 and amd64 if you do this.
 .It Cd options EXEC_ELF_NOTELESS
 Run unidentified ELF binaries as
 .Nx

Index: src/sys/kern/kern_exec.c
diff -u src/sys/kern/kern_exec.c:1.339.2.7 src/sys/kern/kern_exec.c:1.339.2.8
--- src/sys/kern/kern_exec.c:1.339.2.7	Mon Feb  3 11:54:02 2014
+++ src/sys/kern/kern_exec.c	Tue Mar 18 08:17:56 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exec.c,v 1.339.2.7 2014/02/03 11:54:02 sborrill Exp $	*/
+/*	$NetBSD: kern_exec.c,v 1.339.2.8 2014/03/18 08:17:56 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.339.2.7 2014/02/03 11:54:02 sborrill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.339.2.8 2014/03/18 08:17:56 msaitoh Exp $");
 
 #include "opt_exec.h"
 #include "opt_ktrace.h"
@@ -185,7 +185,11 @@ static struct sa_emul saemul_netbsd = {
 /* NetBSD emul struct */
 struct emul emul_netbsd = {
 	.e_name =		"netbsd",
+#ifdef EMUL_NATIVEROOT
+	.e_path =		EMUL_NATIVEROOT,
+#else
 	.e_path =		NULL,
+#endif
 #ifndef __HAVE_MINIMAL_EMUL
 	.e_flags =		EMUL_HAS_SYS___syscall,
 	.e_errno =		NULL,

Reply via email to