summaryrefslogtreecommitdiffstats
path: root/sys/geom/eli/g_eli_ctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/geom/eli/g_eli_ctl.c')
-rw-r--r--sys/geom/eli/g_eli_ctl.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/sys/geom/eli/g_eli_ctl.c b/sys/geom/eli/g_eli_ctl.c
index 9de7ec3..89e9f02 100644
--- a/sys/geom/eli/g_eli_ctl.c
+++ b/sys/geom/eli/g_eli_ctl.c
@@ -376,7 +376,7 @@ g_eli_ctl_configure(struct gctl_req *req, struct g_class *mp)
char param[16];
const char *prov;
u_char *sector;
- int *nargs, *boot, *noboot, *trim, *notrim;
+ int *nargs, *boot, *noboot, *trim, *notrim, *geliboot, *nogeliboot;
int zero, error, changed;
u_int i;
@@ -421,6 +421,19 @@ g_eli_ctl_configure(struct gctl_req *req, struct g_class *mp)
if (*trim || *notrim)
changed = 1;
+ geliboot = gctl_get_paraml(req, "geliboot", sizeof(*geliboot));
+ if (geliboot == NULL)
+ geliboot = &zero;
+ nogeliboot = gctl_get_paraml(req, "nogeliboot", sizeof(*nogeliboot));
+ if (nogeliboot == NULL)
+ nogeliboot = &zero;
+ if (*geliboot && *nogeliboot) {
+ gctl_error(req, "Options -g and -G are mutually exclusive.");
+ return;
+ }
+ if (*geliboot || *nogeliboot)
+ changed = 1;
+
if (!changed) {
gctl_error(req, "No option given.");
return;
@@ -469,6 +482,16 @@ g_eli_ctl_configure(struct gctl_req *req, struct g_class *mp)
continue;
}
+ if (*geliboot && (sc->sc_flags & G_ELI_FLAG_GELIBOOT)) {
+ G_ELI_DEBUG(1, "GELIBOOT flag already configured for %s.",
+ prov);
+ continue;
+ } else if (*nogeliboot && !(sc->sc_flags & G_ELI_FLAG_GELIBOOT)) {
+ G_ELI_DEBUG(1, "GELIBOOT flag not configured for %s.",
+ prov);
+ continue;
+ }
+
if (!(sc->sc_flags & G_ELI_FLAG_ONETIME)) {
/*
* ONETIME providers don't write metadata to
@@ -504,6 +527,14 @@ g_eli_ctl_configure(struct gctl_req *req, struct g_class *mp)
sc->sc_flags &= ~G_ELI_FLAG_NODELETE;
}
+ if (*geliboot) {
+ md.md_flags |= G_ELI_FLAG_GELIBOOT;
+ sc->sc_flags |= G_ELI_FLAG_GELIBOOT;
+ } else if (*nogeliboot) {
+ md.md_flags &= ~G_ELI_FLAG_GELIBOOT;
+ sc->sc_flags &= ~G_ELI_FLAG_GELIBOOT;
+ }
+
if (sc->sc_flags & G_ELI_FLAG_ONETIME) {
/* There's no metadata on disk so we are done here. */
continue;
OpenPOWER on IntegriCloud