Commit Graph

347 Commits

Author SHA1 Message Date
christos 1985c705e9 initialize dummy_ref 2013-12-19 22:10:03 +00:00
apb 3d4c34e695 Now that tools/compat/compat_defs.h defones __USE, there's no
need to treat the tools build as a special case.
2013-10-24 14:01:01 +00:00
mrg e392147a46 avoid using __USE() in the tools version of this. 2013-10-19 20:49:22 +00:00
christos 0a77b69ab6 fix unused variable warnings. 2013-10-19 17:16:37 +00:00
jmcneill 36f0ae602b when building as a tool, only use struct tm tm_gmtoff if HAVE_STRUCT_TM_TM_GMTOFF is defined -- fixes cygwin build 2013-08-14 10:16:04 +00:00
reinoud 857cc1af09 Fix possible 32 bit issues. In practice hard to reach but better be safe than
sorry.
2013-08-09 15:11:08 +00:00
reinoud a5f25cf5c7 Oops, used size_t when off_t was meant. This results in the 4G file size
modulation seen on 32 bit machines due to size_t being 32 bit there.

While here, also fix compilation errors he@ discovered while compiling on
NetBSD/vax.
2013-08-09 11:29:44 +00:00
wiz 8e20e62ba9 New sentence, new line.
Use one list instead of two consecutive ones.
Add .El to end list.
2013-08-06 20:16:54 +00:00
reinoud 254934d244 Switch back program version to the version of the newfs_udf/makefs code.
While here, visit the 80 columns police :)
2013-08-06 13:15:30 +00:00
reinoud c55e926ff1 Add minimum UDF version specification to makefs(8) -t udf. 2013-08-06 12:47:21 +00:00
reinoud a1f170f537 Allow for the logical volume label to be specified as well as the physical
volume label. Also allow the volumeset name to be specified if desired. The
syntax follows the newfs_udf(8) syntax.
2013-08-06 12:19:34 +00:00
wiz 3e9c1afce6 New sentence, new line. 2013-08-06 12:12:51 +00:00
reinoud 19751c1514 Update makefs(8) man page to reflect the selection of default sector and disc
sizes based on the disc type.
2013-08-06 09:43:41 +00:00
reinoud f7be5947bb Implement auto-setting of sector size and disc size when specifying
-oT=<devtype> to one of the supported disk types.

While here, also fix where the -s size argument would be overriden by the
calculated size.
2013-08-06 09:32:23 +00:00
reinoud ef2095d848 Fix assert() on allocation type by masking it with the flag allocation bit
mask. Fixes internal allocation writing in nodes with suid/sgid/sticky
accessnode.
2013-08-06 08:24:56 +00:00
reinoud 3551bde30d Fix memory leaks found by Coverity and fix memoryleaks in the new code 2013-08-06 08:18:08 +00:00
reinoud c27eed8f4f Note that i added the UDF support to makefs(8) and bump data 2013-08-05 18:49:58 +00:00
reinoud 8f48418536 Cleanup makefile for makefs 2013-08-05 18:45:00 +00:00
reinoud 2b17bd9a06 Revert joergs patch and make it compile in both the normal as in the tools
environment by providing the MMC datastructures separately for compat.
2013-08-05 18:44:16 +00:00
joerg 9656a3f6dc Allow building UDF parts of makefs on !NetBSD. 2013-08-05 17:12:04 +00:00
reinoud 62e9bc7cdb Make memset() usage consequent in using the right types 2013-08-05 16:43:46 +00:00
wiz c93932c41e Sort. Improve table formatting. 2013-08-05 14:50:32 +00:00
reinoud e2036ad8da Implement `makefs -t udf'.
Formatting options may be enhanced to make it more in line with newfs_udf on
say labeling.
2013-08-05 14:41:57 +00:00
reinoud 7da88b2514 `makefs -t cd9660' fix from FreeBSD:
Submitted by:   Thomas Schmitt via marius@freebsd.org
Obtained from:  FreeBSD r253707

- Correctly set the Expiration Time in the Primary Volume Descriptor;
  according to ISO 9660 8.4.26.1 unspecified date and time are denoted by the
  digit 0 in RBP 1 to 16 but the number 0 in RBP 17.

- Rock Ridge TF entries should use a length of 5, because after the 4 bytes of
  generic SUSP header there is one byte of flags. See typedef of ISO_RRIP_TF
  in iso9660_rrip.h.
2013-07-30 16:02:23 +00:00
dholland 75571afd93 Stick ffs_ in front of the following macros:
fragstoblks()
   blkstofrags()
   fragnum()
   blknum()

to finish the job of distinguishing them from the lfs versions, which
Christos renamed the other day.

I believe this is the last of the overtly ambiguous exported symbols
from ffs... or at least, the last of the ones that conflicted with lfs.
ffs still pollutes the C namespace very broadly (as does ufs) and this
needs quite a bit more cleanup.

XXX: boo on macros with lowercase names. But I'm not tackling that just yet.
2013-06-23 22:03:34 +00:00
dholland e1610ba4cb Stick ffs_, ext2_, chfs_, filecore_, cd9660_, or mfs_ in front of
the following symbols so as to disambiguate fully. (Christos already
did the lfs ones.)

   lblkno
   lblktosize
   lfragtosize
   numfrags
   blkroundup
   fragroundup
2013-06-23 07:28:36 +00:00
dholland 2737439da3 fsbtodb() -> FFS_FSBTODB(), EXT2_FSBTODB(), or MFS_FSBTODB()
dbtofsb() -> FFS_DBTOFSB() or EXT2_DBTOFSB()

(Christos already did the lfs ones a few days back)
2013-06-23 02:06:04 +00:00
dholland f1333577b5 Rename ambiguous macros:
MAXDIRSIZE -> UFS_MAXDIRSIZE or LFS_MAXDIRSIZE
   NINDIR -> FFS_NINDIR, EXT2_NINDIR, LFS_NINDIR, or MFS_NINDIR
   INOPB -> FFS_INOPB, LFS_INOPB
   INOPF -> FFS_INOPF, LFS_INOPF
   blksize -> ffs_blksize, ext2_blksize, or lfs_blksize
   sblksize -> ffs_blksize

These are not the only ambiguously defined filesystem macros, of
course, there's a pile more. I may not have found all the ambiguous
definitions of blksize(), too, as there are a lot of other things
called 'blksize' in the system.
2013-06-19 17:51:25 +00:00
dholland 5a420c1b9a Stick UFS_ in front of these symbols:
DIRBLKSIZ
   DIRECTSIZ
   DIRSIZ
   OLDDIRFMT
   NEWDIRFMT

Part of PR 47909.
2013-06-09 17:57:08 +00:00
christos c06c93b2d6 add a replace flag so we can overlay exiting files when we merge directories. 2013-02-03 06:16:53 +00:00
christos c5e9014781 - more changes to make -O work
- fix err* calls.
2013-02-03 03:21:21 +00:00
christos 2d692a9557 add and document offset. 2013-02-02 20:42:02 +00:00
christos a1bd32a9dc remove bogus err. 2013-02-01 14:02:17 +00:00
christos 7a9c8c6550 while it is studly to play with token pasting, passing directly the type
is a lot more readable.
2013-02-01 14:00:33 +00:00
christos 3cfc43473d macroize to make it more type-safe. 2013-01-31 15:15:15 +00:00
christos 2431e0788b the allow options are 8 bits wide. 2013-01-31 14:56:32 +00:00
christos d84c38ae4e - don't abuse vp->fs to mean struct fs for ffs and struct msdos_opts;
make it always fsinfo_t and change void * to that.
- kill unused structure members.
2013-01-30 19:19:19 +00:00
christos 0ea6b66554 gc global sectorsize. 2013-01-30 17:29:25 +00:00
christos 78e97492c8 buf is generic; it has nothing to do with ffs and will eventually be moved.
gc sectorize.
2013-01-30 17:29:05 +00:00
christos 9eb809c6b4 use "val" not "var" 2013-01-30 02:53:54 +00:00
christos 8459845f55 add missing arguments. 2013-01-29 21:54:19 +00:00
christos aed9f95c54 workaround for gcc/vax 2013-01-29 19:45:47 +00:00
christos 50d02345aa make everything use the generic options parser. 2013-01-29 15:52:25 +00:00
christos 36e6483010 Allow options without values meaning the empty string for string options
and = 1 to numerics.
2013-01-29 14:09:48 +00:00
christos 4f6a0577d9 mention me 2013-01-29 01:52:04 +00:00
christos 2246e723d1 deal with options that don't have a single letter argument. 2013-01-29 01:06:15 +00:00
christos fa62ba2145 handle some of the options by the generic parser. 2013-01-29 01:05:57 +00:00
christos e4989541fe - use emalloc and friends
- kill a bunch of global variables, more work to be done here
- homogenize option parsing. more work for cd9660
- use the new options parsing code to print an fs-specific usage
2013-01-28 21:03:26 +00:00
mlelstv 3b0450ca73 Do not use *bp after freeing it in brelse. 2013-01-28 10:16:35 +00:00
christos 863ded0e2b now that msdos works, document it. 2013-01-28 00:23:18 +00:00
christos 0a54bc86e7 use pcbmap instead of the open coded hack now the pcbmap works. 2013-01-28 00:16:48 +00:00
christos 0e23c760cc don't forget to initialize the cache. 2013-01-28 00:16:24 +00:00
christos a61457fac4 fix recursion error handling. top level directory works. 2013-01-27 22:53:03 +00:00
christos 330e688f74 fix root detection (although the code is a noop) 2013-01-27 22:52:38 +00:00
christos 5f60de37ca - don't forget to set de_pmp
- unexpand inserted tabs to the "." and ".." strings!
2013-01-27 22:52:19 +00:00
christos 180d451863 undo c99 2013-01-27 22:09:24 +00:00
christos 1df38ec62e - some more debugging
- use msdosfs_update() -- should not be needed.
- remove <sys/mount.h>
2013-01-27 22:07:19 +00:00
christos e502c2ffd0 This works well enough to populate plain files in the root dir. creating
directories fails.
2013-01-27 20:05:46 +00:00
christos 14d475a7bf the max msdos file size is less than size_t so don't bother checking against it. 2013-01-27 16:03:15 +00:00
christos 804eae6b82 fixed directory entry allocation. Now the file data remains and is currently
broken.
2013-01-27 15:35:45 +00:00
christos 12188588a0 zero memory 2013-01-27 14:10:22 +00:00
christos 96e132de94 Don't print the pointers in debugging, it is not useful.
zero all memory
2013-01-27 14:10:03 +00:00
christos 7176d59dec fix single letter parsing. 2013-01-27 14:07:12 +00:00
martin c24cac0ff3 Make it compile on 32bit AND 64bit archs. 2013-01-27 12:25:13 +00:00
mbalmer 510ae4bec6 Allow this to compile on 32bit architectures. 2013-01-27 10:07:23 +00:00
christos c1cffbf8b8 depend on TOOLS instead of __NetBSD__ for extra functionality 2013-01-26 16:58:14 +00:00
christos ed8edcd60d make this cross-compile friendly. 2013-01-26 16:50:46 +00:00
christos 980139beab add debugging, fix warnings. 2013-01-26 00:31:49 +00:00
christos 7e2d9be620 add more msdos stuff. 2013-01-26 00:20:40 +00:00
christos 9ac350be41 make the buffer functions look exactly like the kernel ones and add other
cruft to make the kernel files compile.
2013-01-26 00:19:39 +00:00
christos 562664d1e3 - Fix single letter option parsing.
- Instead of returning 1 << index and 0 on error,
  return just index and -1 on error for the set_option*() routines.
2013-01-24 01:10:47 +00:00
christos 273b781b8e ok, we can create the filesystem now. 2013-01-23 22:47:18 +00:00
christos 6981fea57c return the bit of the option set, so that others can act on it. 2013-01-23 21:42:22 +00:00
christos 1c35cd3809 remove duplicated code, and try to cleanup parsing by using the shared code.
cd9660 needs a lot of work.
2013-01-23 21:32:32 +00:00
christos 0b556eae66 don't reuse the same variables 2013-01-23 21:03:15 +00:00
christos 3d364f5471 - add support for parsing different types; not just int.
- add beginning of msdos support.
2013-01-23 20:46:39 +00:00
dholland dcd34a91c5 Stuff UFS_ in front of a few of ufs's symbols to reduce namespace
pollution. Specifically:
   ROOTINO -> UFS_ROOTINO
   WINO -> UFS_WINO
   NXADDR -> UFS_NXADDR
   NDADDR -> UFS_NDADDR
   NIADDR -> UFS_NIADDR
   MAXSYMLINKLEN -> UFS_MAXSYMLINKLEN
   MAXSYMLINKLEN_UFS[12] -> UFS[12]_MAXSYMLINKLEN (for consistency)

Sort out ext2fs's misuse of NDADDR and NIADDR; fortunately, these have
the same values in ext2fs and ffs.

No functional change intended.
2013-01-22 09:39:11 +00:00
joerg 9edf9a0457 Remove many HAVE_GCC || HAVE_PCC conditionals as the options also apply
to Clang. Add a few cases of HAVE_LLVM for -fno-strict-aliasing.
2012-08-10 12:10:27 +00:00
sjg 07f6254fe3 Add -Z to enable sparse files - for ffs at least.
Based on a patch from shesha at juniper.
2012-06-22 06:15:18 +00:00
joerg 17770eb834 usage is dead. name_len should be read as unsigned byte. 2012-04-29 13:32:21 +00:00
dogcow d5de483ef7 As this code is used by tools, and thus needs to be portable,
eliminate all the mucking around for an undocumented, seemingly
unused field and use 0.
2012-04-27 20:58:54 +00:00
adam a92b391e5e Fix building tools 2012-04-20 13:28:27 +00:00
dholland 0a7a01f2e2 Fix build failure reported by bracket.
(shouldn't this size_t be ino_t?)
2012-04-19 19:48:14 +00:00
christos b825b96b8e WARNS=5 2012-04-19 17:28:25 +00:00
christos ad1d2050fc - fix compilation isses
- add some error checking
- avoid alloca
- add missing frees
2012-04-19 17:09:53 +00:00
wiz 78496082c1 New sentence, new line. 2012-04-19 16:00:25 +00:00
ttoth 0751a667c7 added chfs support for makefs 2012-04-19 15:36:06 +00:00
christos bac18f3659 Pull FreeBSD fix from Andreas Tobbler:
- Write the ISO9660 descriptor after the apm partition entries.
- Fill the needed pmPartStatus flags. At least the OpenBIOS
  implementation relies on these flags.

This commit fixes the panic seen on OS-X when inserting a FreeBSD/ppc disc.
Additionally OpenBIOS recognizes the partition where the boot code is located.
This lets us load a FreeBSD/ppc PowerMac kernel inside qemu.
2012-04-02 19:01:21 +00:00
christos f1cc09510d Patch from Jung-uk Kim (jkim at FreeBSD dot org) to allow contents of multiple
directories to be merged to the current image.
2012-01-28 02:35:46 +00:00
christos 4a5d314575 add support for setting the ufs label. (Nathan Whitehorn) 2011-10-09 21:33:43 +00:00
christos 91cc0e5629 more fixes from martin 2011-08-23 19:57:24 +00:00
christos 3e74546ba5 remove stray brace, minor knf 2011-08-23 19:17:07 +00:00
christos 1beaa2ceec PR/45285: Martin Matuska: makefs does not properly convert ISO level 1 and 2
filenames (buffer overflow)

makefs does not properly verify the maximum filename length in the
special "." case for both ISO level 1 and ISO level 2 filename
conversion.  This creates broken images or causes a buffer overflow
(ISO level 2).

ISO level 1:
If a filename contains only dots or up to 8 characters followed by
dots the 8+3 limit check doesn't work.

ISO level 2:
If a filename contains a dot in the first 30 characters and a dot
on the 30th character, the length limit check doesn't work and the
buffer is overflowed.

$ mkdir level1
$ touch level1/12345............
$ makefs -t cd9660 -o isolevel=1 test.iso level1

$ mkdir level2
$ touch level2/1234567890.2345678901234567.....34567890123456789012345
$ makefs -t cd9660 -o isolevel=2 test.iso level2
2011-08-23 17:09:11 +00:00
wiz 8e6d328065 Re-order `usage' alphabetically;
rename option arguments in the manpage's `SYNOPSIS' section to
match those from `usage' (not the other way around; the `usage'-line
(and other parts of makefs.c) contain the correct names);
minor punctuation improvements.

From Snader_LB.
2011-08-15 14:45:01 +00:00
uch 7d18226237 newfs_v7fs(8)'s -v and -P options are obsolete. changed to newfs(8) compatible -V option. 2011-08-10 11:31:49 +00:00
christos b166834bb8 PR/45217: Martin Matuska: Use proper lengths to space pad fields and don't
overwrite them according to the spec.
2011-08-06 23:25:19 +00:00
wiz fc4d0f871a Bump date for previous, fix typo. 2011-07-22 13:04:00 +00:00
joerg 29d01baadc Allow cross-compiling from Linux 2011-07-19 18:29:41 +00:00
tron 12aec09384 Re-enable v7fs support in the tools version of "makefs" after the
issues have been fixed by Alan Barrett. Tested under Mac OS X.
2011-07-18 22:52:37 +00:00
tron d341b47a1c Define "USE_V7FS" in the makefile of the directory with the actual source. 2011-07-18 21:22:55 +00:00