Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Add EMUL_NATIVEROOT so that native binaries can be told to s...



details:   https://anonhg.NetBSD.org/src/rev/94667a3899d8
branches:  trunk
changeset: 793285:94667a3899d8
user:      manu <manu%NetBSD.org@localhost>
date:      Sun Feb 02 04:28:42 2014 +0000

description:
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.

diffstat:

 share/man/man4/options.4 |  17 ++++++++++++++++-
 sys/kern/kern_exec.c     |   9 +++++++--
 2 files changed, 23 insertions(+), 3 deletions(-)

diffs (61 lines):

diff -r 7187396bb2ce -r 94667a3899d8 share/man/man4/options.4
--- a/share/man/man4/options.4  Sun Feb 02 03:20:57 2014 +0000
+++ b/share/man/man4/options.4  Sun Feb 02 04:28:42 2014 +0000
@@ -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 @@
 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
diff -r 7187396bb2ce -r 94667a3899d8 sys/kern/kern_exec.c
--- a/sys/kern/kern_exec.c      Sun Feb 02 03:20:57 2014 +0000
+++ b/sys/kern/kern_exec.c      Sun Feb 02 04:28:42 2014 +0000
@@ -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 @@
 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,



Home | Main Index | Thread Index | Old Index