Support RUMP_ACTION, i.e. compile-time switch to make this execute

rump syscalls to configure raidframe in a rump kernel.
This commit is contained in:
pooka 2009-10-11 12:14:05 +00:00
parent 83bbd9b65d
commit 4f5a394d32
2 changed files with 22 additions and 3 deletions

View File

@ -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 @@ MAN= raidctl.8
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>

View File

@ -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 @@ __RCSID("$NetBSD: raidctl.c,v 1.40 2009/01/26 11:34:12 tron Exp $");
#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 @@ main(int argc,char *argv[])
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 @@ main(int argc,char *argv[])
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);