Module Name:    src
Committed By:   pooka
Date:           Sun Oct 11 12:14:05 UTC 2009

Modified Files:
        src/sbin/raidctl: Makefile raidctl.c

Log Message:
Support RUMP_ACTION, i.e. compile-time switch to make this execute
rump syscalls to configure raidframe in a rump kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sbin/raidctl/Makefile
cvs rdiff -u -r1.40 -r1.41 src/sbin/raidctl/raidctl.c

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

Modified files:

Index: src/sbin/raidctl/Makefile
diff -u src/sbin/raidctl/Makefile:1.12 src/sbin/raidctl/Makefile:1.13
--- src/sbin/raidctl/Makefile:1.12	Mon Jun 27 01:00:06 2005
+++ src/sbin/raidctl/Makefile	Sun Oct 11 12:14:05 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.12 2005/06/27 01:00:06 christos Exp $
+#	$NetBSD: Makefile,v 1.13 2009/10/11 12:14:05 pooka Exp $
 
 PROG=	raidctl 
 SRCS=	rf_configure.c raidctl.c
@@ -7,4 +7,11 @@
 DPADD=  ${LIBUTIL}
 LDADD=  -lutil
 
+.ifdef RUMP_ACTION
+CPPFLAGS+=	-DRUMP_ACTION -DRUMP_SYS_IOCTL
+LDADD+=		-lrumpdev_disk -lrumpdev_raidframe -lrumpdev
+LDADD+=		-lrumpvfs -lrump -lrumpuser -lpthread
+DBG=		-g
+.endif
+
 .include <bsd.prog.mk>

Index: src/sbin/raidctl/raidctl.c
diff -u src/sbin/raidctl/raidctl.c:1.40 src/sbin/raidctl/raidctl.c:1.41
--- src/sbin/raidctl/raidctl.c:1.40	Mon Jan 26 11:34:12 2009
+++ src/sbin/raidctl/raidctl.c	Sun Oct 11 12:14:05 2009
@@ -1,4 +1,4 @@
-/*      $NetBSD: raidctl.c,v 1.40 2009/01/26 11:34:12 tron Exp $   */
+/*      $NetBSD: raidctl.c,v 1.41 2009/10/11 12:14:05 pooka Exp $   */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: raidctl.c,v 1.40 2009/01/26 11:34:12 tron Exp $");
+__RCSID("$NetBSD: raidctl.c,v 1.41 2009/10/11 12:14:05 pooka Exp $");
 #endif
 
 
@@ -58,6 +58,9 @@
 #include <unistd.h>
 #include <util.h>
 
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
 #include <dev/raidframe/raidframevar.h>
 #include <dev/raidframe/raidframeio.h>
 #include "rf_configure.h"
@@ -117,6 +120,10 @@
 	force = 0;
 	openmode = O_RDWR;	/* default to read/write */
 
+#ifdef RUMP_ACTION
+	rump_init();
+#endif
+
 	while ((ch = getopt(argc, argv, "a:A:Bc:C:f:F:g:GiI:l:r:R:sSpPuv")) 
 	       != -1)
 		switch(ch) {
@@ -236,7 +243,12 @@
 		usage();
 
 	strlcpy(name, argv[0], sizeof(name));
+#ifdef RUMP_ACTION
+	fd = opendisk1(name, openmode, dev_name, sizeof(dev_name), 0,
+	    rump_sys_open);
+#else
 	fd = opendisk(name, openmode, dev_name, sizeof(dev_name), 0);
+#endif
 	if (fd == -1) {
 		fprintf(stderr, "%s: unable to open device file: %s\n",
 			getprogname(), name);

Reply via email to