Page MenuHomeFreeBSD

mkimg: Add maximum capacity option
ClosedPublic

Authored by manu on Apr 26 2017, 1:16 PM.

Details

Summary

mkimg: Add -C argument to specify maximum capacity

Add a -C option to specify a maximum capacity for the final image file.
It is useful to control the size of the generated image for sdcard or
when we will add dynamic size partition.

Sponsored By: Gandi.net

Test Plan

Create a bunch of image with different size etc ...

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

manu created this revision.Apr 26 2017, 1:16 PM
wblock added a subscriber: wblock.Apr 28 2017, 3:20 PM
wblock added inline comments.
usr.bin/mkimg/mkimg.1
40 ↗(On Diff #27751)

The space in "minimum capacity" makes it look like two arguments are expected. Maybe minimum_capacity or min_capacity instead? Likewise for "maximum capacity".

131 ↗(On Diff #27751)

Passive -> active:
s/can be/is/

132 ↗(On Diff #27751)

This is unclear, mostly due to "it" being nonspecific. Also has some passive stuff, so an attempted rewrite:

If the combined sizes of the given partitions exceed the size given with
.Fl C ,
image creation fails.
137 ↗(On Diff #27751)

s/short hand/shorthand/

manu updated this revision to Diff 27823.Apr 28 2017, 3:32 PM

Update manpage to address wblock@ comments.

manu marked 4 inline comments as done.Apr 28 2017, 3:32 PM
marcel added inline comments.May 1 2017, 5:10 PM
usr.bin/mkimg/mkimg.c
391 ↗(On Diff #27823)

This should be greater-than (>) instead of greater-equal (>=), don't you think?

manu updated this revision to Diff 27911.May 2 2017, 9:09 AM

end block can be equal to the max capacity

manu marked an inline comment as done.May 2 2017, 9:09 AM
marcel accepted this revision.May 2 2017, 6:29 PM

LGTM. Thanks!

This revision is now accepted and ready to land.May 2 2017, 6:29 PM
wblock added inline comments.May 5 2017, 3:04 PM
usr.bin/mkimg/mkimg.1
131 ↗(On Diff #27911)

Whoops, didn't see the obvious change:

option specifies a maximum capacity for the disk image.
bapt accepted this revision.May 6 2017, 11:50 AM
This revision was automatically updated to reflect the committed changes.