aboutsummaryrefslogtreecommitdiff
path: root/sbin/fsdb/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* When using the fsdb `blocks' command, replace the long and ugly list ofKirk McKusick2018-04-081-2/+3
| | | | | | | | blocks with the much more concise and readable block list shown by the prtblknos() function imported from tools/diag/prtblknos. Notes: svn path=/head/; revision=332267
* Continuing efforts to provide hardening of FFS, this change adds aKirk McKusick2017-09-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | check hash to cylinder groups. If a check hash fails when a cylinder group is read, no further allocations are attempted in that cylinder group until it has been fixed by fsck. This avoids a class of filesystem panics related to corrupted cylinder group maps. The hash is done using crc32c. Check hases are added only to UFS2 and not to UFS1 as UFS1 is primarily used in embedded systems with small memories and low-powered processors which need as light-weight a filesystem as possible. Specifics of the changes: sys/sys/buf.h: Add BX_FSPRIV to reserve a set of eight b_xflags that may be used by individual filesystems for their own purpose. Their specific definitions are found in the header files for each filesystem that uses them. Also add fields to struct buf as noted below. sys/kern/vfs_bio.c: It is only necessary to compute a check hash for a cylinder group when it is actually read from disk. When calling bread, you do not know whether the buffer was found in the cache or read. So a new flag (GB_CKHASH) and a pointer to a function to perform the hash has been added to breadn_flags to say that the function should be called to calculate a hash if the data has been read. The check hash is placed in b_ckhash and the B_CKHASH flag is set to indicate that a read was done and a check hash calculated. Though a rather elaborate mechanism, it should also work for check hashing other metadata in the future. A kernel internal API change was to change breada into a static fucntion and add flags and a function pointer to a check-hash function. sys/ufs/ffs/fs.h: Add flags for types of check hashes; stored in a new word in the superblock. Define corresponding BX_ flags for the different types of check hashes. Add a check hash word in the cylinder group. sys/ufs/ffs/ffs_alloc.c: In ffs_getcg do the dance with breadn_flags to get a check hash and if one is provided, check it. sys/ufs/ffs/ffs_vfsops.c: Copy across the BX_FFSTYPES flags in background writes. Update the check hash when writing out buffers that need them. sys/ufs/ffs/ffs_snapshot.c: Recompute check hash when updating snapshot cylinder groups. sys/libkern/crc32.c: lib/libufs/Makefile: lib/libufs/libufs.h: lib/libufs/cgroup.c: Include libkern/crc32.c in libufs and use it to compute check hashes when updating cylinder groups. Four utilities are affected: sbin/newfs/mkfs.c: Add the check hashes when building the cylinder groups. sbin/fsck_ffs/fsck.h: sbin/fsck_ffs/fsutil.c: Verify and update check hashes when checking and writing cylinder groups. sbin/fsck_ffs/pass5.c: Offer to add check hashes to existing filesystems. Precompute check hashes when rebuilding cylinder group (although this will be done when it is written in fsutil.c it is necessary to do it early before comparing with the old cylinder group) sbin/dumpfs/dumpfs.c Print out the new check hash flag(s) sbin/fsdb/Makefile: Needs to add libufs now used by pass5.c imported from fsck_ffs. Reviewed by: kib Tested by: Peter Holm (pho) Notes: svn path=/head/; revision=323923
* sbin: normalize paths using SRCTOP-relative paths or :H when possibleEnji Cooper2017-03-041-2/+2
| | | | | | | | | | This simplifies make logic/output MFC after: 1 month Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=314656
* 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
* Convert sbin/ to LIBADDBaptiste Daroussin2014-11-251-2/+1
| | | | | | | Reduce overlinking Notes: svn path=/head/; revision=275030
* Replace all uses of libncurses and libtermcap with their wide characterBrooks Davis2014-07-171-2/+2
| | | | | | | | | | | | | variants. This allows usable file system images (i.e. those with both a shell and an editor) to be created with only one copy of the curses library. Exp-run: antoine PR: 189842 Discussed with: bapt Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=268804
* Add globs.c to the build now that it's a separate file.Scott Long2013-12-301-1/+1
| | | | | | | | | Reviewed by: max Obtained from: Netflix MFC after: 3 days Notes: svn path=/head/; revision=260069
* Partially undo r228693, by removing NO_WFORMAT.clang in fsdb's Makefile,Dimitry Andric2012-03-091-2/+0
| | | | | | | | | | | | | | | and fixing the format string in sbin/fsdb/fsdbutil.c instead. Note the remark "Work around a problem with format string warnings and ntohs macros" was actually incorrect. The DIP(dp, di_nlink) macro invocation actually returned an int, due to its ternary expression, even though the di_nlink members of struct ufs1_dinode and struct ufs2_dinode are both defined as int16_t. MFC after: 2 weeks Notes: svn path=/head/; revision=232749
* Define several extra macros in bsd.sys.mk and sys/conf/kern.pre.mk, toDimitry Andric2012-02-281-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | get rid of testing explicitly for clang (using ${CC:T:Mclang}) in individual Makefiles. Instead, use the following extra macros, for use with clang: - NO_WERROR.clang (disables -Werror) - NO_WCAST_ALIGN.clang (disables -Wcast-align) - NO_WFORMAT.clang (disables -Wformat and friends) - CLANG_NO_IAS (disables integrated assembler) - CLANG_OPT_SMALL (adds flags for extra small size optimizations) As a side effect, this enables setting CC/CXX/CPP in src.conf instead of make.conf! For clang, use the following: CC=clang CXX=clang++ CPP=clang-cpp MFC after: 2 weeks Notes: svn path=/head/; revision=232263
* Revert r228603, and add the workaround to sbin/fsdb/Makefile instead.Dimitry Andric2011-12-181-0/+4
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=228693
* Make fsck WARNS=2 clean.Lukas Ertl2004-10-091-1/+1
| | | | Notes: svn path=/head/; revision=136322
* Downgrade WARNS level until GCC 3.4.2 warning are fixed.Alexander Kabaev2004-07-281-0/+1
| | | | Notes: svn path=/head/; revision=132763
* Fixed style of DPADD and LDADD assignments as per style.Makefile(5).Ruslan Ermilov2004-02-051-2/+2
| | | | Notes: svn path=/head/; revision=125503
* Make this WARNS=2 clean byJohan Karlsson2003-11-131-1/+0
| | | | | | | | | | | | | - #include <timeconv.h> for _time_to_time32 et al - use (uintmax_t) and %j - remove unused variable 'j' (from PR 39866) PR: 39866 Submitted by: Dan Lukes <dan@obluda.cz> Tested by: make universe Notes: svn path=/head/; revision=122621
* I forgot fsdb was still sharing files with fsck.Poul-Henning Kamp2002-09-161-1/+1
| | | | Notes: svn path=/head/; revision=103402
* Warning cleanup.Poul-Henning Kamp2002-07-301-1/+1
| | | | | | | Format changes by peter Notes: svn path=/head/; revision=100935
* Default to WARNS=2.David E. O'Brien2001-12-041-0/+1
| | | | | | | | | Binary builds that cannot handle this must explicitly set WARNS=0. Reviewed by: mike Notes: svn path=/head/; revision=87325
* - Backout botched attempt to introduce MANSECT feature.Ruslan Ermilov2001-03-261-0/+1
| | | | | | | - MAN[1-9] -> MAN. Notes: svn path=/head/; revision=74815
* Set the default manual section for sbin/ to 8.Ruslan Ermilov2001-03-201-1/+0
| | | | Notes: svn path=/head/; revision=74531
* Reviewed by: rwatson, bpAdrian Chadd2000-10-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Approved by: rwatson Obtained from: NetBSD source tree Second part of the fsck wrappers commit. This commit enables the new fsck code (removing the fsck/* code and replacing it with the netbsd fsck wrapper code), and enabling some FFS-based utilities to compile. Details: * quotacheck, fsdb required modification to use the fsck_ffs/ code rather than fsck/ . This might change later since quotacheck requires preen.c which should exist in fsck/ rather than fsck_ffs/ * src/Makefile has fsck_ffs added to it so it it built as part of the tree now * share/doc/smm/03.fsck/ uses the SMM.doc/ stuff from fsck_ffs, not fsck. I've tested this, and it shouldn't require any changes on your machine. The fsck wrapper reads /etc/fsck and is command-line-compatible enough to not require rc changes (well, most changes unless you want to do anything nifty by specifying the fs types explicityly, read the man page if you want further details on what it can do.) This now allows us to support multiple filesystem types during bootup. Notes: svn path=/head/; revision=66868
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50476
* opt_diagnostic.h isn't needed anymore.John Hay1998-02-061-8/+3
| | | | Notes: svn path=/head/; revision=33139
* fsdb and fsck use the ffs code which needs opt_diagnostic.h.John Hay1998-02-051-3/+8
| | | | Notes: svn path=/head/; revision=33118
* Revert $FreeBSD$ to $Id$Peter Wemm1997-02-221-1/+1
| | | | Notes: svn path=/head/; revision=22990
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-1/+1
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* Add ${DPADD}, $Id$Peter Wemm1996-09-021-0/+2
| | | | Notes: svn path=/head/; revision=18003
* Adjust relative paths in Makefile to ../sbin/fsck and ../../sys/ufs/ffsPeter Wemm1995-11-241-2/+2
| | | | Notes: svn path=/head/; revision=12480
* Commit FreeBSD-specific changes. Mainly to do with structure layoutPeter Wemm1995-11-031-1/+1
| | | | | | | differences that we dont have. Notes: svn path=/head/; revision=12051
* Whoops. RE-Import NetBSD's fsdb - I believe this was written by John Kohl.Peter Wemm1995-11-031-0/+13
Obtained from: NetBSD Notes: svn path=/vendor/NetBSD/dist/; revision=12048