Home | History | Annotate | only in /src/sbin/newfs_msdos
History log of /src/sbin/newfs_msdos
RevisionDateAuthorComments
 1.6 21-Jan-2013  christos Split the make fs portion into a function; do argument tests inside the
function.
 1.5 05-Jun-2009  haad branches: 1.5.6; 1.5.12;
Add support for DIOCGDISKINFO to disk like device drivers. Change
partutil.c::getdiskinfo to use it to get disk geometry info.
Use DIOCGWEDGEINFO ioctl to get information about partition size, if disk
driver doesn't support it use old DIOCGDINFO. This patch adds support for
wedge like devices(lvm logical volumes, ZFS zvol partitions) to newfs and
other tools.

No objections on tech-userlevel@.
 1.4 11-Aug-2008  christos teach this about wedges.
 1.3 10-Sep-2001  christos branches: 1.3.34; 1.3.38;
- Remove old files.
- Port to NetBSD
XXX: *untested*
 1.2 10-Oct-1997  christos CFLAGS->CPPFLAGS
 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.38.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.3.34.1 28-Sep-2008  mjf Sync with HEAD.
 1.5.12.1 25-Feb-2013  tls resync with head
 1.5.6.1 23-Jan-2013  yamt sync with head
 1.3 10-Sep-2001  christos - Remove old files.
- Port to NetBSD
XXX: *untested*
 1.2 09-Jan-1998  perry RCS Id Police.
 1.1 01-Mar-1997  christos 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.2 10-Sep-2001  christos - Remove old files.
- Port to NetBSD
XXX: *untested*
 1.1 01-Mar-1997  christos 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.3 10-Sep-2001  christos - Remove old files.
- Port to NetBSD
XXX: *untested*
 1.2 09-Jan-1998  perry RCS Id Police.
 1.1 01-Mar-1997  christos 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.15 12-Oct-2019  martin When we end up with too few clusters for the requested FAT type after
configuring default values, retry with a smaller cluster size.
This makes the typical invocation to create a spec conformant EFI boot
partition work out of the box.
 1.14 04-Feb-2018  mrg branches: 1.14.4; 1.14.6;
updates for GCC 6.4:

identd has aliasing violations, use -fno-strict-aliasing.

newfs_msdos's getbpbinfo() has missing {} issues.

sysctl's kern_cp_id() has missing {} issues.
 1.13 14-Apr-2017  christos Use the create_size if given to compute the real size instead of stat'ing
the file again, which might have been larger to start with.
 1.12 16-Feb-2017  christos Allow 0 timestamp
 1.11 16-Feb-2017  christos add -T for reproducible builds (used in makefs)
 1.10 03-Apr-2016  mlelstv branches: 1.10.2; 1.10.4;
Use the same defaults for cluster sizes as Windows.
 1.9 05-Jan-2014  martin PR bin/46743: mark the "next free cluster" value in the file system
info block as unitialized.
 1.8 19-Oct-2013  christos fix unused variable warnings.
 1.7 03-Feb-2013  christos branches: 1.7.4;
don't truncate the file if an offset is given.
 1.6 27-Jan-2013  christos nbtool_config.h undefines _NETBSD_SOURCE, and that makes <sys/types.h> not
define cpuid_t, which makes <sys/mount.h> unincludable. Although this is a
bug in the build system, it is simpler to fix it here.
 1.5 24-Jan-2013  christos toolify
 1.4 24-Jan-2013  christos don't do the partition dance for makefs; we have no real disk
 1.3 23-Jan-2013  christos We don't need getdiskinfo() for makefs() since we always deal with an image.
 1.2 23-Jan-2013  christos fix regressions after split.
 1.1 21-Jan-2013  christos branches: 1.1.2;
Split the make fs portion into a function; do argument tests inside the
function.
 1.1.2.3 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.1.2.2 23-Jan-2013  yamt sync with head
 1.1.2.1 21-Jan-2013  yamt file mkfs_msdos.c was added on branch yamt-pagecache on 2013-01-23 00:05:32 +0000
 1.7.4.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.7.4.2 25-Feb-2013  tls resync with head
 1.7.4.1 03-Feb-2013  tls file mkfs_msdos.c was added on branch tls-maxphys on 2013-02-25 00:28:10 +0000
 1.10.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.10.2.2 26-Apr-2017  pgoyette Sync with HEAD
 1.10.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.14.6.1 12-Oct-2019  bouyer Pull up following revision(s) (requested by martin in ticket #303):
sbin/newfs_msdos/mkfs_msdos.c: revision 1.15
When we end up with too few clusters for the requested FAT type after
configuring default values, retry with a smaller cluster size.
This makes the typical invocation to create a spec conformant EFI boot
partition work out of the box.
 1.14.4.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.6 17-Feb-2017  wiz file system police.
 1.5 16-Feb-2017  christos Allow 0 timestamp
 1.4 16-Feb-2017  christos add -T for reproducible builds (used in makefs)
 1.3 16-Oct-2015  christos branches: 1.3.2; 1.3.4;
remove advertising clause.
 1.2 23-Jan-2013  christos branches: 1.2.4;
fix regressions after split.
 1.1 21-Jan-2013  christos branches: 1.1.2;
Split the make fs portion into a function; do argument tests inside the
function.
 1.1.2.3 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.1.2.2 23-Jan-2013  yamt sync with head
 1.1.2.1 21-Jan-2013  yamt file mkfs_msdos.h was added on branch yamt-pagecache on 2013-01-23 00:05:32 +0000
 1.2.4.2 25-Feb-2013  tls resync with head
 1.2.4.1 23-Jan-2013  tls file mkfs_msdos.h was added on branch tls-maxphys on 2013-02-25 00:28:10 +0000
 1.3.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.3.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.24 11-Dec-2020  ryoon Describe after example like other examples
 1.23 17-Feb-2017  wiz file system police.
 1.22 16-Feb-2017  christos add -T for reproducible builds (used in makefs)
 1.21 12-Sep-2016  sevan branches: 1.21.2;
Note the origin of the newfs_msdos command from FreeBSD 3.0.
Replace contraction.
s/filesystem/file system/
Bump date.
 1.20 24-Apr-2014  christos branches: 1.20.6;
Fix volume name (Ed Maste)
 1.19 18-Mar-2014  riastradh branches: 1.19.2;
Merge riastradh-drm2 to HEAD.
 1.18 20-Jul-2013  wiz Use Mt for email addresses.
 1.17 26-Mar-2009  wiz branches: 1.17.6; 1.17.12; 1.17.16;
New sentence, new line.
 1.16 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.15 25-Nov-2006  scw branches: 1.15.28;
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.14 22-Sep-2004  thorpej Change the default volume label from "NO NAME" to "NO_NAME". Note the
default in the manual page.
 1.13 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.12 22-Sep-2004  thorpej Correct some examples, and note when it was first included in NetBSD,
not FreeBSD.
 1.11 24-Apr-2003  wiz branches: 1.11.2;
Bump date for last.
 1.10 21-Apr-2003  dbj add a SIGINFO handler progress indicator
 1.9 01-Oct-2002  wiz New sentence, new line. By Robert Elz with minimal fixes.
 1.8 16-Nov-2001  wiz Sort sections.
 1.7 10-Sep-2001  christos - Remove old files.
- Port to NetBSD
XXX: *untested*
 1.6 10-Mar-1999  erh Add missing .El line.
 1.5 22-May-1998  msaitoh sort entries and delete extra periods in SEE also section.
 1.4 29-Apr-1998  fair fix bad .Xr references
 1.3 06-Feb-1998  perry macroize BSD, NetBSD, FreeBSD and misc cleanup
 1.2 12-Mar-1997  christos Fix PR/3322, reference to non existant program.
 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.11.2.3 23-Sep-2004  jmc Pullup rev 1.14 (requested by thorpej in ticket #870)

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

Default the OEM ID to "NetBSD" rather than "BSD 4.4".
 1.11.2.1 23-Sep-2004  jmc Pullup rev 1.12 (requested by thorpej in ticket #868)

Correct some examples, and note when it was first included
 1.15.28.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.17.16.1 23-Jul-2013  riastradh sync with HEAD
 1.17.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.17.6.1 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.19.2.1 10-Aug-2014  tls Rebase.
 1.20.6.1 20-Mar-2017  pgoyette Sync with HEAD
 1.21.2.1 21-Apr-2017  bouyer Sync with HEAD
 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