Module Name:    src
Committed By:   manu
Date:           Sun Feb  2 04:28:42 UTC 2014

Modified Files:
        src/share/man/man4: options.4
        src/sys/kern: kern_exec.c

Log Message:
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.432 -r1.433 src/share/man/man4/options.4
cvs rdiff -u -r1.370 -r1.371 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.432 src/share/man/man4/options.4:1.433
--- src/share/man/man4/options.4:1.432	Sun Oct 13 22:34:13 2013
+++ src/share/man/man4/options.4	Sun Feb  2 04:28:42 2014
@@ -1,4 +1,4 @@
-.\"	$NetBSD: options.4,v 1.432 2013/10/13 22:34:13 wiz Exp $
+.\"	$NetBSD: options.4,v 1.433 2014/02/02 04:28:42 manu 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.370 src/sys/kern/kern_exec.c:1.371
--- src/sys/kern/kern_exec.c:1.370	Sat Jan 25 19:44:11 2014
+++ src/sys/kern/kern_exec.c	Sun Feb  2 04:28:42 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exec.c,v 1.370 2014/01/25 19:44:11 christos Exp $	*/
+/*	$NetBSD: kern_exec.c,v 1.371 2014/02/02 04:28:42 manu 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.370 2014/01/25 19:44:11 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.371 2014/02/02 04:28:42 manu Exp $");
 
 #include "opt_exec.h"
 #include "opt_execfmt.h"
@@ -179,6 +179,11 @@ void	syscall(void);
 struct emul emul_netbsd = {
 	.e_name =		"netbsd",
 	.e_path =		NULL,
+#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