Commit Graph

81 Commits

Author SHA1 Message Date
David E. O'Brien
c69284ca08 Use __FBSDID() to quiet GCC 3.3 warnings. 2003-05-03 18:41:59 +00:00
Yaroslav Tykhiy
29f3f095a6 Don't die of SIGSEGV on a missing fstype field
in a saved disklabel file.

MFC after:	1 week
2003-04-01 14:44:53 +00:00
Ruslan Ermilov
bc33ea1acc Teach disklabel(8) about different hardware architectures.
This is aimed at creating floppies during cross-releases.
For different endianness machines, a tool like bswapfs(8)
is necessary to make the generated floppies readable on
the target machine.  While here, fixed unaligned access
on Alphas.

Tested on:	i386, alpha
2003-03-16 00:11:49 +00:00
Ruslan Ermilov
ef9ab0b32b Deal with vestiges of d_boot[01]. 2003-02-23 01:48:42 +00:00
Poul-Henning Kamp
74c041ac57 If we fail to open O_RDWR, try opening O_RDONLY, if we use ioctls
to fiddle the disk we can get away with it.

Try to use DIOCBSDBB to write boot code.
2003-01-26 21:55:43 +00:00
Poul-Henning Kamp
23e8074bd0 IA64 still needs to be able to run on MBR+BSD combination, so put disklabel
back.

Pointed out by:	peter
2003-01-26 18:33:54 +00:00
Poul-Henning Kamp
8d48318bbb Drop the silly notion that i386 has two bootstrap files now that sys/boot
creates a single file named just "boot".

Apart from the fact that the option "-s" is now gone and that "-b" should
be pointed at /boot/boot instead of /boot/boot1, this patch should be
a no-op.
2003-01-26 14:35:53 +00:00
Poul-Henning Kamp
a9595c8217 Remove #if checks for NUMBOOT==0, it's not relevant for any architecture
and if we get such an architecture, we can just avoid using the relevant
options.
2003-01-26 13:50:11 +00:00
Poul-Henning Kamp
7e3e26cdc1 Offer better advice in #error.
Remove yet a usage message about -N/-W
2003-01-26 12:39:46 +00:00
Poul-Henning Kamp
6250c8c527 Remove ia64 and powerpc #ifdefs: this is i386/pc98/alpha only code. 2003-01-26 12:22:26 +00:00
Poul-Henning Kamp
3874baafd8 Remove #ifdef __sparc64__ code. GEOM uses native SUN labels on this arch,
so no hacks are needed.
2003-01-26 11:43:50 +00:00
Poul-Henning Kamp
80baf8ced8 Fix typo in last commit.
Rearrange bits in writelabel() a bit for improved readability.
2003-01-26 11:41:37 +00:00
Poul-Henning Kamp
5a5469f26a Remember to remove -N and -W from usage. 2003-01-26 11:28:34 +00:00
Poul-Henning Kamp
89fd458f17 Don't fiddle write-protect status of disklabel, it's a discontinued feature. 2003-01-26 11:16:25 +00:00
Poul-Henning Kamp
f080d33b66 Retire the "-N" and "-W" options which implemented write-protection
for the disklabel:  This facility is OBE.

First of all, we cannot sensibly implement this in a properly stacked
environment.

Second, if we did, it would confuse the heck out of users who
wouldn't be able to "start from scratch" by dd(8)'ing /dev/zero
onto /dev/da0.

Third, the offered protection is not comprehensive: no other software
would respect it.

Fourth and finally, the disklabel is already protected against
tampering if it controls open partitions.

Uselessness of these options discussed with:	peter
2003-01-26 11:11:19 +00:00
Dag-Erling Smørgrav
b0459c58c9 Clear part_set, part_size_type and part_offset_type before parsing the
ascii label; otherwise checklabel() might report spurious errors because
of leftovers from a previous pass.

Reviewed by:	bde
MFC after:	1 week
2003-01-16 12:57:53 +00:00
Yoshihiro Takahashi
404a379e4a Rename the dos_partition structure for pc98 to pc98_partition. 2003-01-04 08:50:48 +00:00
Greg Lehey
f2f632579f Relax partition overlap check to allow Vinum partitions to overlap
other partitiosns.  This is necessary when migrating conventional
partitions to Vinum and was broken by recent more stringent overlap
checks.  This is arguably the wrong way to do it.  A better method
would be to have the loader understand a subset of Vinum partitioning
and allow an install directly to Vinum, but until then, this is the
best we have.

Reviewed by:	jhb
Approved by:	re (rwatson)
2002-12-02 23:49:59 +00:00
Julian Elischer
484c780433 Everything in the disklabel is unsigned so make all the input routines
take unsigned values.
his allows one to label disk with the number of blocks > 31 bits
(though less then 32 bits)

e.g.
#        size   offset fstype [fsize bsize bps/cpg]
  c: 3125755904  0   unused    0     0        # (Cyl.    0 - 194569*)
  d: 3125755840  64  unused    0     0        # (Cyl.    0*- 194569*)
which is needd to test UFS2
2002-11-18 04:58:11 +00:00
Yoshihiro Takahashi
6d8c8fabad Fix to support pc98. 2002-10-08 12:13:19 +00:00
Poul-Henning Kamp
0cdbe32937 Don't be noisy if DIOCWLABEL fails, it's probably because we're writing
the first label to the raw disk.

Sponsored by:	DARPA & NAI Labs.
2002-10-05 21:57:05 +00:00
Poul-Henning Kamp
3bb24c35f2 Split MBR and PC98 on-disk sliceformats out from disklabel.h, step 1:
Peter had repocopied sys/disklabel.h to sys/diskpc98.h and sys/diskmbr.h.

These two new copies are still intact copies of disklabel.h and
therefore protected by #ifndef _SYS_DISKLABEL_H_ so #including them
in programs which already include <sys.disklabel.h> is currently a
no-op.

This commit adds a number of such #includes.

Once I have verified that I have fixed all the places which need fixing,
I will commit the updated versions of the three #include files.

Sponsored by:   DARPA & NAI Labs.
2002-10-01 07:24:55 +00:00
Poul-Henning Kamp
b9d05a16f4 Construct new disklabels based on the medias stated parameters in
userland, rather than expect all possible GEOMetries to know about
BSD disklabels.

Sponsored by:	DARPA & NAI Labs
2002-09-20 09:18:31 +00:00
Tom Rhodes
ce66ddb763 s/filesystem/file system/g as discussed on -developers 2002-08-21 18:11:48 +00:00
Bosko Milekic
b35e69503a Fix more breakage due to FSTYPENAMES/DKTYPENAMES split.
Also submitted by: David Wolfskill <david@catwhisker.org>
2002-08-16 16:08:36 +00:00
Mark Murray
c822396536 Apply __FBSDID(); fix local variable(names) that stomp on global
definitions; fix some const strings; fix some signedness issues.
2002-07-03 16:43:11 +00:00
Ian Dowse
09dbd0701c Oops, unbreak parsing of the `type' field in getasciilabel(). I had
changed a `goto' to a `continue' in revision 1.52, but it continued
the wrong loop.

Noticed by:	bde
2002-06-05 08:11:28 +00:00
Alfred Perlstein
448f7629ea correct comment (replace i386 with __i386__) 2002-05-30 07:12:12 +00:00
Ian Dowse
f1a7b7ee8d Fix some serious brain damage in the default block/frag/cpg parameters
that are used if none at all are specified for a partition. Don't
keep replaying the last field if we run out of fields when processing
a line. Use a 8:1 frag:block ratio for both defaults.

More work here is required. I think disklabel should not attempt
to choose default filesystem parameters, and instead let newfs pick
any defaults if required.

PR:		i386/38703
Reported by:	Martin Kraemer <Martin.Kraemer@Fujitsu-Siemens.com>
2002-05-30 01:44:35 +00:00
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