Module Name:    src
Committed By:   pooka
Date:           Thu Apr 29 22:42:48 UTC 2010

Modified Files:
        src/usr.sbin/puffs: Makefile
Added Files:
        src/usr.sbin/puffs/rump_au-naturel: Makefile rump_au-naturel.c

Log Message:
Add rump_au-naturel, which instead of mounting a file system inside
the rump kernel just attaches to / in said rump kernel instance.
This is mostly useful in case wanting to see what nodes components
create (see Makefile).

not built without manual intervention


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/puffs/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.sbin/puffs/rump_au-naturel/Makefile \
    src/usr.sbin/puffs/rump_au-naturel/rump_au-naturel.c

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

Modified files:

Index: src/usr.sbin/puffs/Makefile
diff -u src/usr.sbin/puffs/Makefile:1.13 src/usr.sbin/puffs/Makefile:1.14
--- src/usr.sbin/puffs/Makefile:1.13	Wed Mar 31 14:22:27 2010
+++ src/usr.sbin/puffs/Makefile	Thu Apr 29 22:42:48 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.13 2010/03/31 14:22:27 pooka Exp $
+#	$NetBSD: Makefile,v 1.14 2010/04/29 22:42:48 pooka Exp $
 
 SUBDIR=	mount_9p mount_psshfs mount_sysctlfs
 
@@ -20,4 +20,8 @@
 # rump_mqmfs is just another ffs, useful mainly for debugging
 #SUBDIR+=rump_nqmfs
 
+# rump_au-naturel presents lets you access '/' for a rump kernel.
+# mostly for debugging.
+#SUBDIR+=rump_au-naturel
+
 .include <bsd.subdir.mk>

Added files:

Index: src/usr.sbin/puffs/rump_au-naturel/Makefile
diff -u /dev/null src/usr.sbin/puffs/rump_au-naturel/Makefile:1.1
--- /dev/null	Thu Apr 29 22:42:48 2010
+++ src/usr.sbin/puffs/rump_au-naturel/Makefile	Thu Apr 29 22:42:48 2010
@@ -0,0 +1,14 @@
+#	$NetBSD: Makefile,v 1.1 2010/04/29 22:42:48 pooka Exp $
+#
+
+PROG=		rump_au-naturel
+NOMAN=
+
+ISRUMP=		# persuadertron
+
+# Link in components to see which devices they create.  The
+# following is an example.  You should see /dev/bpf.
+#
+#LDADD+= 	-lrumpdev_bpf -lrumpdev -lrumpnet_net -lrumpnet
+
+.include <bsd.prog.mk>
Index: src/usr.sbin/puffs/rump_au-naturel/rump_au-naturel.c
diff -u /dev/null src/usr.sbin/puffs/rump_au-naturel/rump_au-naturel.c:1.1
--- /dev/null	Thu Apr 29 22:42:48 2010
+++ src/usr.sbin/puffs/rump_au-naturel/rump_au-naturel.c	Thu Apr 29 22:42:48 2010
@@ -0,0 +1,66 @@
+/*	$NetBSD: rump_au-naturel.c,v 1.1 2010/04/29 22:42:48 pooka Exp $	*/
+
+/*
+ * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/types.h>
+#include <sys/mount.h>
+
+#include <err.h>
+#include <puffs.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <rump/p2k.h>
+
+/* NetBSD-5 compat */
+#ifndef MOUNT_RUMPFS
+#define MOUNT_RUMPFS    "rumpfs"
+#endif
+
+static void
+usage(void)
+{
+
+	fprintf(stderr, "usage: %s rump /mountpoint\n", getprogname());
+	exit(1);
+}
+
+int
+main(int argc, char *argv[])
+{
+	int rv;
+
+	setprogname(argv[0]);
+	if (argc != 3)
+		usage();
+		
+	rv = p2k_run_fs(MOUNT_RUMPFS, argv[1], argv[2], 0, NULL, 0, 0);
+	if (rv == -1)
+		err(1, "p2k_run_fs");
+
+	return 0;
+}

Reply via email to