Commit Graph

14 Commits

Author SHA1 Message Date
jmc b2f782612f Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944
2004-06-20 22:20:14 +00:00
christos 6bd1d6d4db Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
2004-04-21 01:05:31 +00:00
lukem 171d653219 Overhaul how `build.sh tools' are used:
*	Rename "config.h" to "nbtool_config.h" and
	HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
	This makes in more obvious in the source when we're using
	tools/compat/config.h versus "standard autoconf" config.h

    *	Consistently move the inclusion of nbtool_config.h to before
    	<sys/cdefs.h> so that the former can provide __RCSID() (et al),
    	and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
	#if HAVE_NBTOOL_CONFIG_H
	#include "nbtool_config.h"
	#endif
to the top of the source files (for the general case).
2003-10-27 00:12:41 +00:00
fvdl 42614ed3f3 Add support for UFS2. UFS2 is an enhanced FFS, adding support for
64 bit block pointers, extended attribute storage, and a few
other things.

This commit does not yet include the code to manipulate the extended
storage (for e.g. ACLs), this will be done later.

Originally written by Kirk McKusick and Network Associates Laboratories for
FreeBSD.
2003-04-02 10:39:19 +00:00
lukem 6ddeaceaff Tweak Jason's -x support to pass its state around as part of fsinf_t,
just like all the other "global" options.
Update the usage for -x.
Crank date on man page.

(Thanks to Jason for adding -x; I've been meaning to add that
functionality for a while :-)
2003-03-30 00:05:07 +00:00
thorpej 1bcb9d76fb Add a -x option which causes makefs(8) to exclude any file system node
not explicitly listed in the specfile.
2003-03-29 00:12:12 +00:00
lukem 8295ed9bda remove (now) incorrect comment 2002-02-14 05:16:16 +00:00
tv 9fbd88883c Roll in fixes to permit cross-compiling from non-NetBSD hosts. This
round has been tested on Solaris/x86 and Linux hosts.

* Add host tools cap_mkdb, ctags, m4, uudecode.
* Protect __RCSID() and __COPYRIGHT() better.
* Reduce the number of places that need to include "config.h", to keep
  sources closer to their "vanilla" versions.
* Add more compat #defines and autoconf-checked functions.
2002-01-31 22:43:33 +00:00
lukem aa99e59f3d - crank default cpg from 16 to 65536, and let the auto-sizing code in
mkfs() do its job
- pass cpgflg=1 to mkfs() if the user provided cpg, =0 otherwise
- improve error reporting in ffs_write_file()
- only add superblock & block map slop for one cylinder group.
  trying to calculate the number of required cylinder groups caused
  too many problems when tweaking parameters for small file systems.
  rely upon slop from minfree, and upon ffs_write_file() to complain
  if the user is too aggressive about tweaking the parameters
2002-01-26 13:22:16 +00:00
lukem d74b2fc0ea fix bugs reported by matt green:
- when calculating file size, round up to frag size not block size
- #define FFS_EI in makefs.h, and include that before [uf]fs/*.h

other stuff:
- round up final size to next block (instead of next sector)
- protect makefs.h from multiple inclusion
2002-01-07 05:07:50 +00:00
lukem ebbf3dddb5 rework `fsnode' into two components; `fsnode' contains the name and tree
information and a link to the appropriate fsinode, and `fsinode' contains
the inode information and a reference count. multiple fsnodes may point
to the same fsinode.  this replaces the 'dup' pointer in the previous code.
2001-12-05 11:08:53 +00:00
lukem ae62d656a9 - Use strsuftoull() from dd(1) to parse numbers, rather than home grown
version. The new version supports products, 'g' (GB) and 't' (TB)
  suffices, and `b' now means `blocks' instead of `bytes'.
  Functionality requested by perry.
- debug is now a u_int instead of an int.
- Ensure that various numbers have sane upper limits (e.g, 99 for %, etc)
2001-11-25 11:22:09 +00:00
lukem 1226af2bc4 tweak copyright 2001-11-02 03:12:48 +00:00
lukem 009121cf2c makefs - create a file system image from a directory tree.
It doesn't need any special privileges or kernel devices.

Only ffs image creation is supported at this time, although makefs has been
designed to allow the addition of other file system formats by writing new
back-ends.

This program was designed & implemented by Luke Mewburn of Wasabi Systems.
2001-10-26 05:11:42 +00:00