Allow schemes to specify a maximum sector size. The minimum is fixed

at 512. This allows checking of the sector size up-front when given
on the command line.
This commit is contained in:
marcel 2014-03-25 02:32:04 +00:00
parent 4eff23dbe8
commit cedbce4789
8 changed files with 15 additions and 7 deletions

3
apm.c
View File

@ -112,7 +112,8 @@ static struct mkimg_scheme apm_scheme = {
.metadata = apm_metadata,
.write = apm_write,
.nparts = 4096,
.labellen = APM_ENT_NAMELEN - 1
.labellen = APM_ENT_NAMELEN - 1,
.maxsecsz = 4096
};
SCHEME_DEFINE(apm_scheme);

3
bsd.c
View File

@ -117,7 +117,8 @@ static struct mkimg_scheme bsd_scheme = {
.metadata = bsd_metadata,
.write = bsd_write,
.nparts = 20,
.bootcode = BBSIZE
.bootcode = BBSIZE,
.maxsecsz = 512
};
SCHEME_DEFINE(bsd_scheme);

3
ebr.c
View File

@ -122,7 +122,8 @@ static struct mkimg_scheme ebr_scheme = {
.aliases = ebr_aliases,
.metadata = ebr_metadata,
.write = ebr_write,
.nparts = 4096
.nparts = 4096,
.maxsecsz = 4096
};
SCHEME_DEFINE(ebr_scheme);

3
gpt.c
View File

@ -296,7 +296,8 @@ static struct mkimg_scheme gpt_scheme = {
.write = gpt_write,
.nparts = 4096,
.labellen = 36,
.bootcode = 512
.bootcode = 512,
.maxsecsz = 4096
};
SCHEME_DEFINE(gpt_scheme);

3
mbr.c
View File

@ -97,7 +97,8 @@ static struct mkimg_scheme mbr_scheme = {
.metadata = mbr_metadata,
.write = mbr_write,
.bootcode = 512,
.nparts = NDOSPART
.nparts = NDOSPART,
.maxsecsz = 4096
};
SCHEME_DEFINE(mbr_scheme);

3
pc98.c
View File

@ -110,7 +110,8 @@ static struct mkimg_scheme pc98_scheme = {
.write = pc98_write,
.bootcode = PC98_BOOTCODESZ,
.labellen = 16,
.nparts = PC98_NPARTS
.nparts = PC98_NPARTS,
.maxsecsz = 512
};
SCHEME_DEFINE(pc98_scheme);

View File

@ -71,6 +71,7 @@ struct mkimg_scheme {
u_int nparts;
u_int labellen;
u_int bootcode;
u_int maxsecsz;
};
SET_DECLARE(schemes, struct mkimg_scheme);

View File

@ -99,7 +99,8 @@ static struct mkimg_scheme vtoc8_scheme = {
.aliases = vtoc8_aliases,
.metadata = vtoc8_metadata,
.write = vtoc8_write,
.nparts = VTOC8_NPARTS
.nparts = VTOC8_NPARTS,
.maxsecsz = 512
};
SCHEME_DEFINE(vtoc8_scheme);