diff --git a/sys/geom/geom_redboot.c b/sys/geom/geom_redboot.c index 0e1f4d3f9492..938473ceccb2 100644 --- a/sys/geom/geom_redboot.c +++ b/sys/geom/geom_redboot.c @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -246,6 +247,16 @@ g_redboot_taste(struct g_class *mp, struct g_provider *pp, int insist) u_int blksize; /* NB: flash block size stored as stripesize */ u_char *buf; off_t offset; + const char *value; + char *op; + + offset = 0; + if (resource_string_value("redboot", 0, "fisoffset", &value) == 0) { + offset = strtouq(value, &op, 0); + if (*op != '\0') { + offset = 0; + } + } g_trace(G_T_TOPOLOGY, "redboot_taste(%s,%s)", mp->name, pp->name); g_topology_assert(); @@ -278,7 +289,8 @@ g_redboot_taste(struct g_class *mp, struct g_provider *pp, int insist) return (NULL); g_topology_unlock(); head = NULL; - offset = cp->provider->mediasize - blksize; + if(offset == 0) + offset = cp->provider->mediasize - blksize; again: buf = g_read_data(cp, offset, blksize, NULL); if (buf != NULL)