summaryrefslogtreecommitdiff
path: root/usr.sbin/makefs
Commit message (Collapse)AuthorAgeFilesLines
* makefs: connect cd9660 El Torito EFI boot image system typeEd Maste2020-09-172-3/+6
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=365847
* Fix makefs bootstrap on macOS after D25563Alex Richardson2020-08-251-0/+1
| | | | | | | | | | | The macOS assert.h header does not define static_assert when compiling in C99 mode. To fix this compile with -std=c11. Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D25928 Notes: svn path=/head/; revision=364765
* makefs (msdosfs): Use fprintf instead of debug print for errorsAlex Richardson2020-08-241-3/+3
| | | | | | | | | | The added print was very helpful for debugging failed disk image creation. Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D23200 Notes: svn path=/head/; revision=364648
* makefs: Drop unnecessary sys/clock.h includeAlex Richardson2020-08-071-1/+0
| | | | | | | | | This breaks the build on macOS where this header doesn't exist. I could also add a compat header to tools/build/cross-build but since it's not needed removing it seems like the better solution. Notes: svn path=/head/; revision=364024
* Revert r362390, those tests are fixed by r362418Li-Wen Hsu2020-06-231-24/+0
| | | | | | | | PR: 247425 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=362551
* Allocate an fs_summary_info structure when creating a UFS filesystemKirk McKusick2020-06-191-0/+1
| | | | | | | | | | needed since introduced in -r362358. PR: 247425 Sponsored by: Netflix Notes: svn path=/head/; revision=362418
* Skip ufs related tests in fstyp(8) and makefs(8) temporarilyLi-Wen Hsu2020-06-191-0/+24
| | | | | | | | | | They are failing after r362358 and r362359. PR: 247425 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=362390
* Fix an indentation bug in r357169.Brooks Davis2020-01-301-1/+1
| | | | Notes: svn path=/head/; revision=357303
* Allow bootstrapping makefs on older FreeBSD hosts and Linux/macOSAlex Richardson2020-01-272-4/+4
| | | | | | | | | | | | | | | | | | | | | | In order to do so we need to install the msdosfs headers to the bootstrap sysroot and avoid includes of kernel headers that may not exist on every host (e.g. sys/lockmgr.h). This change should allow bootstrapping of makefs on FreeBSD 11+ as well as Linux and macOS. We also have to avoid using the IO_SYNC macro since that may not be available. In makefs it is only used to switch between calling bwrite() and bdwrite() which both call the same function. Therefore we can simply always call bwrite(). For our CheriBSD builds we always bootstrap makefs by setting LOCAL_XTOOL_DIRS='lib/libnetbsd usr.sbin/makefs' and use the makefs binary from the build tree to create a bootable disk image. Reviewed By: brooks Differential Revision: https://reviews.freebsd.org/D23201 Notes: svn path=/head/; revision=357169
* Update Makefile.depend filesSimon J. Gerraty2019-12-111-1/+0
| | | | | | | | | | | | | Update a bunch of Makefile.depend files as a result of adding Makefile.depend.options files Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22494 Notes: svn path=/head/; revision=355617
* makefs: Also set UFS di_birthtime when building on LinuxAlex Richardson2019-11-151-2/+9
| | | | | | | | | | | Since st_birthtime doesn't exists on Linux (unless you use statx(2)), we instead populate it with the st_ctime value. Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D22386 Notes: svn path=/head/; revision=354739
* Fix contents= being ignored in msdosfs makefs mtreeAlex Richardson2019-11-151-1/+2
| | | | | | | | | | I noticed this while trying to build an EFI boot image Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D22387 Notes: svn path=/head/; revision=354738
* buf: Add B_INVALONERR flag to discard dataConrad Meyer2019-09-115-0/+5
| | | | | | | | | | | | | | | | | | | | | | Setting the B_INVALONERR flag before a synchronous write causes the buf cache to forcibly invalidate contents if the write fails (BIO_ERROR). This is intended to be used to allow layers above the buffer cache to make more informed decisions about when discarding dirty buffers without successful write is acceptable. As a proof of concept, use in msdosfs to handle failures to mark the on-disk 'dirty' bit during rw mount or ro->rw update. Extending this to other filesystems is left as future work. PR: 210316 Reviewed by: kib (with objections) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D21539 Notes: svn path=/head/; revision=352233
* makefs: share msdosfsmount.h between kernel msdosfs and makefsEd Maste2019-09-018-208/+7
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=351665
* Properly update FSInfo block after generation.Xin LI2019-08-233-0/+33
| | | | | | | | | | | | After populating the filesystem, write a FSInfo block with proper information. Reviewed by: emaste, cem MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D21363 Notes: svn path=/head/; revision=351415
* makefs: diff reduction to sys/fs/msdosfsEd Maste2019-08-228-24/+33
| | | | | | | No functional change. Notes: svn path=/head/; revision=351396
* makefs: Verify that the BPB media descriptor and FAT ID matchEd Maste2019-08-211-6/+16
| | | | | | | From r322982 in sys/fs/msdosfs. Notes: svn path=/head/; revision=351347
* makefs: share denode.h between kernel msdosfs and makefsEd Maste2019-08-219-276/+33
| | | | | | | | | | | There is no need to duplicate this file when it can be trivially shared (just exposing sections previously under #ifdef _KERNEL). MFC with: r351273 Differential Revision: The FreeBSD Foundation Notes: svn path=/head/; revision=351346
* makefs: share fat.h between kernel msdosfs and makefsEd Maste2019-08-218-127/+16
| | | | | | | | | | | | | There is no reason to duplicate this file when it can be trivially shared (just exposing one section previously under #ifdef _KERNEL). Reviewed by: imp, cem MFC with: r351273 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21346 Notes: svn path=/head/; revision=351321
* makefs: use `char *` not `void *` for buf b_data, drop casts in msdosEd Maste2019-08-212-23/+23
| | | | | | | | | | | | | (The kernel uses caddr_t.) Suggested by: cem Reviewed by: cem MFC with: r351273 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21348 Notes: svn path=/head/; revision=351319
* makefs.8: update historyEd Maste2019-08-201-1/+7
| | | | | | | | - ported to FreeBSD and first appeared in 8.0 - Christos Zoulas added the FAT support that I imported Notes: svn path=/head/; revision=351302
* makefs: avoid "dereferencing 'void *' pointer" warningsEd Maste2019-08-201-22/+22
| | | | | | | | | | On GCC 4.2.1 archs MFC with: r351273 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=351275
* makefs: add msdosfs (FAT) supportEd Maste2019-08-2017-315/+2907
| | | | | | | | | | | | | | | | | | | | | | Add FAT support to makefs by copying some files from sys/fs/msdosfs/ and updating others with changes from NetBSD. The six files copied from sys/fs/msdosfs at r348251 and modified are: denode.h direntry.h fat.h msdosfs_fat.c msdosfs_lookup.c msdosfsmount.h I would prefer to avoid the duplication, but reluctance to doing so was expressed in a previous review (D11197); for now copy the files and revisit in the future. Submitted by: Siva Mahadevan Discussed with: cem, imp MFC after: 1 month Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D16438 Notes: svn path=/head/; revision=351273
* makefs.8: expand description of image sizeEd Maste2019-08-191-1/+12
| | | | | | | | Submitted by: ryan_freqlabs.com, Siva Mahadevan Differential Revision: https://reviews.freebsd.org/D21316 Notes: svn path=/head/; revision=351232
* makefs.8: style updates from igorEd Maste2019-08-191-6/+9
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=351230
* makefs: Fix "time" mtree attribute handlingEd Maste2019-03-182-9/+6
| | | | | | | | | | | | | | | | | | When processing mtree(5) MANIFEST files, makefs(8) previously threw an error if it encountered an entry whose "time" attribute contained a non-zero subsecond component (e.g. time=1551620152.987220000). Update the handling logic to properly assign the subsecond component if built with nanosecond support, or silently discard it otherwise. Also, re-enable the time attribute for the kyua tests. PR: 194703 Submitted by: Mitchell Horne <mhorne063@gmail.com> Differential Revision: https://reviews.freebsd.org/D19627 Notes: svn path=/head/; revision=345281
* Improve error handling: bail out if one of the files scheduledMaxim Sobolev2019-02-251-4/+1
| | | | | | | | | | | | | | | to go to the FS image we are making cannot be read (e.g. EPERM). Current behaviour when we issue waring but still proceeed and return success is definitely not correct: masking out error condition as well as making a slighly inconsistent FS where attempt to access the file in question ends up in EBADF. See linked DR for details. MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D18584 Notes: svn path=/head/; revision=344555
* makefs: use FreeBSD brelse function signatureEd Maste2018-07-268-31/+31
| | | | | | | | | | | | Although the ffs (and later msdosfs) implementation in makefs is independent of the one in kernel, it makes sense to keep differences to a minimum in order to ease comparison and porting changes across. Submitted by: Siva Mahadevan Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=336736
* makefs: whitespace cleanup in msdos filesEd Maste2018-07-253-13/+13
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=336706
* makefs(8): add test case for PR 229929Alan Somers2018-07-211-2/+27
| | | | | | | | | | | | | Fix two failing makefs test cases by adding "-M 1m", which was already used for every other FFS test case. Add a new test case for the underlying issue: with no -M, -m, or -s options, makefs can underestimate image size. PR: 229929 Reported by: Jenkins MFC after: 2 weeks Notes: svn path=/head/; revision=336582
* makefs: ANSIfyEd Maste2018-05-162-18/+5
| | | | Notes: svn path=/head/; revision=333664
* makefs: Use ENODATA instead of ENOMSG as a translation for missing ENOATTR.Pedro F. Giffuni2018-04-251-1/+1
| | | | | | | | | | This is consistent with what some linux filesystems do and has been adopted in our linuxulator. MFC after: 3 days Notes: svn path=/head/; revision=332986
* makefs: tidy up reach-over sourceEd Maste2018-04-203-7/+4
| | | | | | | | | | | | | - cd9660 relies on an #include "iso.h" but does not build any .c files out of source, so remove reach-over .PATH - ffs does not rely on any sys/ headers, so remove -I from CFLAGS. - ffs_tables from sys/ is used by ffs; move the SRCS entry from the top- level Makefile to ffs' Makefile.inc. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=332844
* Synchronise with NetBSD's version of EFI handling for El Torito images.Benno Rice2018-03-314-28/+63
| | | | | | | | | | | | | | | When I implemented my EFI support I failed to check if the upstream version of makefs in NetBSD had done the same. Override my version with theirs to make it easier to stay in sync with them in the future. Reviewed by: imp, mav Obtained from: NetBSD MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D14913 Notes: svn path=/head/; revision=331843
* makefs: sync fragment and block size with newfsEd Maste2018-03-301-2/+2
| | | | | | | | | | | | | r222319 in newfs raised the default blocksize for UFS/FFS filesystems from 16K to 32K and the default fragment size from 2K to 4K, with a rationale that most disks were now running with 4K sectors. MFC after: 2 weeks Relnotes: Yes Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=331758
* Don't try to modify El Torito section headers if there aren't any.Benno Rice2018-03-231-1/+4
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=331468
* Correctly mark the last El Torito section header.Benno Rice2018-03-231-1/+11
| | | | | | | | | | | Reported by: Thomas Schmitt <scdbackup@gmx.net> Reviewed by: emaste, imp MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D14812 Notes: svn path=/head/; revision=331467
* Allow makefs to properly tag UEFI El Torito boot images. Use them in amd64 ISOs.Benno Rice2018-03-232-3/+10
| | | | | | | | | | | | | | | | | | | | | | UEFI booting requires an EFI System Partition (ESP). On most storage devices this will be in a specific partition type. To allow booting from CD/ISO filesystems, UEFI will look for an ESP in the form of a FAT filesystem image embedded in the image. Historically FreeBSD has added one of these to its amd64 ISO images but marked it as simply another i386 boot image. Luckily for us most UEFI implementations are rather forgiving and work this out for us. This change adds the ability to mark a boot image as being a UEFI image. It also modifies our ISO generation to use this marking for the UEFI image we embed. Reported by: Thomas Schmitt <scdbackup@gmx.net> Reviewed by: emaste, imp MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D14809 Notes: svn path=/head/; revision=331463
* Check for cd9660 support before attempting to mount created imagesBrooks Davis2018-02-021-8/+12
| | | | | | | | | | | | | | This extends the set in r316028 to allow all tests to pass or be skipped on a system without cd9660 support. A better approach using tar is possible, but this works today. Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D10516 Notes: svn path=/head/; revision=328822
* Allow xinstall and makefs to be crossbuilt on Linux and MacAlex Richardson2018-01-162-1/+11
| | | | | | | | | | | | | | I need these tools in order to install the crossbuilt FreeBSD and create a disk image. Linux does not have a st_flags in struct stat so unfortunately I need a bunch of ugly ifdefs. The resulting binaries allow me to sucessfully install a MIPS64 world and create a disk-image that boots. Reviewed By: brooks, bdrewery, emaste Approved By: jhb (mentor) Differential Revision: https://reviews.freebsd.org/D13307 Notes: svn path=/head/; revision=328064
* userland: Fix several typos and minor errorsEitan Adler2017-12-271-1/+1
| | | | | | | | | | | - duplicate words - typos - references to old versions of FreeBSD Reviewed by: imp, benno Notes: svn path=/head/; revision=327230
* Fix a logic bug in makefs lazy inode initialization.Mark Johnston2017-12-161-1/+1
| | | | | | | | | | | | | | | | We may need to initialize multiple inode blocks before writing a given inode. makefs(8) was only initializing a single block at a time, so certain inode allocation patterns could lead to a situation where it wrote an inode to an uninitialized block. That inode might be clobbered by a later initialization, resulting in a filesystem image containing directory entries that point to a seemingly unused inode. Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D13505 Notes: svn path=/head/; revision=326912
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-2722-18/+62
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326276
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-207-6/+20
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* spdx: initial adoption of licensing ID tags.Pedro F. Giffuni2017-11-181-1/+3
| | | | | | | | | | | | | | | | | | | | The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Initially, only tag files that use BSD 4-Clause "Original" license. RelNotes: yes Differential Revision: https://reviews.freebsd.org/D13133 Notes: svn path=/head/; revision=325966
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Update several more URLsEitan Adler2017-10-291-1/+1
| | | | | | | | - Primarily http -> https - Primarily FreeBSD project URLs Notes: svn path=/head/; revision=325096
* Replace makefs' hand-rolled unescaping with strunvisBenno Rice2017-08-251-31/+19
| | | | | | | | | | | | | | | | | | | mtree path names and link attributes are encoded, generally using strvis. Newer versions of mtree will use C-style escapes but previously the accepted form was octal escapes. makefs' mtree code spots the C-style escapes but fails to deal with octal escapes correctly. Remove mtree's escape-decoding code (except for a few instances where it's needed) and instead pass pathnames and link targets through strunvis prior to use. Reviewed by: marcel MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12104 Notes: svn path=/head/; revision=322894
* MFhead@r321960Enji Cooper2017-08-021-0/+8
|\ | | | | | | Notes: svn path=/projects/make-check-sandbox/; revision=321961
| * Require strings(1) with :o_flag_preparer and :o_flag_publisherEnji Cooper2017-08-021-0/+8
| | | | | | | | | | | | | | | | | | strings(1) might not be installed on the system, e.g., if MK_TOOLCHAIN == no MFC after: 1 week Notes: svn path=/head/; revision=321947