Commit Graph

52 Commits

Author SHA1 Message Date
Ian Dowse
67b46708ef Split out the code for parsing the partition specification lines
into a separate function to avoid some over-long lines.
2002-05-30 01:19:25 +00:00
Benno Rice
87efda010f Spread the word of PowerPC. 2002-05-21 04:25:24 +00:00
Poul-Henning Kamp
77068a7fe2 Retire the bogus uses of the disklabel field d_sbsize and begin to
initialize it to zero so we don't have to have everbody and their
aunt including FFS specific header files.

Sponsored by: DARPA & NAI Labs.
2002-05-12 20:49:41 +00:00
Poul-Henning Kamp
6b0ff5f596 Get us to WARNS=2 with a bit of constification and some printf fiddling.
Pick up the c-partitions magicness from sys/disklabel.h instead
of defining our own magicness for it, remove trivial comment.

Sponsored by: DARPA and NAI Labs.
2002-04-07 10:57:00 +00:00
Poul-Henning Kamp
24ba60e3a7 Nuke a totally pointless optional debug option
Sponsored by: DARPA and NAI Labs.
2002-04-07 10:39:23 +00:00
Poul-Henning Kamp
4805ff9a48 Remove remaining traces of d_boot[01] 2002-04-04 20:22:15 +00:00
Poul-Henning Kamp
95f6bf5d54 Kill only usage of the undocumnted and unuse d_boot[01] fields of
struct disklabel.

Sponsored by:	DARPA & NAI Labs.
2002-04-03 15:46:56 +00:00
Warner Losh
c1fdb43f59 Remove stray register 2002-03-19 18:47:50 +00:00
Warner Losh
326c7cdab5 o remove __P
o Use ANSI function definitions
o const poison
o remove register
2002-03-18 06:17:50 +00:00
David E. O'Brien
fd43aa1c2c Add complete Sparc64 support.
Submitted by:	tmm

Dike out vax support.
2002-03-11 04:41:42 +00:00
David E. O'Brien
90b8f6bab5 * Support the Sparc64.
* Do not default to any particular platform.  Require that we explicitly
  support a particular platform.
2002-03-11 04:20:37 +00:00
Poul-Henning Kamp
5b4455186e A bit of premptive GEOM POLA magic: If we don't get a virgin disklabel
from /dev/food0, then try from /dev/f00d0c, in strange cases this work.
2002-03-03 21:21:45 +00:00
Kris Kennaway
5979df34a6 Silence non-constant format string warnings by marking functions
as __printflike()/__printf0like(), adding const, or adding missing "%s"
format strings, as appropriate.

MFC after:	2 weeks
2001-08-19 08:19:37 +00:00
Brian Somers
7bc6d0158f Fix the type of the NULL arg to execl()
Idea from: Theo de Raadt <deraadt@openbsd.org>
2001-07-09 09:24:06 +00:00
Dima Dorfman
384d80b3b9 Nuke unused variables. 2001-06-24 23:31:07 +00:00
Warner Losh
0b3f09269a Say "add -r" rather than 'use -r' since the former is more correct.
The latter implies to many people that they use only -r, which is
incorrect.
2001-04-24 17:40:54 +00:00
Warner Losh
8d3105e8d4 First attempt to not overflow in disk space calculations. Use off_t
for the size variable used to calculate the size of the partition.
Also use ULL suffix for constants to ensure that we use 64 bit math.
2001-03-05 03:39:57 +00:00
John W. De Boskey
3233afaec7 Allow for easier configuration when using disklabel. A sample
being:

#        size   offset    fstype   [fsize bsize bps/cpg]
  a:   400M        0    4.2BSD     4096 16384    75     # (Cyl.    0 - 812*)
  b:     1G        *      swap
  c:      *        *    unused
  e: 204800        *    4.2BSD
  f:     5g        *    4.2BSD
  g:      *        *    4.2BSD

   These patches are the original work of Randell Jesup, and
I believe Matt Dillon, with additional work by Warner Losh.
Please let me know if I've left someone out.

   Incorporated into this is the fix for PR bin/22727.

   This patchset still has style issues and a possible problem on
large disks. However, it was a agreed to get these committed before
performing major surgery on them.

PR:		bin/22727
Submitted by:	Randell Jesup <rjesup@wgate.com>
2001-02-25 16:47:44 +00:00
Jordan K. Hubbard
ff7d516252 Add support for virgin disklabels
Submitted by:	dillon
2000-10-31 07:07:39 +00:00
Poul-Henning Kamp
fc87418be0 Turn dkcksum() into an __inline function.
Change its type to u_int_16_t.
2000-09-16 13:43:00 +00:00
David E. O'Brien
42d6bd4884 A local WIP snook in rev 1.31.
Noticed by:	bde
2000-04-21 05:40:05 +00:00
David E. O'Brien
43c6c959b9 Found more places where 'r' was being prepended to the device name. 2000-04-20 08:00:29 +00:00
Warner Losh
37736675d1 Add include of errno.h where needed, remove extern int errno where not.
These commits were inspired by a similar commit to netbsd.
2000-04-14 06:15:01 +00:00
David E. O'Brien
09c4216dd5 Don't prepend "r" for the raw device anymore. 2000-04-10 05:54:47 +00:00
Kris Kennaway
aaae3130c9 10 X's for mkstemp(), and don't redefine _PATH_TMP 2000-01-10 09:25:32 +00:00
Bill Fumerola
daf41e696a Remove duplicate declarations for two internal functions.
Remove delcaration for getenv(), we already get it from stdlib.h
1999-09-25 02:23:19 +00:00
Peter Wemm
7f3dea244c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
Bill Fumerola
3b3038a651 Fix a gcc stupidity where it thought a variable was being used uninitialized
Add a case for UNSPEC which is in order by the enum definition, but out of
order alphabetically.
1999-07-21 03:04:36 +00:00
Jordan K. Hubbard
efba76d7ff Look for boot blocks in new default location. 1998-12-17 16:50:10 +00:00
Bruce Evans
cf6ceaf1a4 Oops, don't quite use RAW_PART instead of RAWPARTITION. Use 'a' + RAW_PART
in both places.
1998-10-23 18:57:39 +00:00
Bruce Evans
7de064209a Updated the error message for EXDEV to match recent kernel fixes.
Fixed nearby indentation.

Use RAW_PART instead of RAWPARTITION.
1998-10-17 09:56:32 +00:00
Bruce Evans
21c729c287 Attempt to fix my breakage of the alpha makebootarea() in rev.1.19.
The previous attempt just converted compile time breakage to runtime
breakage.
1998-08-23 07:32:37 +00:00
Gary Palmer
31ae054ece Try to make this compile on both alpha and i386 1998-08-21 23:44:16 +00:00
Bruce Evans
cc18e4cccf Fixed style bugs in previous commit.
Added some comments on #endifs.
1998-08-17 21:13:57 +00:00
Doug Rabson
130cd73a15 Teach disklabel how to install a bootstrap on an alpha with SRM console. 1998-08-17 07:43:54 +00:00
Bruce Evans
6cabb34884 Fixed bugs in `disklabel -R...':
- nonstandard sector sizes didn't work because the sector size in the
  ASCII label was not read before a (default, wrong) sector size was used.
- the exit status was 0 after exiting early due to an invalid ASCII label.

Abort `disklabel -B...' if the secondary bootstrap doesn't fit.
1998-07-25 16:19:10 +00:00
Bruce Evans
e18fb238dc Clear d_boot0 and d_boot1 in the virgin label. These are overlaid by
d_packname in in-core labels, so they are garbage if d_packname is
initialized in the dummy label for the whole disk.  dsopen() will soon
initialize d_packname to "fictitious" if it is not already initialized.

Fixed nearby error handling.  Rev.1.7 apparently confused Perror()
with perror().
1998-07-20 11:34:06 +00:00
Bruce Evans
2a1deaaa04 Fixed printf format errors. 1998-06-28 18:59:04 +00:00
Philippe Charnier
3121d4cbe0 Use warnx()+fprintf() to handle multi-line messages. Correct K&R support and
KNF continuation indent rule.
Requested by: Bruce.
1998-06-08 06:41:47 +00:00
Philippe Charnier
6bd343a92d Add section number to .Xr. Use of .Nm. Typo. Add rcsid. Remove unused
#includes. Use err(3).
1998-06-04 06:49:13 +00:00
Philippe Charnier
bef2080a01 Add Id. Use err(3). Costmetic in usage string. 1997-06-10 11:08:53 +00:00
Warner Losh
8d64695c7c compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-29 03:33:12 +00:00
Warner Losh
722ceb3f84 Use mkstemp rather than mktemp to prevent a small race.
Obtained from: OpenBSD
1997-03-24 05:44:28 +00:00
Bruce Evans
43be698cb6 Moved initialization of defaults for the label for the whole disk from
disklabel(8) to the kernel (dsopen()).  Drivers should initialize the
hardware values (rpm, interleave, skews).  Drivers currently don't do
this, but it usually doesn't matter since rotational position stuff is
normally disabled.
1996-06-17 14:43:54 +00:00
Joerg Wunsch
d70e4e53de Try to preserve the fdisk table in the primary bootstrap, should it
already exist.

Mention the cases where this doesn't work in the BUGS section of the
man page.
1996-02-03 21:14:09 +00:00
Joerg Wunsch
425bed3abf Finally implement the "auto" disktype. It attempts to get all the
required information from the driver, and produce a virgin disklabel
for it.  The latter might be further edited with `disklabel -e' to
satisfy the user's need.

The magic sequence is:

	disklabel -r -w sdX auto
	disklabel -e sdX
1996-01-22 01:01:15 +00:00
Joerg Wunsch
61de51cad6 Declare functions, resolve printf-format warnings. 1996-01-21 23:55:47 +00:00
Rodney W. Grimes
5ebc7e6281 Remove trailing whitespace. 1995-05-30 06:12:45 +00:00
Bruce Evans
f75dd51832 Don't clobber d_secperunit in disklabel -e'. disklabel -e' replaces all
the values that it doesn't print by defaults.  This seems wrong.  I want
to be able to see the total number of sectors more than edit it.  The
default d_secperunit of (sectors/track * tracks/cylinder * cylinders) is
bogus if sectors/track is only an approximation and more bogus if
sectors/track and tracks/cylinder are dummy values such as 4096 and 1
to defeat ufs's pessimizations.
1995-02-22 23:21:29 +00:00
Justin T. Gibbs
ca4693ed4b Allow for the specification of bsize, fsize, and bps (blocks per segment)
for LFS filesystems.
1995-01-04 23:49:51 +00:00