From owner-freebsd-questions@FreeBSD.ORG Mon Aug 5 05:09:59 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4B149851; Mon, 5 Aug 2013 05:09:59 +0000 (UTC) (envelope-from dewayne.geraghty@heuristicsystems.com.au) Received: from nschwqsrv01p.mx.bigpond.com (nschwqsrv01p.mx.bigpond.com [61.9.189.231]) by mx1.freebsd.org (Postfix) with ESMTP id B0A8A287E; Mon, 5 Aug 2013 05:09:58 +0000 (UTC) Received: from nschwcmgw08p ([61.9.190.168]) by nschwmtas04p.mx.bigpond.com with ESMTP id <20130805040319.GCJE2030.nschwmtas04p.mx.bigpond.com@nschwcmgw08p>; Mon, 5 Aug 2013 04:03:19 +0000 Received: from hermes.heuristicsystems.com.au ([58.172.113.247]) by nschwcmgw08p with BigPond Outbound id 8s3K1m00Y5LKYmq01s3KKC; Mon, 05 Aug 2013 04:03:19 +0000 X-Authority-Analysis: v=2.0 cv=LvIQOwhc c=1 sm=1 a=YibVxx38Z+cwdCKSMcELyg==:17 a=2Rs81elfNtwA:10 a=twTT4oUKOlYA:10 a=kj9zAlcOel0A:10 a=GHIR_BbyAAAA:8 a=p-_465MgMcUA:10 a=iYS7i3GgzJWJw2lDjngA:9 a=CjuIK1q_8ugA:10 a=YibVxx38Z+cwdCKSMcELyg==:117 Received: from white (white.hs [10.0.5.2]) (authenticated bits=0) by hermes.heuristicsystems.com.au (8.14.5/8.13.6) with ESMTP id r7541Urf090879; Mon, 5 Aug 2013 14:01:30 +1000 (EST) (envelope-from dewayne.geraghty@heuristicsystems.com.au) From: "Dewayne Geraghty" To: "'Devin Teske'" References: <9121C290928D49ECB462DE369BE694DD@white> <13CA24D6AB415D428143D44749F57D72020020B1@ltcfiswmsgmb21> <7C1FEE8CDBC34182B221C8CBCDFF759A@white> <13CA24D6AB415D428143D44749F57D7202004630@ltcfiswmsgmb21> Subject: RE: Geli and crunchgen (/rescue) Date: Mon, 5 Aug 2013 14:01:28 +1000 Message-ID: <03EC079CDDEA4FB09CB414AC5530A561@white> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: Ac6QHAgE252R/l1WQF2gE3XKQ+4dCQAW3E6AAAmZPtAARaUNAAAKJKsw In-Reply-To: <13CA24D6AB415D428143D44749F57D7202004630@ltcfiswmsgmb21> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Aug 2013 05:09:59 -0000 Hi Devin, Thankyou. I'll look further into the openssl reference (off-list) in a few minutes. The geom stuff is a little bit tricky to get going, because only glabel and gpart have the necessary parts in them. Pawel left enough clues to enable the other geom classes (good engineering) The flags RELEASE_CRUNCH or RESCUE is tested in the geom/Makefile and defines STATIC_GEOM_CLASSES which is tested in the source; so: I've added this and similar to geom eli (mirror, shsec raid...) =================================================================== --- class/eli/geom_eli.c (revision 253832) +++ class/eli/geom_eli.c (working copy) @@ -54,9 +54,14 @@ #include "core/geom.h" #include "misc/subr.h" +#ifdef STATIC_GEOM_CLASSES +#define PUBSYM(x) geli_##x +#else +#define PUBSYM(x) x +#endif -uint32_t lib_version = G_LIB_VERSION; -uint32_t version = G_ELI_VERSION; +uint32_t PUBSYM(lib_version) = G_LIB_VERSION; +uint32_t PUBSYM(version) = G_ELI_VERSION; #define GELI_BACKUP_DIR "/var/backups/" #define GELI_ENC_ALGO "aes" @@ -99,7 +104,8 @@ * clear [-v] prov ... * dump [-v] prov ... */ -struct g_command class_commands[] = { + +struct g_command PUBSYM(class_commands)[] = { { "init", G_FLAG_VERBOSE, eli_main, { { 'a', "aalgo", "", G_TYPE_STRING }, Then I needed to add relevant parts (I'm really only interested in eli, mirror, shsec) in the /usr/src/sbin/geom/Makefile, but I tested clean compilation of the other common classes. --- Makefile (revision 253832) +++ Makefile (working copy) @@ -4,18 +4,40 @@ .PATH: ${.CURDIR}/class/part \ ${.CURDIR}/class/label \ + ${.CURDIR}/class/eli \ + ${.CURDIR}/class/mirror \ + ${.CURDIR}/class/shsec \ ${.CURDIR}/core \ - ${.CURDIR}/misc + ${.CURDIR}/../../sys/geom/eli ${.CURDIR}/../../sys/crypto/sha2 \ + ${.CURDIR}/misc +# For geom friends, move these up +# ${.CURDIR}/class/raid \ +# ${.CURDIR}/class/sched \ +# ${.CURDIR}/class/stripe \ +# ${.CURDIR}/class/journal \ PROG= geom SRCS= geom.c geom_label.c geom_part.c subr.c +SRCS+= geom_eli.c +SRCS+= g_eli_crypto.c +SRCS+= g_eli_key.c +SRCS+= pkcs5v2.c +SRCS+= sha2.c +SRCS+= geom_mirror.c geom_shsec.c +#SRCS+= geom_raid.c geom_sched.c geom_stripe.c +#SRCS+= geom_journal.c geom_journal_ufs.c NO_MAN= WARNS?= 2 CFLAGS+=-I${.CURDIR} -I${.CURDIR}/core -DSTATIC_GEOM_CLASSES +# For eli & friends +CFLAGS+= -I${.CURDIR}/../../sys -DPADD= ${LIBGEOM} ${LIBSBUF} ${LIBBSDXML} ${LIBUTIL} -LDADD= -lgeom -lsbuf -lbsdxml -lutil +DPADD= ${LIBGEOM} ${LIBSBUF} ${LIBBSDXML} ${LIBUTIL} ${LIBMD} ${LIBCRYPTO} +LDADD= -lgeom -lsbuf -lbsdxml -lutil -lmd -lcrypto Then adding to boot_crunch.conf: progs geom special geom objs geom.o geom_label.o geom_part.o geom_mirror.o geom_shsec.o geom_eli.o sha2.o pkcs5v2.o g_eli_key.o g_eli_crypto.o subr.o ln geom geli ln geom gmirror ln geom gshsec And libs -lgeom -lkiconv -lm -lwrap libs -lssl -lcrypto -lmd # Note: I added a few other things so kiconv and wrap may not be needed for geom Resulted in release/i386/boot_crunch and /rescue performing satisfactorily :) Thanks for your help, and clues. Kind regards, Dewayne.