From df493c630e427108e6a11aefe72cb786a421ac22 Mon Sep 17 00:00:00 2001 From: pjd Date: Tue, 25 Oct 2011 13:57:50 +0000 Subject: Add support for creating GELI devices with older metadata version for use with older FreeBSD versions: - Add -V option to 'geli init' to specify version number. If no -V is given the most recent version is used. - If -V is given don't allow to use features not supported by this version. - Print version in 'geli list' output. - Update manual page and add table describing which GELI version is supported by which FreeBSD version, so one can use it when preparing GELI device for older FreeBSD version. Inspired by: Garrett Cooper MFC after: 3 days --- sys/geom/eli/g_eli.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sys/geom/eli/g_eli.c') diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c index fce52ae..b5e4f7b 100644 --- a/sys/geom/eli/g_eli.c +++ b/sys/geom/eli/g_eli.c @@ -713,6 +713,7 @@ g_eli_create(struct gctl_req *req, struct g_class *mp, struct g_provider *bpp, else gp->access = g_std_access; + sc->sc_version = md->md_version; sc->sc_inflight = 0; sc->sc_crypto = G_ELI_CRYPTO_UNKNOWN; sc->sc_flags = md->md_flags; @@ -1210,6 +1211,7 @@ g_eli_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, sbuf_printf(sb, "%s%u\n", indent, sc->sc_nkey); } + sbuf_printf(sb, "%s%u\n", indent, sc->sc_version); sbuf_printf(sb, "%s", indent); switch (sc->sc_crypto) { case G_ELI_CRYPTO_HW: -- cgit v1.1