kern/154570: [patch] gvinum can't be built as part of the kernel, but only as module

Gleb Kurtsou gleb.kurtsou at gmail.com
Mon Feb 7 13:00:18 UTC 2011


>Number:         154570
>Category:       kern
>Synopsis:       [patch] gvinum can't be built as part of the kernel, but only as module
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 07 13:00:17 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Gleb Kurtsou
>Release:        9-CURRENT
>Organization:
>Environment:
>Description:
Issue was disscussed on freebsd-fs@

Patch works for original submitter:
http://marc.info/?l=freebsd-fs&m=129707023313641&w=2
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

commit 2200845bcf19dcf410a23429d2f1421060023992
Author: Gleb Kurtsou <gleb.kurtsou at gmail.com>
Date:   Sun Feb 6 01:04:09 2011 +0200

    Support building kernel with gvinum included

diff --git a/sbin/gvinum/gvinum.c b/sbin/gvinum/gvinum.c
index f936a58..033a553 100644
--- a/sbin/gvinum/gvinum.c
+++ b/sbin/gvinum/gvinum.c
@@ -94,8 +94,10 @@ main(int argc, char **argv)
 	char buffer[BUFSIZ], *inputline, *token[GV_MAXARGS];
 
 	/* Load the module if necessary. */
-	if (kldfind(GVINUMMOD) < 0 && kldload(GVINUMMOD) < 0)
-		err(1, GVINUMMOD ": Kernel module not available");
+	if (modfind(GVINUMMOD) < 0) {
+		if (kldload(GVINUMKLD) < 0 && modfind(GVINUMMOD) < 0)
+			err(1, GVINUMKLD ": Kernel module not available");
+	}
 
 	/* Arguments given on the command line. */
 	if (argc > 1) {
@@ -1206,9 +1208,10 @@ gvinum_stop(int argc, char **argv)
 {
 	int err, fileid;
 
-	fileid = kldfind(GVINUMMOD);
+	fileid = kldfind(GVINUMKLD);
 	if (fileid == -1) {
-		warn("cannot find " GVINUMMOD);
+		if (modfind(GVINUMMOD) < 0)
+			warn("cannot find " GVINUMKLD);
 		return;
 	}
 
@@ -1218,7 +1221,7 @@ gvinum_stop(int argc, char **argv)
 	 * event thread will be free for the g_wither_geom() call from
 	 * gv_unload().  It's silly, but it works.
 	 */
-	printf("unloading " GVINUMMOD " kernel module... ");
+	printf("unloading " GVINUMKLD " kernel module... ");
 	fflush(stdout);
 	if ((err = kldunload(fileid)) != 0 && (errno == EAGAIN)) {
 		sleep(1);
@@ -1226,7 +1229,7 @@ gvinum_stop(int argc, char **argv)
 	}
 	if (err != 0) {
 		printf(" failed!\n");
-		warn("cannot unload " GVINUMMOD);
+		warn("cannot unload " GVINUMKLD);
 		return;
 	}
 
diff --git a/sbin/gvinum/gvinum.h b/sbin/gvinum/gvinum.h
index d1b45a0..14f7562 100644
--- a/sbin/gvinum/gvinum.h
+++ b/sbin/gvinum/gvinum.h
@@ -36,4 +36,5 @@
 
 /* $FreeBSD$ */
 
-#define GVINUMMOD	"geom_vinum"
+#define GVINUMMOD	"g_vinum"
+#define GVINUMKLD	"geom_vinum"
diff --git a/sys/conf/NOTES b/sys/conf/NOTES
index dc3d8f1..602cc23 100644
--- a/sys/conf/NOTES
+++ b/sys/conf/NOTES
@@ -168,6 +168,7 @@ options 	GEOM_SHSEC		# Shared secret.
 options 	GEOM_STRIPE		# Disk striping.
 options 	GEOM_SUNLABEL		# Sun/Solaris partitioning
 options 	GEOM_UZIP		# Read-only compressed disks
+options 	GEOM_VINUM		# Vinum logical volume manager
 options 	GEOM_VIRSTOR		# Virtual storage.
 options 	GEOM_VOL		# Volume names from UFS superblock
 options 	GEOM_ZERO		# Performance testing helper.
diff --git a/sys/conf/files b/sys/conf/files
index 3973bc9..4823fb0 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -2075,6 +2075,21 @@ geom/raid3/g_raid3_ctl.c	optional geom_raid3
 geom/shsec/g_shsec.c		optional geom_shsec
 geom/stripe/g_stripe.c		optional geom_stripe
 geom/uzip/g_uzip.c		optional geom_uzip
+geom/vinum/geom_vinum.c		optional geom_vinum
+geom/vinum/geom_vinum_create.c	optional geom_vinum
+geom/vinum/geom_vinum_drive.c	optional geom_vinum
+geom/vinum/geom_vinum_plex.c	optional geom_vinum
+geom/vinum/geom_vinum_volume.c	optional geom_vinum
+geom/vinum/geom_vinum_subr.c	optional geom_vinum
+geom/vinum/geom_vinum_raid5.c	optional geom_vinum
+geom/vinum/geom_vinum_share.c	optional geom_vinum
+geom/vinum/geom_vinum_list.c	optional geom_vinum
+geom/vinum/geom_vinum_rm.c	optional geom_vinum
+geom/vinum/geom_vinum_init.c	optional geom_vinum
+geom/vinum/geom_vinum_state.c	optional geom_vinum
+geom/vinum/geom_vinum_rename.c	optional geom_vinum
+geom/vinum/geom_vinum_move.c	optional geom_vinum
+geom/vinum/geom_vinum_events.c	optional geom_vinum
 geom/virstor/binstream.c	optional geom_virstor
 geom/virstor/g_virstor.c	optional geom_virstor
 geom/virstor/g_virstor_md.c	optional geom_virstor
diff --git a/sys/conf/options b/sys/conf/options
index 440f89f..f311b79 100644
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -106,6 +106,7 @@ GEOM_SHSEC	opt_geom.h
 GEOM_STRIPE	opt_geom.h
 GEOM_SUNLABEL	opt_geom.h
 GEOM_UZIP	opt_geom.h
+GEOM_VINUM	opt_geom.h
 GEOM_VIRSTOR	opt_geom.h
 GEOM_VOL	opt_geom.h
 GEOM_ZERO	opt_geom.h


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list