summaryrefslogtreecommitdiffstats
path: root/usr.bin/mkimg
Commit message (Collapse)AuthorAgeFilesLines
* MFC r319293:ngie2017-07-181-2/+6
| | | | | | | Formalize the dependent/dependency relationship for <foo>.gz.uu vs <foo> This helps ensure that the output files are regenerated if the input files change, after the output files have been created.
* MFC r319294:ngie2017-06-041-3/+4
| | | | | | | | | | Approved by: re (gjb) Fix "make rebase" after ^/head@r315776 "make rebase" can be used for rebasing the output files from mkimg after making a change to mkimg. This will come in handy soon, per bug 219673.
* MFC r302664:pfg2017-04-211-5/+5
| | | | | | | | | | | mkimg(1): minor cleanups with argument order in calloc(3). Generally the first argument in calloc is supposed to stand for a count and the second for a size. Try to make that consistent. While here, attempt to make some use of the overflow detection capability in calloc(3). Requested by: manu
* MFC r315776:ngie2017-03-302-1/+165
| | | | | | | | Rename tests from <foo> to <foo>_test to match the FreeBSD test suite naming scheme usr.bin/diff/diff_test was renamed to usr.bin/diff/netbsd_diff_test to avoid collisions with the renamed FreeBSD test.
* MFC r315212, r315213, r315214, r315215:pfg2017-03-201-3/+3
| | | | | | | | | mkimg(1): let calloc(3) do the multiplication. nscd(8): let calloc(3) do the multiplying. mpsutil(8): let calloc(3) do the multiplying. ypbind(8): let calloc(3) do the multiplying. MFC after: 1 week
* MFC r313659-r313673bapt2017-02-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r313659: Remove space at and of line Reported by: make manlint MFC after: 2 days r313660: Remove empty Li Reported by: make manlint MFC after: 2 days r313661: Escape Ss to avoid confusion by mdoc parser with the Ss macro Reported by: make manlint MFC after: 2 days r313662: Add missing -width after -Bl -tag Reported by: make manlint MFC after: 2 days r313663: Add missing section after .Xr reference r313664: Escape No to avoid confusion with the No macro r313665: Remove useless .Pp after the .Sh macro and remove empty line r313666: Remove empty space at EOL and escept Ed r313667: Remove spaces at EOL and sort correctly the SEE ALSO section r313668: Add missing section in manpage reference r313669: Properly use .An macro before Authors name r313670: Escape Sm to avoid confusion with Sm macro r313671: Use correct date format r313672: Remove useless Li macro r313673: Remove spaces at end of line Reported by: make manlint
* MFC r306299:marcel2016-12-111-3/+6
| | | | | | | | Update local variable 'block' after calling capacity_resize(), otherwise format_resize(), which is called right after, isn't getting the current/actual image size. Rather than rounding up, format_resize() could end up truncating the size and we don't allow that by design.
* MFC r306131asomers2016-09-261-1/+1
| | | | Update mkimg(1) author's contact info
* mkimg: bump version to 20151211 after r292082emaste2016-06-171-1/+1
| | | | | | | | | | | mkimg has had a number of functional additions after the last time the version was incremented. Do so now, to r292082's commit date, so that users can determine what is supported. Reviewed by: marcel Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6882
* mkimg: Indicate that input file pages are unlikely to be reused.markj2016-06-011-0/+3
| | | | | | | | | | | | | | | | | | | | | | | mkimg(1) uses a swap file to back input file chunks. When the output file is being written out, blocks of the swap file are mapped and their contents copied. This causes the backing VM pages to enter the active queue, and when the output file is large relative to system memory (as is generally the case), can result in a shortfall of inactive memory. This causes the pagedaemon to aggressively scan the active queue and swap out process memory in an attempt to meet the shortfall. Because mkimg's input files are typically the intermediate result of some build process, there's no need to push them all through the active queue. Use madvise(2) to indicate that the backing pages may be reclaimed in preference to active pages. In the case of the swap file, these pages will be freed as soon as mkimg exits anyway. When using mkimg on a desktop-class system with large amounts of dirty process memory, this change substantially improves mkimg runtime and reduces swap usage. Reviewed by: marcel MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6654
* Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installedngie2016-05-041-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | after r298107 Summary of changes: - Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that namespacing is kept with FILES appropriately, and that this shouldn't need to be repeated if the namespace changes -- only the definition of PACKAGE needs to be changed - Allow PACKAGE to be overridden by callers instead of forcing it to always be `tests`. In the event we get to the point where things can be split up enough in the base system, it would make more sense to group the tests with the blocks they're a part of, e.g. byacc with byacc-tests, etc - Remove PACKAGE definitions where possible, i.e. where FILES wasn't used previously. - Remove unnecessary TESTSPACKAGE definitions; this has been elided into bsd.tests.mk - Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES; ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk. - Fix installation of files under data/ subdirectories in lib/libc/tests/hash and lib/libc/tests/net/getaddrinfo - Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup) Document the proposed changes in share/examples/tests/tests/... via examples so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of replacing FILES. share/mk/bsd.README didn't seem like the appropriate method of communicating that info. MFC after: never probably X-MFC with: r298107 PR: 209114 Relnotes: yes Tested with: buildworld, installworld, checkworld; buildworld, packageworld Sponsored by: EMC / Isilon Storage Division
* MFHgjb2016-03-101-0/+11
|\ | | | | | | Sponsored by: The FreeBSD Foundation
| * DIRDEPS_BUILD: Connect MK_TESTS.bdrewery2016-03-091-0/+11
| | | | | | | | Sponsored by: EMC / Isilon Storage Division
* | First pass to fix the 'tests' packages.gjb2016-02-021-0/+4
|/ | | | Sponsored by: The FreeBSD Foundation
* Add ppcboot FAT type. Needed to create a bootable powerpc image.imp2015-12-113-0/+6
| | | | Differential Review: https://reviews.freebsd.org/D4407
* META MODE: Update dependencies with 'the-lot' and add missing directories.bdrewery2015-12-011-0/+19
| | | | | | | | | | | | | | This is not properly respecting WITHOUT or ARCH dependencies in target/. Doing so requires a massive effort to rework targets/ to do so. A better approach will be to either include the SUBDIR Makefiles directly and map to DIRDEPS or just dynamically lookup the SUBDIR. These lose the benefit of having a userland/lib, userland/libexec, etc, though and results in a massive package. The current implementation of targets/ is very unmaintainable. Currently rescue/rescue and sys/modules are still not connected. Sponsored by: EMC / Isilon Storage Division
* Fix a ton of speelling errorseadler2015-10-211-1/+1
| | | | | | | arc lint is helpful Reviewed By: allanjude, wblock, #manpages, chris@bsdjunk.com Differential Revision: https://reviews.freebsd.org/D3337
* mkimg: support fat16b partitions (MBR type 06h)emaste2015-10-154-0/+10
| | | | | | Reviewed by: marcel Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3894
* Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) andngie2015-10-121-2/+0
| | | | | | | | | | | | netbsd-tests.test.mk (r289151) - Eliminate explicit OBJTOP/SRCTOP setting - Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk - Remove unnecessary TESTSDIR setting - Use SRCTOP where possible for clarity MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Divison
* Fix a few mandoc warnings.brueffer2015-08-121-1/+2
| | | | MFC after: 1 week
* Fix typo introduced in previous commit.marcel2015-08-071-1/+1
| | | | Pointed out by: Nikolai Lifanov <lifanov at mail.lifanov.com>
* o Fix a typo.marcel2015-08-071-2/+82
| | | | o Describe the file formats mkimg can create.
* Rebase after r286395: rounding fix for dynamic VHDmarcel2015-08-0728-402/+407
|
* Fix the dynamic VHD format to work with qemu. The size of the diskmarcel2015-08-071-37/+55
| | | | | | | | | | | is taken to match the geometry and only when the geometry is max'd out, is the actual recorded size taken. Note that qemu has the same logic for the fixed VHD format. However that is known to conflict with Microsoft Azure, where the recorded size of the image is what counts. Pointed out by: gjb@
* Make image_copyout_zeroes() an interface function.marcel2015-08-032-6/+7
|
* Add the ntfs alias and support it with the MBR and GPT schemesmarcel2015-06-274-0/+5
| | | | as DOSPTYP_NTFS and GPT_ENT_TYPE_MS_BASIC_DATA (resp).
* Rebase after r284658:marcel2015-06-2156-711/+710
| | | | | 1. Change creator OS to "wi2k" 2. Bump tool version to 2.0
* Microsoft Azure expects the creator OS to be "Wi2k" and not "FBSD".marcel2015-06-212-3/+3
| | | | | | | | | | The image is not accepted for provisioning otherwise. Bump the VHD creator tool version and the version of mkimg to signify our success in provisioning. Note that this also imapcts the dynamic VHD images. Tested by: gjb@
* Rebase the fixed VHD images after the rounding fix.marcel2015-06-2128-314/+310
|
* Microsoft Azure demands that fixed VHD images are a whole numbermarcel2015-06-211-0/+9
| | | | | | | | | | of megabytes. This is on top of having the image rounded to the matching geometry of the image size. By rounding up to the next MB after rounding to the geometry, we lost idempotency. Subsequent calls to resize the image will keep increasing the image size. Tested by: gjb@
* Don't resize again prior to writing. Resizing may not be idempotentmarcel2015-06-211-5/+1
| | | | | and no scheme adjusts the size after the format resized the image the first time.
* Update tests after sizing changes to the fixed VHD format.marcel2015-06-1128-309/+314
|
* Handle the case in which ncyls is 0.marcel2015-06-111-3/+5
| | | | While here, update copyright.
* For the fixed VHD format, round the raw image size to the nextmarcel2015-06-111-42/+59
| | | | | | | multiple of the cylinder size. This is what qemu-img seems to be doing. Make sure to handle boundary cases where increasing the image size by 1 cyclinder's worth would also result in a change of geometry.
* Add the -c option for specifying the capacity of the disk image. Whenmarcel2015-02-223-15/+64
| | | | | | | | | a capcity is given, no partitions are required. When no partitions are given, no scheme needs to be specified either. This makes it possible to create an entirely empty disk image. To add an empty partitioning table, specify the scheme. Bump the version to 20150222.
* Don't require a scheme if no partitions are given. Change the codemarcel2015-02-222-10/+13
| | | | | to handle that case. Note that we still require partitions, so the change is effectively a no-op.
* In scheme_write(), don't overwrite the end parameter with themarcel2015-02-221-1/+0
| | | | | return value of image_get_size(). As it so happens, the only caller of scheme_write() passes exactly that.
* Remove extraneous parenthesis in assignment.marcel2015-02-221-1/+1
|
* mkimg: Add MBR EFI partition typeemaste2015-01-091-0/+4
| | | | Sponsored by: The FreeBSD Foundation
* The size of the first level reference count table is given in terms of themarcel2014-12-122-5/+6
| | | | | | | | | | | | | | | | number of clusters it occupies. It's not the number of entries in the table, as it is for the L1 cluster table. For small images, the two are the same. With the unit tests based on small images, this change has therefore no effect on the unit test. For larger images (like the FreeBSD 10.1-RELEASE image), this gives a discrepancy that actually shows up when running "qemu-img check". Bump the version number of mkimg. While here, fix a white-space bug. MFC after: 1 week
* Convert to usr.bin/ to LIBADDbapt2014-11-251-2/+1
| | | | Reduce overlinking
* Add missing commas to .Xr.trasz2014-11-141-3/+3
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* SEEK_DATA has interesting behaviour for sparse files on ZFS. A sparse filemarcel2014-11-121-3/+5
| | | | | | | | | | | | | | | | with 128K of random data and truncated to 800K can have SEEK_DATA return -1 when given an offset of 128K. On UFS, the SEEK_DATA returns 800K (the size of the file). SEEK_HOLE on ZFS seems to behave the same as UFS. To handle this, map -1 to the size of the file (`end') when lseek returns this for either SEEK_HOLE or SEEK_DATA. When sparse files are not supported by the file system both `hole' and `data' will now be equal to `end' and we will treat the entire file as data. This way, the -1 return for SEEK_DATA on ZFS will end up doing the right thing. Reported by: gjb@ MFC after: 3 days
* Update baseline files for EBR, MBR and PC98 now that mkimg fills inmarcel2014-10-0336-1229/+1227
| | | | | the CHS fields appropriately when -T and -H are given on the command line.
* Add mkimg_chs() for those schemes that need the LBA broken down intomarcel2014-10-036-21/+58
| | | | | | | | | | | | | | | | 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.
* Improve performance of mking(1) by keeping a list of "chunks" in memory,marcel2014-10-012-94/+586
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that keeps track of a particular region of the image. In particular the image_data() function needs to return to the caller whether a region contains data or is all zeroes. This required reading the region from the temporary file and comparing the bytes. When image_data() is used multiple times for the same region, this will get painful fast. With a chunk describing a region of the image, we now also have a way to refer to the image provided on the command line. This means we don't need to copy the image into a temporary file. We just keep track of the file descriptor and offset within the source file on a per-chunk basis. For streams (pipes, sockets, fifos, etc) we now use the temporary file as a swap file. We read from the input file and create a chunk of type "zeroes" for each sequence of zeroes that's a multiple of the sector size. Otherwise, we allocte from the swap file, mmap(2) it, read into the mmap(2)'d memory and create a chunk representing data. For regular files, we use SEEK_HOLE and SEEK_DATA to handle sparse files eficiently and create a chunk of type zeroes for holes and a chunk of type data for data regions. For data regions, we still compare the bytes we read to handle differences between a file system's block size and our sector size. After reading all files, image_write() is used by schemes to scribble in the reserved sectors. Since this never amounts to much, keep this data in memory in chunks of exactly 1 sector. The output image is created by looking using the chunk list to find the data and write it out to the output file. For chunks of type "zeroes" we prefer to seek, but fall back to writing zeroes to handle pipes. For chunks of type "file" and "memoty" we simply write. The net effect of this is that for reasonably large images the execution time drops from 1-2 minutes to 10-20 seconds. A typical speedup is about 5 to 8 times, depending on partition sizes, output format whether in input files are sparse or not. Bump version to 20141001.
* Suffix the cookie constants with ULL to silence warnings from compilersmarcel2014-10-011-2/+2
| | | | that try to treat them as 32-bit values.
* Update the usage message and the man page to account for the new longmarcel2014-09-273-10/+40
| | | | | | | | | | options. Bump the version number to 20140927. While here, use explicit fputc() calls to skip a line in the output. This to avoid having to hunt for extra '\n' characters in the printf format strings. MFC after: 1 week Relnotes: yes
* Add 3 long options for getting information about mkimg itself:marcel2014-09-272-13/+90
| | | | | | | | | | | | | --version print the version of mkimg and also whether it's 64- or 32-bit. --formats list the supported output formats separated by space. --schemes list the supported partitioning schemes separated by space. Inspired by a patch from: gjb@ MFC after: 1 week Relnotes: yes
* Add baseline files for QCOW2.marcel2014-09-2429-1/+625
|
OpenPOWER on IntegriCloud