From owner-freebsd-fs@FreeBSD.ORG Sat Feb 5 21:14:20 2011 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7ED4D106566B for ; Sat, 5 Feb 2011 21:14:20 +0000 (UTC) (envelope-from gleb.kurtsou@gmail.com) Received: from mail-ew0-f54.google.com (mail-ew0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 07CE48FC12 for ; Sat, 5 Feb 2011 21:14:19 +0000 (UTC) Received: by ewy24 with SMTP id 24so1779830ewy.13 for ; Sat, 05 Feb 2011 13:14:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=FWgBe19LNx88NZGWLy1p9T/lH+E/ib6ht0JV5octfOM=; b=ZgQZRPDJOlFylGhRpNMMs31O0+ZZsnqlGWFlCtm+JpKwd/arF2GrI+C0k7CNj45orA ZGG/2AoF0fQHvfIPWdUgyqE8jpVxjd9ResT3mQOagHSJ8oAQEFLeWSJz+8OQYUUnAeQa IW4ODiJhXLMOh0urdOP3WXAT53AkBgda+SXDU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=co+Axi+HEmKcPEHLZYYjR+O87/EGmvtVu8YWAo+h01IpVs3o8sL+eUYBlapyUpf1zo jNDBA4HaP0U4i/F4lVotd5EsTV51LAg6eYcz/Vqh2d5d5nDIldMBbU3ppDtV7tPIXe6M J5afvKPJkltkgtwwzWKCMf5TMe6UOebnuoKUY= Received: by 10.213.25.140 with SMTP id z12mr16963683ebb.90.1296940458907; Sat, 05 Feb 2011 13:14:18 -0800 (PST) Received: from localhost (lan-78-157-92-5.vln.skynet.lt [78.157.92.5]) by mx.google.com with ESMTPS id t50sm1704853eeh.0.2011.02.05.13.14.17 (version=SSLv3 cipher=RC4-MD5); Sat, 05 Feb 2011 13:14:18 -0800 (PST) Date: Sat, 5 Feb 2011 23:14:06 +0200 From: Gleb Kurtsou To: Gary Jennejohn Message-ID: <20110205211405.GA7212@tops.skynet.lt> References: <4D4BE50A.7000705@bally-wulff.de> <20110204141254.1dd98de8@ernst.jennejohn.org> <20110204224856.GA78229@tops.skynet.lt> <20110205100728.46f5ca92@ernst.jennejohn.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="uAKRQypu60I7Lcqm" Content-Disposition: inline In-Reply-To: <20110205100728.46f5ca92@ernst.jennejohn.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-fs@freebsd.org Subject: Re: building kernel including GEOM_VINUM X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Feb 2011 21:14:20 -0000 --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=utf-8 Content-Disposition: inline On (05/02/2011 10:07), Gary Jennejohn wrote: > On Sat, 5 Feb 2011 00:48:56 +0200 > Gleb Kurtsou wrote: > > On (04/02/2011 14:12), Gary Jennejohn wrote: > > > It would probably require some major hacking. Apparently gvinum was > > > designed with using it only as a KLD in mind. > > The change it trivial, just add files listed in > > sys/modules/geom/geom_vinum/Makefile to sys/files. > > It was also necessary it tweak /sbin/gvinum to check if module loaded > > during startup to eliminate useless warning (afair). > > For someone not used to working with the kernel I'd say that what you > describe is major hacking. Especially the modification to gvinum. The patch attached. Would you test if it's ok in both cases: built-in and module. vinum(4) man page states that loading it as module is preferred, I see no reason for it to still remain so, the text was written in ~1999 and vinum was rewritten on top of geom afterwards. Thanks, Gleb. --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="gvinum-kernel.patch.txt" commit 2200845bcf19dcf410a23429d2f1421060023992 Author: Gleb Kurtsou 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 --uAKRQypu60I7Lcqm--