Commit Graph

45 Commits

Author SHA1 Message Date
christos 285cf56905 Allow 0 timestamp 2017-02-16 22:42:25 +00:00
christos 297234680c add -T for reproducible builds (used in makefs) 2017-02-16 18:49:31 +00:00
abs b46e0d1534 newfs_msdos allowed suffixes such as 'k', 'm' for some parameters,
but amusingly this did not include Block size, or Sectors per cluster.
Allow for all numeric parameters (If I want to specify the number
of drive heads as '1K', then why not?)
2015-04-23 13:27:14 +00:00
christos 30441591f7 fix regressions after split. 2013-01-23 15:29:15 +00:00
christos aed35c482d Split the make fs portion into a function; do argument tests inside the
function.
2013-01-21 20:28:38 +00:00
jakllsch 913c04e5ec There are two problems with insisting the FAT file system size be a multiple
of track-size units:  2) the FAT metadata areas may not be a multiple of a
"track", 1) the partition may not be track-aligned to begin with, 0) what's
a "track"? is it something a robot rover leaves on Mars?
2012-12-15 04:34:36 +00:00
jakllsch b7565c8f0e According to current file(1) magic definitions an unlabeled FAT is
denoted with "NO NAME" rather than "NO_NAME".
2012-11-04 14:27:15 +00:00
jakllsch 1423b85c62 Use correct values for minimum and maximum cluster counts for the various FAT
types.  These values come from a publically-avaliable document of an
infallible source that must not be named due to a violation of the document's
license restrictions.  This is justified by interoperability concerns.
2012-07-31 13:52:44 +00:00
jakllsch 1f2df78806 constify opts[] 2012-07-04 18:35:58 +00:00
joerg baa8e84b6f Use __dead 2011-08-29 14:34:58 +00:00
pooka d69295fda4 Set errno to 0 before strtoll() so that it can reliably be tested
afterwards.  Fixes newfs_msdos at least on sparc.  Incidentally,
the msdosfs tests also start working on sparc, which about halves
the number of test failures on that platform.
2011-03-05 13:47:43 +00:00
lukem a2b5923e3e fix sign-compare issues 2009-04-11 06:59:18 +00:00
he cfbede5668 Add a cast to intmax_t and use %jd to print an off_t.
Fixes at least the alpha and amd64 builds.
2009-03-28 21:34:33 +00:00
pooka 4ff44dd1fe remove troublesome printf specifier 2009-03-28 15:17:16 +00:00
pooka 32852ecef0 Apply revisions 1.23 and 1.24 from FreeBSD to autocalculate the
necessary geometry when creating a file system directly to a file.

In addition, when creating, do not complain about the file not
being char special and do not try to execute device ioctl's on it.
2009-03-26 08:39:24 +00:00
christos 5dae591c0c Use the wedge size, not the disk size, from Yorick Hardy 2009-02-17 00:16:35 +00:00
mrg 5be383f77e Do not erroneously leave a truncated 16-bit sector
count on "large" (>=32MB) file systems when fetching the geometry from
the medium.  This confuses some software (which is to say Windows)
when a device newfs(8)ed under NetBSD is transported to another
system.  (Note: The rest of the code uses 'bsec', and DTRT for smaller
file systems.)

contributed anonymously.
2009-01-18 10:50:56 +00:00
jmcneill a2f8108745 The kernel now accepts BPB with heads > 255, so don't limit the number
of drive heads.
2008-12-26 04:23:17 +00:00
christos b6f6f7a746 teach this about wedges. 2008-08-11 10:56:54 +00:00
drochner 628f1591c1 include <signal.h> where signal(3) is used 2007-02-08 21:36:58 +00:00
cbiere 551466a6e7 Avoid crash if the filename contains no digits. 2007-01-21 20:45:41 +00:00
scw 258fa36dc2 Don't use negative offsets from "bpb.bps" when writing out values such
as DOSMAGIC in the MBR. In non-512 byte media, the MBR is still 512
bytes in length.

Based on the patches provided in PR kern/17398 by Trevin Beattie.
2006-11-25 12:29:33 +00:00
christos 851ac27d44 c99 initializers 2006-10-16 03:25:21 +00:00
christos c5acbf4d6b Coverity CID 3788: comment out impossible code. 2006-09-27 18:52:11 +00:00
christos 7d40b7b07f Coverity CID 830: Fix dead code issue 2006-05-25 15:32:17 +00:00
christos e73d73289c Coverity CID 3287: Comment out dead code. 2006-05-23 01:03:16 +00:00
tsutsui 0eb69997b3 Add a tweak to default value settings for a number of drive heads
and a number of sectors per track.

According to sys/fs/msdosfs/msdosfs_vfsops.c:msdosfs_mountfs(),
the kernel doesn't accept BPB with spt (sector per track) > 63
or hds (drive heads) > 255, so if values taken from disklabel
don't match these restrictions, use popular BIOS default values
(255/63) instead.
2005-04-16 14:40:36 +00:00
dsl 9ab983c04a Add (unsigned char) cast to ctype function 2004-10-29 19:04:39 +00:00
thorpej 6e82649d8e Change the default volume label from "NO NAME" to "NO_NAME". Note the
default in the manual page.
2004-09-22 23:52:38 +00:00
thorpej 3af81aff5a Default the OEM ID to "NetBSD" rather than "BSD 4.4". (Geez, did 4.4BSD
even have a newfs_msdos command?)
2004-09-22 23:46:38 +00:00
christos 6bd1d6d4db Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
2004-04-21 01:05:31 +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 c93539067a Determine the MBR partition type relevant for the resulting partition,
and display that.
2003-11-23 23:16:40 +00:00
lukem 04a16dcc66 add some more detail to an error message 2003-10-08 03:56:21 +00:00
itojun 658b0219c1 snprintf 2003-07-13 07:38:12 +00:00
dbj 2e6348f3d8 add a SIGINFO handler progress indicator 2003-04-21 07:58:55 +00:00
toshii 04f91a6594 Uncomment-out part of FreeBSD code so that we can calculate partition
index from a filename.
2001-09-17 16:26:56 +00:00
pooka db8658a3b8 * expand device name to raw device, not block device (eg. wd0a -> /dev/rwd0a)
* #ifdef non-relevant FreeBSD slice consistency check
2001-09-10 19:25:35 +00:00
christos de3ce7e7b1 - Remove old files.
- Port to NetBSD
XXX: *untested*
2001-09-10 18:27:41 +00:00
cgd 8a986b2e96 convert to use getprogname() 2001-02-19 22:48:57 +00:00
christos df49c4a876 fix nested extern 2001-02-04 21:53:39 +00:00
cgd 6b8e92147e after determining the size of a file being used as a msdosfs, seek back to
its start so subsequent writes go to the right places.
1999-07-26 00:28:57 +00:00
drochner 7a262cc07e make it compile again after msdosfs changes 1997-10-17 17:47:41 +00:00
lukem 8dee301bb9 * cleanup for WARNS=1 1997-09-15 06:31:54 +00:00
christos d5fff03ed1 From FreeBSD's mkdosfs:
- KNF
	- cleaned up a few typos.
	- use the msdosfs header files.
	- separated Makefile and Makefile.boot, since we cannot build
	  bootcode.h (yet)
ToDo:
	- Make it work on hard disks; only works on floppies
	- Make it accept an msdos.sys io.sys and a command.com, to make
	  a real dos bootable disk.
1997-03-01 19:42:54 +00:00