Source-Changes-HG archive

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

[src/trunk]: src/sbin/raidctl Support RUMP_ACTION, i.e. compile-time switch t...



details:   https://anonhg.NetBSD.org/src/rev/de1d012fa2e4
branches:  trunk
changeset: 748052:de1d012fa2e4
user:      pooka <pooka%NetBSD.org@localhost>
date:      Sun Oct 11 12:14:05 2009 +0000

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

diffstat:

 sbin/raidctl/Makefile  |   9 ++++++++-
 sbin/raidctl/raidctl.c |  16 ++++++++++++++--
 2 files changed, 22 insertions(+), 3 deletions(-)

diffs (73 lines):

diff -r 4264084a31a2 -r de1d012fa2e4 sbin/raidctl/Makefile
--- a/sbin/raidctl/Makefile     Sun Oct 11 12:13:45 2009 +0000
+++ b/sbin/raidctl/Makefile     Sun Oct 11 12:14:05 2009 +0000
@@ -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>
diff -r 4264084a31a2 -r de1d012fa2e4 sbin/raidctl/raidctl.c
--- a/sbin/raidctl/raidctl.c    Sun Oct 11 12:13:45 2009 +0000
+++ b/sbin/raidctl/raidctl.c    Sun Oct 11 12:14:05 2009 +0000
@@ -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);



Home | Main Index | Thread Index | Old Index