diff options
author | pjd <pjd@FreeBSD.org> | 2006-02-11 12:45:01 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2006-02-11 12:45:01 +0000 |
commit | f9926daa991d642b6d76923afa06dabe1a4b0b74 (patch) | |
tree | 1c03e3279e8285e39cb738052e236551c2ce0929 | |
parent | 79081baaf0634d209ef24667ca3e00c0ad2abd5a (diff) | |
download | FreeBSD-src-f9926daa991d642b6d76923afa06dabe1a4b0b74.zip FreeBSD-src-f9926daa991d642b6d76923afa06dabe1a4b0b74.tar.gz |
Check rootvnode variable to see if we still want to ask for passphrase on
boot. Other methods just don't work properly.
MFC after: 3 days
-rw-r--r-- | sys/geom/eli/g_eli.c | 30 | ||||
-rw-r--r-- | sys/modules/geom/geom_eli/Makefile | 2 |
2 files changed, 3 insertions, 29 deletions
diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c index afc3c867..915f1d0 100644 --- a/sys/geom/eli/g_eli.c +++ b/sys/geom/eli/g_eli.c @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include <sys/sched.h> #include <sys/smp.h> #include <sys/uio.h> +#include <sys/vnode.h> #include <vm/uma.h> @@ -74,8 +75,6 @@ TUNABLE_INT("kern.geom.eli.threads", &g_eli_threads); SYSCTL_UINT(_kern_geom_eli, OID_AUTO, threads, CTLFLAG_RW, &g_eli_threads, 0, "Number of threads doing crypto work"); -static int g_eli_do_taste = 0; - static int g_eli_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp); static void g_eli_crypto_run(struct g_eli_worker *wr, struct bio *bp); @@ -909,7 +908,7 @@ g_eli_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, pp->name); g_topology_assert(); - if (!g_eli_do_taste || g_eli_tries == 0) + if (rootvnode != NULL || g_eli_tries == 0) return (NULL); G_ELI_DEBUG(3, "Tasting %s.", pp->name); @@ -1063,30 +1062,5 @@ g_eli_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, g_eli_algo2str(sc->sc_algo)); } -static void -g_eli_on_boot_start(void *dummy __unused) -{ - - /* This prevents from tasting when module is loaded after boot. */ - if (cold) { - G_ELI_DEBUG(1, "Start tasting."); - g_eli_do_taste = 1; - } else { - G_ELI_DEBUG(1, "Tasting not started."); - } -} -SYSINIT(geli_boot_start, SI_SUB_TUNABLES, SI_ORDER_ANY, g_eli_on_boot_start, NULL) - -static void -g_eli_on_boot_end(void *dummy __unused) -{ - - if (g_eli_do_taste) { - G_ELI_DEBUG(1, "Tasting no more."); - g_eli_do_taste = 0; - } -} -SYSINIT(geli_boot_end, SI_SUB_RUN_SCHEDULER, SI_ORDER_ANY, g_eli_on_boot_end, NULL) - DECLARE_GEOM_CLASS(g_eli_class, g_eli); MODULE_DEPEND(geom_eli, crypto, 1, 1, 1); diff --git a/sys/modules/geom/geom_eli/Makefile b/sys/modules/geom/geom_eli/Makefile index 20db77d..e94fb88 100644 --- a/sys/modules/geom/geom_eli/Makefile +++ b/sys/modules/geom/geom_eli/Makefile @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../../geom/eli KMOD= geom_eli -SRCS= g_eli.c g_eli_crypto.c g_eli_ctl.c g_eli_key.c pkcs5v2.c +SRCS= g_eli.c g_eli_crypto.c g_eli_ctl.c g_eli_key.c pkcs5v2.c vnode_if.h WARNS?= 2 .include <bsd.kmod.mk> |