summaryrefslogtreecommitdiffstats
path: root/usr.bin/mkimg/mkimg.h
Commit message (Collapse)AuthorAgeFilesLines
* Add mkimg_chs() for those schemes that need the LBA broken down intomarcel2014-10-031-0/+2
| | | | | | | | | | | | | | | | cylinder, head and track numbers. Return ~0U for these values when mkimg wasn't given both -T and -H (i.e. no geometry) or the cylinder would be larger than the provided maximum. Use mkimgs_chs() for the EBR, MBR and PC98 schemes to fill in the appropriate fields. Make sure to use a "rounded" size so that the partition is always a multiple of the track size. We reserved the room for it in the metadata callback so that's a valid thing to do. Bump the mkimg version number. While doing that again: have mkimg.o depend on the Makefile so that a version change triggers a rebuild as needed.
* Fix partition alignment and image rounding when any of -P (block size),marcel2014-09-191-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | -T (track size) or -H (number of heads) is given: o scheme_metadata() always rounded to the block size. This is not always valid (e.g. vtoc8 that must have partitions start at cylinder boundaries). o The bsd and vtoc8 schemes "resized" the image to make it match the geometry, but since the geometry is an approximation and the size of the image computed from cylinders * heads * sectors is always smaller than the original image size, the partition information ran out of bounds. The fix is to have scheme_metadata() simply pass it's arguments to the per-scheme metadata callback, so that schemes not only know where the metadata is to go, but also what the current block address is. It's now up to the per-scheme callback to reserve room for metadata and to make sure alignment and rounding is applied. The BSD scheme now has the most elaborate alignment and rounding. Just to make the point: partitions are aligned on block boundaries, but the image is rounded to the next cyclinder boundary. vtoc8 now properly has all partitions aligned (and rounded) to the cyclinder boundary. Obtained from: Juniper Networks, Inc. MFC after: 3 days
* Add VHD support to mkimg(1). VHD is used by Xen and Microsoft's Hyper-Vmarcel2014-07-031-0/+4
| | | | | | | | | | | among others. Add an undocumented option for unit testing (-y). When given, the image will have UUIDs and timestamps synthesized in a way that gives identical results across runs. As such, UUIDs stop being unique, globally or otherwise. VHD support requested by: gjb@
* MFuser/marcel/mkimg:marcel2014-05-151-3/+5
| | | | | | | | Add support for different output formats: 1. The output file that was previously written is now called the raw format. 2. Add the vmdk output format to create VMDK images. When the format is not given, the raw output format is assumed.
* Add mkimg_write() which combines lseek(2) and write(2) and usesmarcel2014-05-061-1/+1
| | | | | | | | sector granularity for both offset and length. Have all schemes use mkimg_write() instead of mkimg_seek() followed by write(2). Now that schemes don't use lseek(2) nor write(2) directly, it's easier to support output formats other than raw disks.
* Add mkimg, a utility for making disk images from raw partition contents.marcel2014-03-291-0/+72
The partitioning scheme can be one of the schemes supported by gpart. Reviewed by: sjg Obtained from: Juniper Networks, Inc.
OpenPOWER on IntegriCloud