aboutsummaryrefslogtreecommitdiff
path: root/sbin/fsck_msdosfs
Commit message (Collapse)AuthorAgeFilesLines
...
* Mention the version of NetBSD the utility originated from.Sevan Janiyan2016-10-021-2/+5
| | | | | | | | | | PR: 212476 Approved by: bcr (mentor) MFC after: 4 days Differential Revision: https://reviews.freebsd.org/D8105 Notes: svn path=/head/; revision=306602
* fsck_msdosfs: Adjust a check.Pedro F. Giffuni2016-05-041-1/+1
| | | | | | | | | | | The on-disk FAT array does not include anything before CLUST_FIRST, compensate in size check. Obtained from: NetBSD (CVS Rev. 1.20) MFC after: 2 weeks Notes: svn path=/head/; revision=299089
* Use macro MAX() from sys/param.h.Marcelo Araujo2016-04-221-1/+1
| | | | | | | MFC after: 2 weeks. Notes: svn path=/head/; revision=298441
* fsck_msdosfs: use NULL instead of zero for pointers.Pedro F. Giffuni2016-04-191-1/+1
| | | | Notes: svn path=/head/; revision=298286
* MFHGlen Barber2016-04-111-4/+6
|\ | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=297824
| * fsck_msdosfs(8): Optimimize memsetsPedro F. Giffuni2016-04-061-4/+6
| | | | | | | | | | | | | | | | Obtained from: NetBSD (bin/50908) MFC after: 2 weeks Notes: svn path=/head/; revision=297618
* | Explicitly add more files to the 'runtime' package.Glen Barber2016-02-091-0/+1
|/ | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295450
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge from head@274682Simon J. Gerraty2014-11-192-2/+4
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=274683
| * Merge head from 7/28Simon J. Gerraty2014-08-194-27/+44
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=270164
| * | Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * | Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * | Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * | Sync from headSimon J. Gerraty2012-11-046-45/+48
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=242545
| * | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | | Make UEFI booting of 4Kn disks work:Doug Ambrisko2014-10-302-2/+4
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - convert boot1.efi to corrrectly calculate the lba for what the media reports and convert the size based on what FreeBSD uses. The existing code would use the 512 byte lba and convert the size using 4K byte size. - make fsck_msdosfs read the boot block as 4K so the read doesn't fail on a 4Kn drive since FreeBSD will error out parition reads of a block. Make the bpbBytesPerSec check a multiple of 512 since it can be 512 or 4K depending on the disk. This allows fsck to pass checking the EFI partition on a 4Kn disk. To create the EFI file system I used: newfs_msdos -F 32 -S 4096 -c 1 -m 0xf8 <partition> This works for booting 512 and 4Kn disks. Caveat is that loader.efi cannot read the 4Kn EFI partition. This isn't critical right now since boot1.efi will read loader.efi from the ufs partition. It looks like loader.efi can be fixed via making some of the 512 bytes reads more flexible. loader.efi doesn't have trouble reading the ufs partition. This is probably a simple fix. I now have FreeBSD installed on a system with 4Kn drives and tested the same code works on 512. MFC after: 1 week Notes: svn path=/head/; revision=273865
* | | newfs_msdosfs: Respect FSFIXFATPedro F. Giffuni2014-07-142-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix some whitespace issues while here. Obtained from: NetBSD (rev. 1.9) MFC after: 3 days Notes: svn path=/head/; revision=268635
* | | msdosfs: Assorted fixes from other BSDs.Pedro F. Giffuni2014-07-142-15/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When truncating cluster chains fix the length of the cluster head. http://marc.info/?t=140304310700005&r=1&w=2 Avoid infinite loops in cluster chain linked lists. http://marc.info/?l=openbsd-tech&m=140275150804337&w=2 Avoid off-by-one on FAT12 filesystems. http://marc.info/?l=openbsd-tech&m=140234174104724&w=2 Obtained from: NetBSD (from OpenBSD) MFC after: 1 week Notes: svn path=/head/; revision=268632
* | | fsck_msdosfs: be a bit more permissivePedro F. Giffuni2014-07-141-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The free space value in the FSInfo block is merely unitialized when it is 0xffffffff. This fixes a bug found in NetBSD. It must be noted that we never supported all the checks that NetBSD does as some of them would cause failures with a freshly created FAT32 from MS-Windows. While here, bring some space fixes. Obtained from: NetBSD (rev. 1.22) MFC after: 3 days Notes: svn path=/head/; revision=268631
* | | Minor (mostly cosmetic) cleanupsPedro F. Giffuni2014-07-142-3/+1
| |/ |/| | | | | | | | | | | | | | | | | | | Several whitespace fixes convert *rootDir from external to static. Obtained from: NetBSD, OpenBSD (partial) MFC after: 3 days Notes: svn path=/head/; revision=268628
* | Print a newline after the error message.Jaakko Heinonen2012-11-031-0/+1
| | | | | | | | | | | | | | | | PR: bin/168447 Submitted by: Boris Kochergin Notes: svn path=/head/; revision=242511
* | Make fsck and fsck_msdosfs WARNS=6 cleanUlrich Spörlein2012-10-214-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | - sprinkle const - add volatile qualifier to avoid vfork clobbering Inspired by: NetBSD PR: bin/139802 Reviewed by: ed Notes: svn path=/head/; revision=241807
* | sbin/fsck: s/perror/perr/ to avoid shadowingUlrich Spörlein2012-10-214-41/+44
|/ | | | | | | | | | | | - rename some other vars too - merge NetBSD license changes Obtained from: NetBSD PR: bin/139802 Reviewed by: ed Notes: svn path=/head/; revision=241806
* Make sure that each va_start has one and only one matching va_end,Kevin Lo2012-05-291-0/+1
| | | | | | | especially in error cases. Notes: svn path=/head/; revision=236213
* Add missing static keywords for global variables to tools in sbin/.Ed Schouten2011-11-041-1/+1
| | | | | | | | | These tools declare global variables without using the static keyword, even though their use is limited to a single C-file, or without placing an extern declaration of them in the proper header file. Notes: svn path=/head/; revision=227081
* Fix some style(9), although there's a lot more issues here.Brian Somers2010-06-205-24/+34
| | | | | | | | | | | | Fix some casting errors. PR: 142384 Submitted by: giffunip at tutopia dot com Obtained from: NetBSD MFC after: 3 weeks Notes: svn path=/head/; revision=209364
* mdoc: .Ud has attitude, it takes no argument!Ulrich Spörlein2010-05-271-1/+1
| | | | Notes: svn path=/head/; revision=208596
* Rename fields to match better the msdosfs headers. This work is stillKonstantin Belousov2010-02-145-106/+106
| | | | | | | | | | | | incomplete as some info doesn't really belong to the structs where it is defined. Submitted by: Pedro F. Giffuni <giffunip tutopia com> Reviewed by: bde MFC after: 2 weeks Notes: svn path=/head/; revision=203874
* Bug fixes from NetBSDKonstantin Belousov2010-02-147-70/+100
| | | | | | | | | | | | | | - fix sign-compare issues. - ANSIfy a couple of functions. - Remove more duplicate #includes. - Memory leak found by Coverity on NetBSD. Submitted by: Pedro F. Giffuni <giffunip tutopia com> Reviewed by: bde MFC after: 2 weeks Notes: svn path=/head/; revision=203872
* License changes from NetBSD.Konstantin Belousov2010-02-148-56/+0
| | | | | | | | | | Move to 2 clause license, approved by Wolfgang Solfrank. Submitted by: Pedro F. Giffuni <giffunip tutopia com> MFC after: 2 weeks Notes: svn path=/head/; revision=203871
* fsck_msdosfs: accept no-op -C option for compatibilty with fsckAndriy Gapon2009-06-102-4/+10
| | | | | | | | | | Submitted by: marck Reviewed by: current@ Approved by: jhb (mentor) MFC after: 1 week Notes: svn path=/head/; revision=193943
* Spot two more bugs WRT adherence to the local prompt style.Yaroslav Tykhiy2008-01-311-2/+2
| | | | Notes: svn path=/head/; revision=175854
* Use consistent style in user prompts: the question is in a new lineYaroslav Tykhiy2008-01-312-6/+6
| | | | | | | | | | and begins with a capital letter. The rest of pwarn/ask pairs here follows this style. Requested by: bde Notes: svn path=/head/; revision=175853
* Prevent the `fix?' question from running togetherYaroslav Tykhiy2008-01-131-1/+1
| | | | | | | | with the problem description on the terminal: use conventional punctuation. Notes: svn path=/head/; revision=175287
* Prefer the __printflike() macro to GCC's __attribute__ stuff.Stefan Farfeleder2005-03-091-1/+1
| | | | Notes: svn path=/head/; revision=143315
* Sync program's usage() with manpage's SYNOPSIS.Ruslan Ermilov2005-02-102-3/+5
| | | | Notes: svn path=/head/; revision=141612
* Sort sections.Ruslan Ermilov2005-01-181-5/+5
| | | | Notes: svn path=/head/; revision=140415
* Assorted markup, grammar, and spelling fixes.Ruslan Ermilov2004-05-171-2/+2
| | | | Notes: svn path=/head/; revision=129327
* Only compare the interesting part of the bootblock with its backup.Tim J. Robbins2004-04-201-4/+8
| | | | | | | | | | Allow check to proceed with bad backup boot block if we're doing a readonly check. Various typos in comments. Obtained from: NetBSD Notes: svn path=/head/; revision=128463
* style.Makefile(5):Johan Karlsson2004-02-231-1/+1
| | | | | | | Use WARNS?= instead of WARNS=. Notes: svn path=/head/; revision=126178
* Fixed operation of -f to match its documentation and fsck_ffs. ItBruce Evans2004-02-053-7/+6
| | | | | | | | | | | | has now has no effect except in combination with -p, and plain fsck checks all file systems instead of skipping clean ones for msdosfs only. Renamed the force flag to skipclean and inverted its logic as in fsck_ffs. Notes: svn path=/head/; revision=125486
* Fixed some bugs in checkdirty(). The check for the clean bit wasBruce Evans2004-02-051-9/+27
| | | | | | | | | | | | | | | | | | | | | | combined with the the signature check in a wrong way (basically (dirty:= signature_recognised() && !clean) instead of (mightbedirty:= !signature_recognized || !clean), so file systems with unrecognized signatures were considered clean. Many of the don't-care and reserved bits were not ignored, so some file systems with valid signatures were unrecognized. One of my FAT32 file systems has a signature of f8,ff,ff,ff,ff,ff,ff,f7 when dirty, but only f8,ff,ff,0f,ff,ff,ff,07 was recognised as dirty for FAT32, so the fail-unsafeness made my file system always considered clean. Check the i/o non-error bit in checkdirty(). Its absence would give an unrecognized signature in code that is unaware of it, but we now mask it out of the signature so we have to check it explicitly. This combines naturally with the check of the clean bit. Reviewed by: rnordier (except for final details) Notes: svn path=/head/; revision=125485
* Document the dirty flag and other bits in the first 2 FAT entriesBruce Evans2004-02-051-0/+18
| | | | | | | | | | | | | | | better. There is a related I/O error flag which we don't support in the kernel but must support here. (Support for bits that we don't understand here is mostly automatic by fail-safeness, but checkdirty() has fail-unsafeness.) There are some reserved and don't-care bits that weren't fully documented and aren't always masked properly. The comment about the bits in readfat() will be removed when the masking is fixed. Submitted by: rnordier Notes: svn path=/head/; revision=125471
* Prepare to fix checkdirty() by moving it from check.c to fat.c. It isBruce Evans2004-02-052-43/+43
| | | | | | | | identical to a subset of readfat(), so it belongs near readfat() if not in it. Notes: svn path=/head/; revision=125469
* Oops, highly non-KNF indentation is normal for large expressions inBruce Evans2003-12-281-6/+5
| | | | | | | | | | | | | | this program. Gnu indentation is used for these. Redo the fix for the large expression at the end of the previous commit to give gnu indentation. The original version was gnuish but had 9 bogus extra characters of indentation in its continuation lines, perfect tab lossage on every line, and other bugs. The previous commit log should have claimed to fix style bugs in the previous-1 commit (1.5), not the forced null previous commit (1.6). Notes: svn path=/head/; revision=123917
* Expanded the comment about the -F flag.Bruce Evans2003-12-271-2/+8
| | | | | | | Fixed a nearby style bug (unreachable break). Notes: svn path=/head/; revision=123892
* fsck_msdosfs/main.c:Bruce Evans2003-12-271-2/+4
| | | | | | | | | | | | | | | - Don't use errexit() to (mis)implement usage(). Using errexit() just gave the bogus exit code 8. - Fixed 3 other style bugs in usage(). fsck/fsutil.[ch]: - Garbage-collected errexit(). It is essentially just one of NetBSD's fsck_ext2fs error printing functions, but we don't have fsck_ext2fs and the function is unsuitable for use there too (since pfatal() is also used and it printf to a different stream). Notes: svn path=/head/; revision=123888
* Fixed style bugs in previous commit (unsorting of declarations and poorBruce Evans2003-12-271-7/+8
| | | | | | | wording in a comment). Notes: svn path=/head/; revision=123883