[geom_redboot] Extend geom_redboot to handle non-zero fis offset.
Submitted by: Mori Hiroki <yamori813@yahoo.co.jp> Differential Revision: https://reviews.freebsd.org/D7237
This commit is contained in:
parent
452bd5bf51
commit
85ab1aeccf
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=306678
@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/bio.h>
|
||||
#include <sys/lock.h>
|
||||
#include <sys/mutex.h>
|
||||
#include <sys/bus.h>
|
||||
|
||||
#include <sys/sbuf.h>
|
||||
#include <geom/geom.h>
|
||||
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user