Home | History | Annotate | Download | only in newfs_msdos
History log of /src/sbin/newfs_msdos/newfs_msdos.c
RevisionDateAuthorComments
 1.45  16-Feb-2017  christos Allow 0 timestamp
 1.44  16-Feb-2017  christos add -T for reproducible builds (used in makefs)
 1.43  23-Apr-2015  abs branches: 1.43.2; 1.43.4;
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?)
 1.42  23-Jan-2013  christos fix regressions after split.
 1.41  21-Jan-2013  christos Split the make fs portion into a function; do argument tests inside the
function.
 1.40  15-Dec-2012  jakllsch 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?
 1.39  04-Nov-2012  jakllsch According to current file(1) magic definitions an unlabeled FAT is
denoted with "NO NAME" rather than "NO_NAME".
 1.38  31-Jul-2012  jakllsch branches: 1.38.2;
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.
 1.37  04-Jul-2012  jakllsch constify opts[]
 1.36  29-Aug-2011  joerg branches: 1.36.2;
Use __dead
 1.35  05-Mar-2011  pooka 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.
 1.34  11-Apr-2009  lukem fix sign-compare issues
 1.33  28-Mar-2009  he Add a cast to intmax_t and use %jd to print an off_t.
Fixes at least the alpha and amd64 builds.
 1.32  28-Mar-2009  pooka remove troublesome printf specifier
 1.31  26-Mar-2009  pooka 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.
 1.30  17-Feb-2009  christos Use the wedge size, not the disk size, from Yorick Hardy
 1.29  18-Jan-2009  mrg branches: 1.29.2;
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.
 1.28  26-Dec-2008  jmcneill The kernel now accepts BPB with heads > 255, so don't limit the number
of drive heads.
 1.27  11-Aug-2008  christos branches: 1.27.2;
teach this about wedges.
 1.26  08-Feb-2007  drochner branches: 1.26.12; 1.26.16;
include <signal.h> where signal(3) is used
 1.25  21-Jan-2007  cbiere Avoid crash if the filename contains no digits.
 1.24  25-Nov-2006  scw 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.
 1.23  16-Oct-2006  christos c99 initializers
 1.22  27-Sep-2006  christos Coverity CID 3788: comment out impossible code.
 1.21  25-May-2006  christos Coverity CID 830: Fix dead code issue
 1.20  23-May-2006  christos Coverity CID 3287: Comment out dead code.
 1.19  16-Apr-2005  tsutsui 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.
 1.18  29-Oct-2004  dsl branches: 1.18.2;
Add (unsigned char) cast to ctype function
 1.17  22-Sep-2004  thorpej Change the default volume label from "NO NAME" to "NO_NAME". Note the
default in the manual page.
 1.16  22-Sep-2004  thorpej Default the OEM ID to "NetBSD" rather than "BSD 4.4". (Geez, did 4.4BSD
even have a newfs_msdos command?)
 1.15  21-Apr-2004  christos Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
 1.14  05-Jan-2004  jmmv branches: 1.14.2;
Homogenize usage messages: make the 'usage' word all lowercase, as this seems
to be the most common practice in our tree.
 1.13  23-Nov-2003  lukem Determine the MBR partition type relevant for the resulting partition,
and display that.
 1.12  08-Oct-2003  lukem add some more detail to an error message
 1.11  13-Jul-2003  itojun snprintf
 1.10  21-Apr-2003  dbj add a SIGINFO handler progress indicator
 1.9  17-Sep-2001  toshii Uncomment-out part of FreeBSD code so that we can calculate partition
index from a filename.
 1.8  10-Sep-2001  pooka * expand device name to raw device, not block device (eg. wd0a -> /dev/rwd0a)
* #ifdef non-relevant FreeBSD slice consistency check
 1.7  10-Sep-2001  christos - Remove old files.
- Port to NetBSD
XXX: *untested*
 1.6  19-Feb-2001  cgd convert to use getprogname()
 1.5  04-Feb-2001  christos fix nested extern
 1.4  26-Jul-1999  cgd 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.
 1.3  17-Oct-1997  drochner branches: 1.3.4;
make it compile again after msdosfs changes
 1.2  15-Sep-1997  lukem * cleanup for WARNS=1
 1.1  01-Mar-1997  christos branches: 1.1.1;
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.
 1.1.1.1  10-Sep-2001  christos Import FreeBSD's newfs_msdos
 1.3.4.1  20-Aug-1999  cgd pull up rev 1.4 from trunk (cgd)
 1.14.2.2  23-Sep-2004  jmc Pullup rev 1.17 (requested by thorpej in ticket #870)

Change the default volume label from "NO NAME" to "NO_NAME".
 1.14.2.1  23-Sep-2004  jmc Pullup rev 1.16 (requested by thorpej in ticket #869)

Default the OEM ID to "NetBSD" rather than "BSD 4.4".
 1.18.2.1  01-May-2005  tron Pull up revision 1.19 (requested by tsutsui in ticket #230):
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.
 1.26.16.1  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.26.12.2  17-Jan-2009  mjf Sync with HEAD.
 1.26.12.1  28-Sep-2008  mjf Sync with HEAD.
 1.27.2.3  27-Nov-2009  sborrill Pull up the following revisions(s) (requested by tsutsui in ticket #1163):
sbin/newfs_msdos/newfs_msdos.c: revision 1.30

Make fs size detection get proper size rather than disk size.
Without this, newfs_msdos(8) assumes the target fs size is
whole disk size, so newfs_msdos(8) will fail or create wrong fs.
 1.27.2.2  02-Feb-2009  snj branches: 1.27.2.2.2; 1.27.2.2.4;
Pull up following revision(s) (requested by mrg in ticket #389):
sbin/newfs_msdos/newfs_msdos.c: revision 1.29
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.
 1.27.2.1  22-Jan-2009  snj Pull up following revision(s) (requested by jmcneill in ticket #285):
sbin/newfs_msdos/newfs_msdos.c: revision 1.28
The kernel now accepts BPB with heads > 255, so don't limit the number
of drive heads.
 1.27.2.2.4.1  21-Apr-2010  matt sync to netbsd-5
 1.27.2.2.2.1  27-Nov-2009  sborrill Pull up the following revisions(s) (requested by tsutsui in ticket #1163):
sbin/newfs_msdos/newfs_msdos.c: revision 1.30

Make fs size detection get proper size rather than disk size.
Without this, newfs_msdos(8) assumes the target fs size is
whole disk size, so newfs_msdos(8) will fail or create wrong fs.
 1.29.2.1  13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.36.2.4  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.36.2.3  23-Jan-2013  yamt sync with head
 1.36.2.2  16-Jan-2013  yamt sync with (a bit old) head
 1.36.2.1  30-Oct-2012  yamt sync with head
 1.38.2.2  25-Feb-2013  tls resync with head
 1.38.2.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.43.4.1  21-Apr-2017  bouyer Sync with HEAD
 1.43.2.1  20-Mar-2017  pgoyette Sync with HEAD

RSS XML Feed