Commit Graph

77 Commits

Author SHA1 Message Date
iedowse
11b6d7a2f9 Oops, the arguments to a bcopy() were reversed, which broke zeroing
of unused partition entries and later detection of unused entries.

Use memcpy to be consistent with the rest of the code, and fix a
minor style nit.

Submitted by:	bde
2001-12-30 18:51:51 +00:00
obrien
a537f22ad4 Default to WARNS=2.
Binary builds that cannot handle this must explicitly set WARNS=0.

Reviewed by:	mike
2001-12-04 02:19:58 +00:00
bde
b63dcab67a Fixed spelling error in previous commit. 2001-10-16 10:52:12 +00:00
peter
0d89562da3 Add 0xEE (EFI GPT) and 0xEF (EFI System Partition) 2001-10-15 07:21:32 +00:00
ru
9174553bc8 mdoc(7) police: protect trailing full stops of abbreviations
with a trailing zero-width space: `e.g.\&'.
2001-08-10 13:45:36 +00:00
iedowse
26c5a09843 Fix a number of bugs and annoyances in fdisk, many of which were
pointed out by bde:
- Ask for user confirmation before adjusting to a head/cylinder
  boundary (only when running interactively), and separate this
  adjustment from the automatic calculation of c/h/s parameters.
- In sanitize_partition, don't change any values in the slice until
  we know that the automatic adjustment will succeed.
- When auto-adjusting, ignore unused slices and give an appropriate
  error for other zero-size slices depending on the cause.
- Change dos() to do all of the c/h/s calculations for a whole slice;
  this fixes a bug where the ending c/h/s of an unused slice was set
  incorrectly.
- When changing the active slice, detect the currently active slice
  number instead of always defaulting to slice 4.
- Call fflush(stdout) before calling fgets().
- Test for fgets() returning NULL so we don't loop on EOF.

Reviewed by:	bde
2001-08-05 16:24:13 +00:00
ru
ddabf11b6c fdisk(8): document the default for -b, add xref to boot0cfg(8).
boot0cfg(8): add FILES section.

Reviewed by:	rnordier
2001-07-18 07:12:46 +00:00
dd
c49a4e6620 Remove whitespace at EOL. 2001-07-15 07:53:42 +00:00
joerg
0ea96353a1 After some (long-standing ;-) critics from Bruce, throw away the old
device search code i introduce nearly six years ago in rev 1.8.  Bruce
suggested to rather use the device name of the root filesystem instead
which is certainly the most sensible default.  Since there are many
possible cases for a root filesystem name (device with and without
slices, consider /dev/vinum/root even though it currently could not
work as such), there's some heuristic using a RE in order to find out
the canonical device name from the mounted name.  This probably won't
quite fit for a NFS root (can't test that right now), but then,
there's hard to find a good default for those machines anyway. ;-)

This unbreaks the functionality of rev 1.2 i once broke in 1.8. :)
2001-07-13 16:48:56 +00:00
ru
cb3283b5da mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 11:04:34 +00:00
joerg
f130aa75e1 Make open_disk() fail nicely upon encountering an ENOENT so to not
prematurely terminate the search for a usable disk.  ENOENT is quite
normal in particulare now with the advent of devfs.

While being here, also remove /dev/wd0 and /dev/od0 from the list of
disks to search since we don't have them anymore.

MFC after:	1 week
2001-07-05 10:04:43 +00:00
dd
1279b0d7b0 wd0 -> ad0
PR:		26343
Submitted by:	Sergey A. Osokin <osa@FreeBSD.org.ru>
2001-04-08 18:41:22 +00:00
ru
e7c03cd6b0 - Backout botched attempt to introduce MANSECT feature.
- MAN[1-9] -> MAN.
2001-03-26 14:33:27 +00:00
ru
e2a472a47a Set the default manual section for sbin/ to 8. 2001-03-20 18:13:31 +00:00
ru
0b7f07b8e5 Eliminate mdocNG warnings caused by misplaced or extraneous macro calls. 2001-02-28 17:38:53 +00:00
ru
b1c3961564 mdoc(7) police: split punctuation characters + misc fixes. 2001-02-01 16:38:02 +00:00
ru
57f7a8db57 Prepare for mdoc(7)NG. 2000-12-18 15:16:24 +00:00
ru
cfafe5cee1 mdoc(7) police: added missing .Os call. 2000-12-14 13:58:15 +00:00
obrien
7d6ef47ce2 I didn't maintain the "chs" ordering. Rather the bug was in print_part().
Requested by:	bde.
2000-11-29 20:22:47 +00:00
ru
d16dd614f6 mdoc(7) police: use the new features of the Nm macro. 2000-11-20 16:52:27 +00:00
obrien
86ad942d23 Make the order of values prompted for with the "-i" option match print_part() 2000-11-18 02:55:43 +00:00
ru
b42832df66 Use Fx macro wherever possible. 2000-11-14 11:20:58 +00:00
ru
f9c7198049 Avoid use of direct troff requests in mdoc(7) manual pages. 2000-11-10 17:46:15 +00:00
jhb
8c486423e9 - When adjusting the end of a partition to lie on a cylinder boundary, don't
adjust the size, but the actual end.
- Break out some of the sanity checks on partitions into a sanitize_partition
  function.
- When adjusting partitions, always adjust the start "up", and the end "down"
  so that we stay within the boundaries of the original request.
- Various small nits found by bde.

Reported by:	bde, imp, rgrimes
2000-08-24 17:54:45 +00:00
joe
eda93612c8 0xA0 = Suspend to disk. 2000-08-07 00:26:09 +00:00
jhb
34f2661b23 Fix a really stupid bug where I assumed sizeof(int) == 2. This resulted in
MBR's with a 4th slice failing the signature check and fdisk saying that
they are invalid.

Submitted by:	bde
2000-07-21 18:26:20 +00:00
jhb
4de0ef3645 - Don't try to free mboot.bootinst before it has been allocated. If, for
some reason, mboot.bootinst is not initialized to NULL at the beginning
  of the program, then the last commit to this would try to free whatever
  bogus address is in it.
- Restore the behavior of free()'ing the mboot.bootinst buffer after we
  abuse it to determine the sector size of the disk (as clearly noted in
  the comments).  Properly fix the double free() bug by setting the pointer
  to NULL after we free it.
2000-07-17 19:51:42 +00:00
ache
5600097b04 Fix memory leak/double free found by phkmalloc
Uniform mboot.bootinst allocation code to be independent of functions order
2000-07-15 13:37:47 +00:00
jhb
ed9eceabe1 - Always respect cylinder boundaries when creating slices unless the user
explicitly sets the geometry.
- Allow for MBR boot loaders that are longer than one sector.  Only accept
  boot loaders if their size is a multiple of the sector size, however.
2000-07-12 16:45:11 +00:00
jhb
79fd4fc731 Catch the usage() function up to the command line changes. Add -I and
remove -e.
2000-06-27 20:36:44 +00:00
brian
a9d7cf3973 0x39 == plan9
Obtained from: OpenBSD
2000-06-12 09:08:40 +00:00
ghelmer
78cd9f5921 Add QNX 4 partitions to fdisk's list.
PR:		bin/8809
Submitted by:	"John C. Place" <jcplace@ibm.net>
Prompted by:	<nrahlstr@winternet.com>
2000-06-09 19:10:09 +00:00
msmith
aa722fef82 Don't try to open the /dev/rXXX device. 2000-05-31 00:58:55 +00:00
sheldonh
ff87a2cf4e Fix nits in previous commit: restore option ordering of the option
description list; break an overly long line; use the Fx macro instead
of "FreeBSD".
2000-03-13 10:55:21 +00:00
imp
988690c1ca -e -> -I change.
-s for sumary

Approved by:	jkh
2000-03-10 22:03:00 +00:00
obrien
e3ea6df344 Don't use the old raw name for disk devices. 2000-03-09 19:35:32 +00:00
ru
dbe20466fd Add ata(4) support.
Approved by:	jkh
2000-02-11 11:25:23 +00:00
billf
a75e6c6086 Stuff a variable declaration inside a #if block that is only used for that
#if.
1999-09-25 02:11:30 +00:00
peter
e226894fa0 $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
dwhite
e54c2d32e3 Add -e option to usage(). 1999-08-25 21:31:08 +00:00
phk
11e85b40e9 Add new option to fdisk: -e
This wipes the MBR and creates slice 1 as a FreeBSD slice covering the
disk starting from the second track to the cylinder aligned end of the disk.

This is the most compatibly layout we have as far as I know.
1999-08-23 11:06:19 +00:00
rnordier
bdc98c3998 Drop the embedded boot code in favour of a -B option which reads
the boot code from /boot/mbr, or elsewhere as defined by the revised
"-b bootcode" option; use getopt(3); clarify usage(); partially
revise man page; etc.
1999-06-27 19:29:15 +00:00
rnordier
20e427787e Note that a standard MBR supports booting only from hard drive 0 1999-03-13 01:40:57 +00:00
rnordier
d9e299cef5 Add a -b option as a simple way to rewrite the mbr code
(eg. replacing a boot manager with a standard mbr)
1999-01-22 11:54:17 +00:00
joerg
9a40a59d01 sd0 -> da0 1998-11-26 12:24:35 +00:00
alex
3434b3a517 Add an entry for the new NetBSD partition id. 1998-11-06 03:43:21 +00:00
jkoshy
39c9b4b99e Add an entry for BSD/OS [23].x partition types.
I don't have access to a BSD/OS machine to check the veracity of the
magic number.  However, no harm will be done by the commit and since
someone was motivated enough to file a PR, I'm committing the change.

PR:		7629
Submitted by:	Jos Backus <jbackus@plex.nl>
1998-11-06 03:25:56 +00:00
obrien
cb5a1c6181 Linux swap and Solaris x86 use the same BIOS partition id. 1998-09-16 19:25:47 +00:00
charnier
9678b00955 Correct use of .Nm, use .Bx Free for FreeBSD. Add rcsid, remove unused
#includes. Spelling. Use err(3) and add usage().
1998-07-06 06:44:36 +00:00
bde
86649af7cb Fixed printf format errors. 1998-06-28 20:48:03 +00:00