Commit Graph

84 Commits

Author SHA1 Message Date
jmc 2406596e11 Refactor the filesystem specific portions out of makefs.c/makefs.h completely.
Instead of extending fsinfo_t it now holds a void * to file system specific
data. This is then setup/cleaned up by the additional of 2 additional
callbacks. Makes adding new filesystems simpler as almost no code has
to be updated in the generic makefs code now.
2004-12-20 20:51:42 +00:00
jmc 7a47cf149b Check for fstatvfs and provide/use it only if the host system has it.
Fixes PR#27221
2004-10-12 03:28:30 +00:00
dbj 2446aaf129 include <sys/statvfs.h> if HAVE_STRUCT_STATVFS_F_IOSIZE
addresses part of PR toolchain/26415
2004-07-24 16:30:50 +00:00
lukem be48f412fd Define FFS_MAXBSIZE to 65536 and use instead of MAXBSIZE.
Deprecate unused MAXINOPB.
Should fix PR [toolchain/25603].
2004-06-24 22:30:13 +00:00
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
lukem 5e4b83e60b Use uint64_t instead of uint32_t to store a host inode when checking
for duplicate inodes, as Cygwin's stat(2) has a 64 bit st_ino.
Fix from Ian Lance Taylor in private email.
2004-05-31 22:24:51 +00:00
lukem bb07f837f4 minor typo 2004-05-31 22:21:12 +00:00
dsl 1074bd3a3f Allow for ROOTINO when deciding whether their are enough inodes in the
created filesystem.  Otherwise this fails when asked for 63 inodes for
i386 ramdisk-big.
This code really needs to use the current version of newfs/mkfs.c where
the actual inode count can be passed in (instead of the density).
Fixes a build problem when I add /mountroot to mtree.common for sysinst.
2004-04-26 21:06:55 +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 3a06421e87 After populating the file system, update superblock->fs_old_cstotal from
superblock->fs_cstotal.  Fixes inconsistencies found by FreeBSD's fsck.
Problem noted by Luigi Rizzo <luigi@FreeBSD.org> via Colin Percival.
2004-04-02 11:27:56 +00:00
wiz e3fc4b66c3 Spell the plural of suffix "suffixes", not "suffices".
Inspired by PR 24400 by Todd Vierling.
2004-02-13 17:56:17 +00:00
jmmv b635f565e7 Homogenize usage messages: make the 'usage' word all lowercase, as this seems
to be the most common practice in our tree.
2004-01-05 23:23:32 +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
mycroft fc2aa2b3be Mention that we should be adding space for bitmaps. 2003-10-26 10:32:35 +00:00
mycroft f8ab7a4906 Remove a strange multiplication which appears to be incorrect. 2003-10-26 10:31:44 +00:00
itojun 686afb7f65 safer use of realloc 2003-10-16 06:22:09 +00:00
itojun e99b62a1d7 realloc pedant 2003-09-19 06:11:35 +00:00
fvdl bd84ee9c7a Revert arc4random usage. makefs is only used for install images,
filehandle randomization is not an issue there, and using arc4random
broke building makefs as a host tool.
2003-09-07 14:24:08 +00:00
itojun e2c411ce3c use arc4random 2003-09-06 12:42:00 +00:00
agc 326b2259b7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22366, verified by myself.
2003-08-07 11:25:11 +00:00
tsutsui af66232520 Fix function declaration mismatch with src/sys/ufs/ffs/ffs_extern.h which
causes makefs(8) failure on big endian machines. Pointed out by tsubai.

XXX The real problem is that some sources include {.CURDIR}/ffs/ffs_extern.h
XXX but others include /usr/include/ufs/ffs/ffs_extern.h .
2003-06-15 18:10:56 +00:00
lukem 826a14607a Now that <bsd.prog.mk> DTRT if HOSTPROG is defined (i.e, it is a no-op),
there's no need to special-case .include-ing it.
2003-05-18 07:57:31 +00:00
itojun 2ab2b66ee8 just for safety - use sizeof 2003-05-09 00:48:59 +00:00
briggs 755a56f62f Protect use of __RCSID() with a check to ensure that it's defined.
Suggested by Ian Lance Taylor on tech-userlevel@ to help cross-compilation
on Red Hat 7.3.
2003-04-16 01:32:07 +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 e5f384735d support 1234 and 4321 as valid byte-order arguments for -B 2003-03-10 10:02:58 +00:00
wiz 990562bfef .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
2003-02-25 10:34:36 +00:00
grant 806593a806 The correct capitalisation of 'NetBSD.org' is (you
guessed it) 'NetBSD.org'.

some mdoc fixes.
2003-02-14 16:11:34 +00:00
mrg ab09fc008e make this build on alpha after daddr_t->64bit 2003-01-28 08:22:08 +00:00
uwe 85b406eda9 s/ulong/unsigned long/. ulong is for SysV compatibility, there's no
point in using it in our code.  This change makes makefs(8) compile on
host systems without ulong.
2003-01-27 01:34:09 +00:00
fvdl a3ff3a3038 Bump daddr_t to 64 bits. Replace it with int32_t in all places where
it was used on-disk, so that on-disk formats remain the same.
Remove ufs_daddr_t and ufs_lbn_t for the time being.
2003-01-24 21:55:02 +00:00
lukem d348d3d723 tweaks for fparseln(3) move from libutil to libc:
- remove #include <util.h> if nothing else needed it
- remove LDFLAGS+=-lutil if nothing else needed it
2002-11-30 03:10:53 +00:00
lukem d55058d0cc oops; libutil is (currently) needed by ../mtree/spec.c for fparseln 2002-11-30 02:09:44 +00:00
lukem f9b27e4de2 - remove -lutil; nothing here needs it
- no need to reference ../../bin/dd now that strsuftoll(3) is in libc
2002-11-30 02:06:51 +00:00
lukem d08243260c convert from strsuftoull() (from ../../bin/dd) to strsuftoll(3) in libc 2002-11-29 13:06:32 +00:00
provos 32b88027c7 use readlink with bufsize - 1; approved thorpej. 2002-10-19 20:33:17 +00:00
lukem 17d72c8a6b use NETBSDSRCDIR as appropriate 2002-09-18 03:54:26 +00:00
soren 236006d5dc Remove extraneous \n's in {err,warn}{,x} that used to be printfs. 2002-08-08 13:24:12 +00:00
grant eda9e509bb sweep of errx/warnx, remove unnecessary trailing \n 2002-07-20 08:40:16 +00:00
thorpej 8165e606cc d_namlen is a uint8_t, and thus will always be < MAXMANLEN + 1 (256),
so there is no need to assert it.
2002-05-30 18:16:41 +00:00
lukem 23c8fa8cf8 - Clear fs_fmod in superblock before final write. Noted by Erik Anggard.
- Explicitly close the image file descriptor at the end of ffs_makefs().
2002-02-15 04:04:57 +00:00
lukem 8295ed9bda remove (now) incorrect comment 2002-02-14 05:16:16 +00:00
lukem 2afe4e83de If an entry is in the specfile but not in the underlying file system, and it's
marked "optional", don't add it. (e.g, don't create a zero-length file).
2002-02-08 01:17:32 +00:00
lukem 5f26fac683 use (size / DEV_BSIZE) instead of btodb(size). fixes cross build issue. 2002-02-06 15:36:30 +00:00
lukem 02647fd20d don't need <ufs/ufs/dir.h> here 2002-02-06 14:58:15 +00:00
lukem 6d5ff7c496 - clean up some debugging and verbose output
- use fs_cstotal.cs_nifree rather than fs->fs_ncg * fs->fs_ipg to
  determine the number of free inodes available in the file system
- don't count '.' (the root node for a level) in inode sizing, since
  the parent has already been counted
- some more todo items
2002-02-06 02:17:14 +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
tv 76834aef57 Protect __RCSID and __COPYRIGHT from being invoked if not defined. 2002-01-31 19:36:47 +00:00