aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/makefs/msdos
Commit message (Collapse)AuthorAgeFilesLines
* 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
* 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
* 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-017-205/+6
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=351665
* Properly update FSInfo block after generation.Xin LI2019-08-231-0/+30
| | | | | | | | | | | | 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-217-273/+29
| | | | | | | | | | | 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-211-22/+22
| | | | | | | | | | | | | (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: 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-2011-286/+2784
| | | | | | | | | | | | | | | | | | | | | | 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: use FreeBSD brelse function signatureEd Maste2018-07-263-5/+5
| | | | | | | | | | | | 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-252-8/+8
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=336706
* makefs: add copies of NetBSD makefs msdos source filesEd Maste2017-06-231-1/+0
| | | | | | | | | | | | | | | | | | We do not treat makefs as contrib code. Import copies of makefs msdos files from NetBSD so that we can track our changes to these files. These are copied from NetBSD, with only a change to use __FBSDID and $FreeBSD$ instead of __KERNEL_RCSID and $NetBSD$. A copy of the original $NetBSD$ tag remains in each source file. These two files were missed in r320212. Also remove a stray blank line added in msdosfs_vfsops.c. Submitted by: Siva Mahadevan Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=320291
* makefs: add copies of NetBSD makefs msdos source filesEd Maste2017-06-223-0/+1443
We do not treat makefs as contrib code. Import copies of makefs msdos files from NetBSD so that we can track our changes to these files. These are copied from NetBSD, with only a change to use __FBSDID and $FreeBSD$ instead of __KERNEL_RCSID and $NetBSD$. A copy of the original $NetBSD$ tag remains in each source file. Submitted by: Siva Mahadevan Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=320212