History log of /freebsd-10.0-release/sbin/bsdlabel/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


255977 01-Oct-2013 pluknet

Sweep man pages replacing ad -> ada.

Approved by: re (blackend)
MFC after: 1 week
X-MFC note: stable/9 only


234122 11-Apr-2012 ae

It seems that libdisk(3) incorrectly sets d_secperunit value.
Automatically fix it like GEOM_PART_BSD does.

MFC after: 1 week


231564 12-Feb-2012 ed

Globally replace u_int*_t from (non-contributed) man pages.

The reasoning behind this, is that if we are consistent in our
documentation about the uint*_t stuff, people will be less tempted to
write new code that uses the non-standard types.

I am not going to bump the man page dates, as these changes can be
considered style nits. The meaning of the man pages is unaffected.

MFC after: 1 month


229778 07-Jan-2012 uqs

Spelling fixes for sbin/


229403 03-Jan-2012 ed

Replace index() and rindex() calls with strchr() and strrchr().

The index() and rindex() functions were marked LEGACY in the 2001
revision of POSIX and were subsequently removed from the 2008 revision.
The strchr() and strrchr() functions are part of the C standard.

This makes the source code a lot more consistent, as most of these C
files also call into other str*() routines. In fact, about a dozen
already perform strchr() calls.


229049 31-Dec-2011 sobomax

Use in-label sectorsize to determine position of the label when
writing label into a file image. The most common use - putting disklabel
into ISO file. Before this change the label would always go to
the offset 512, while geom_part code expects it to be in the 1st
sector (i.e. 2048 incase of ISO). BSD disklabels provide good and
lightweight way to logically split livecds. It is non-intrusive as
far as ISO9660 goes (both boot-wise and metadata-wise) and
completely transparent to anything but BSD, so you can have
BSD-specific area appended after regular ISO.

And with a little bit of GEOM trickery you can do even more
interesting stuff with it.

For example we make "hybrid" bootable CDs using this method.
We create bootable ISO with kernel and such and append UFS
image compressed with UZIP and it works like a charm. We put
label based on the offsef of the BSD part into the ISO. The kernel
boots off normal ISO9660 part, tastes label attaches it,
tastes UZIP, attaches it and finally mounts UFS using GEOM_LABEL.
This provides much better way of eliminating waste than doing
"crunched" build.

MFC after: 1 month


228417 11-Dec-2011 ed

Add missing static keyword.

All global variables and functions are marked static. Simply because
this is an enum, doesn't mean we can't do so as well.


227296 07-Nov-2011 ae

Fix multi-line comment formatting.

MFC after: 2 weeks


227270 06-Nov-2011 ae

Add recommendation to use gpart(8) when user tries write disklabel
or bootcode to already opened provider.

MFC after: 1 week


227262 06-Nov-2011 ae

Remove unneeded checks.

MFC after: 1 week


227248 06-Nov-2011 ae

bsdlabel(8) could automatically fill many of disklabel's deprecated
fields, but user could specify some of those fields when edits disklabel
with `bsdlabel -e`. But without -A flag these fields might be
overwritten with default values from the virgin disklabel.
So, don't overwrite such fields if they are not zero. Also add checks
to prevent creating disklabel with less than DEFPARTITIONS and more
than MAXPARTITIONS partitions.

PR: bin/162332
Tested by: Eugene Grosbein
MFC after: 1 week


227231 06-Nov-2011 ae

To be in sync with GEOM_PART_BSD limit the maximum number of supported
partitions to 20.

MFC after: 1 week


219449 10-Mar-2011 uqs

Widen fields that display partition offset/length.

This makes partitions between 50GiB and 2TiB (16TiB for 4k drives) print
correctly aligned.

While here, fix type of secsize. g_sectorsize() returns ssize_t, don't
store this in an unsigned var. Bump WARNS to 6.

MFC after: 4 weeks


219448 10-Mar-2011 uqs

Remove dead code in bsdlabel depending on __alpha__


219447 10-Mar-2011 uqs

Remove bsdlabel test-script that was full of broken assumptions.

- the default label now includes an a: partition by default
- the c: partition is no longer exported via devfs
- writing of the labels usually works in all cases, though the script
assumes half of them have to fail


219446 10-Mar-2011 uqs

Remove bsdlabel.5, which hasn't been installed in over 7 years
and contains little more than an out-dated copy of <sys/disklabel.h>


216095 01-Dec-2010 kevlo

Closing file descriptors when it's done


215704 22-Nov-2010 brucec

Fix some more warnings found by clang.


211873 27-Aug-2010 jh

Don't attempt to write label with GEOM_BSD based method if the class is
not available. This improves error reporting when bsdlabel(8) is unable
to open a device for writing. If GEOM_BSD was unavailable, only a rather
obscure error message "Class not found" was printed.

PR: bin/58390
Reviewed by: ae
Discussed with: marcel
MFC after: 1 month


211725 23-Aug-2010 imp

MFtbemd:

Prefer MACHNE_CPUARCH to MACHINE_ARCH in most contexts where you want
to test of all the CPUs of a given family conform.


211342 15-Aug-2010 jh

- Check that strtoul(3) succeeds to convert the entire string in a few
places.
- In getasciilabel(), set the disk type only when a valid type is given.

PR: bin/86765
MFC after: 2 weeks


209614 30-Jun-2010 jh

- Don't assign the return value from read(2) to a variable of type
int.
- Use errx(3) instead of err(3) to print the error message on short
reads in readlabel(). errno won't be set on short reads which can
easily occur here due to the fixed size read request.

PR: 144307
Reviewed by: bde


208132 16-May-2010 kevlo

Use setresuid/setresgid to drop privileges


198236 19-Oct-2009 ru

Switch the default WARNS level for sbin/ to 6.

Submitted by: Ulrich Spörlein


196383 19-Aug-2009 marcel

Remove the dependency on the kernel -- in particular the gctl request to
the GEOM_BSD class -- to translate the absolute offsets in the label to
relative ones. This makes bslabel(8) work correctly with GEOM_PART and
also when the BSD label is nested under arbitrary partitioning schemes.

Inspired by: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
Approved by: re (kib)


184672 05-Nov-2008 maxim

o One more s/gpt/gpart/.


184671 05-Nov-2008 maxim

o Replace Xr to gpt(8) which is gone by gpart(8).


183496 30-Sep-2008 lulf

- A call to close(2) might overwrite errno and thus give a wrong error message
on g_providername failure.

Suggested by: pjd
Approved by: pjd (mentor)


183487 30-Sep-2008 lulf

- Improve error message given on g_providername call failure.
- While there, make error messages consistent with the rest.

Approved by: kib (mentor)


183296 23-Sep-2008 ru

Add missing library dependencies.

PR: bin/127573
Submitted by: Eygene Ryabinkin


183143 18-Sep-2008 lulf

- Make bsdlabel use libgeom to determine provider name, device path, the media
size and the sector size.
- Fix a bug where bsdlabel would try to read a regular file using the geom_bsd
class.

Quick review by: phk
Approved by: pjd (mentor)


177517 23-Mar-2008 rodrigc

Remove comment about "-r" flag from readlabel. "-r" is a no-op.
The is comment is left over from the old disklabel command.

Reviewed by: phk


174501 09-Dec-2007 marcel

Allow bsdlabel to operate on labels that have at most 26 partitions
by virtue of there not being any (lower-case) letters avaliable for
more partitions.


174467 08-Dec-2007 remko

Remove redundant whitespace.

Noticed by: brueffer


174449 08-Dec-2007 remko

Attempt to describe the ''auto'' type a bit better in the default
section (if nothing had been specified, or if the auto type had
been specified, a default layout is used).

PR: docs/116047
Submitted by: Ian Smith <smithi at nimnet dot asn dot au>
Minor modifications by me.


165639 29-Dec-2006 ru

- Fix markup.

- Somewhat improve wording.

- Change the layout of the EXAMPLES section so that descriptions
come before example, as in most other manpages.

- Fix a bad example that edits a label using a `c' partition.


163539 20-Oct-2006 maxim

o '-s' flag was killed in rev. 1.75. Clean getopt(3).

PR: bin/104616
Submitted by: Oliver Fromme
MFC after: 1 week


163312 13-Oct-2006 ru

- Don't mention (wrong) defaults for FFS file system parameters,
replace them with references to newfs(8) which documents them.

- Remove mentions of LFS support for which was retired in 1998.

- Regenerate an example output.

PR: docs/84913
MFC after: 3 days


163281 12-Oct-2006 ru

Fix utility's short description.

PR: docs/84467
Submitted by: Gary W. Swearingen
MFC after: 3 days


162395 18-Sep-2006 ru

Markup fixes.


161526 22-Aug-2006 ru

Remove alpha left-overs.


156430 08-Mar-2006 pjd

Explain why the first partition should start at offset 16.

Requested by: hrs


156278 04-Mar-2006 pjd

Fix evil examples - first partition should start at offset 16.

MFC after: 3 days


152568 18-Nov-2005 ru

-mdoc sweep.


150250 17-Sep-2005 rodrigc

Clarify wording for -m flag.

PR: docs/84704


149061 14-Aug-2005 iedowse

Attempt to improve the logic for automatically sizing partitions
to take into account the new default of starting the first partition
after the boot blocks instead of at sector 0. If you used automatic
sizing when the first partition did not start at 0, you would get
an error that the automatically sized partition extended beyond the
end of the disk.

Note that there are probably still many more complex cases where
automatic sizing and placement will not work (e.g. non-contiguous
or out of order partitions).


139987 10-Jan-2005 ru

Scheduled mdoc(7) sweep.


139856 07-Jan-2005 rse

Fix the derivation of the GEOM name from the specified device name by
complementing the existing special case of a not existing /dev prefix
with the recognition of an already existing /dev prefix.

This implicitly solves the following two issues related to working on
GEOM devices /dev/foo/bar (which have the GEOM provider name "foo/bar")
with the expected commands like "bsdlabel /dev/foo/bar":

1. the error "Geom not found" when trying to write or edit the BSD
label (because previously the incorrect GEOM name "bar" instead of
"foo/bar" was derived from "/dev/foo/bar").

2. the multiple times reported "magically introduced" partition offset
of 63 blocks and the resulting errors like "partition extends past
end of unit" and "partition c doesn't start at 0!".

This implicitly resulted because bsdlabel(8) determines the "MBR
offset" via GEOM and (intentionally) silently falls back to an offset
of 0 if it could not be queried (which is the case if the name was
incorrectly derived).

Usually (at least on PCs) the offset for the first slice is 63 blocks
and bsdlabel(8) automatically subtracts them from the absolute
offsets in the read on-disk BSD label, resulting in the display of an
effective offset of 0. If the GEOM query fails, the assumed offset of
0 is subtracted and an incorrect effective offset of 63 is displayed
and tried to be worked upon.

Reviewed by: pjd
MFC after: 1 week


134973 09-Sep-2004 brooks

The disk labels generated by bsdlabel can no address more than
0xffffffff sectors. Document this limit and avoid installing bogus
labels on disks with more sectors.

Allowing the installation of labels addressing as much of the disk as
possiable may be a useful addition in some situations, but this was easy
to implement and should reduce confusion.

PR: bin/71408


133384 09-Aug-2004 des

The multiplier prefix is actually a multiplier suffix.


133348 08-Aug-2004 des

Use fallthrough to simplify the multiplier logic; optimistically add
support for the T multiplier; improve the error message for unrecognized
multipliers.


133347 08-Aug-2004 des

Fix some whitespace issues, and move a curly brace out of an #ifdef to
avoid confusing auto-indenting editors.


129327 17-May-2004 ru

Assorted markup, grammar, and spelling fixes.


128073 09-Apr-2004 markm

Remove advertising clause from University of California Regent's license,
per letter dated July 22, 1999.

Approved by: core, imp


127650 30-Mar-2004 luigi

Implement a '-f' flag to teach bsdlabel to work on files instead of
disk partitions.


127044 15-Mar-2004 jhb

When installing boot blocks into an Alpha BSD label, setup the location,
length, and flags fields at the end of the SRM boot sector so that SRM can
find the bootstrap code. This fixes bsdlabel -m alpha to generate bootable
disklabels.

Reviewed by: phk


124368 11-Jan-2004 nyan

'-DPC98' is not needed.


121222 18-Oct-2003 phk

Only automatically create an 'a' partition when there is nothing
but a 'c' partition.


120821 05-Oct-2003 iedowse

Remove the hardcoded default block/frag/cpg values from bsdlabel
and the logic for setting them according to the partition size.
Instead, unspecified filesystem values are left at 0 so that newfs
will use its own defaults. It just caused confusion to have the
defaults duplicated in two different places.

Reviewed by: phk


119964 10-Sep-2003 ru

mdoc(7): Properly mark C headers.


119893 08-Sep-2003 ru

mdoc(7): Use the new feature of the .In macro.


119510 27-Aug-2003 phk

When we initialize a disk with a virgin label, create also an 'a'
partition which starts after the bootstrap area and fills the entire
disk.


115995 07-Jun-2003 phk

Augh! Fix the sparc64 build:

If we don't have a default label location for the compiled architecture,
insist that a -m <architecture> option is specified.


115948 07-Jun-2003 phk

Sanitize setting of labeloffset and labelsector.


115809 04-Jun-2003 phk

Give ia64 the exact same semantics as i386 with respect to non-512
byte sector devices.


115794 04-Jun-2003 marcel

Unbreak ia64. 'nuff said.


115696 02-Jun-2003 phk

Fix sectorsize != 512 on i386 and pc98. Add test cases for same.


115624 01-Jun-2003 phk

Simplify the GEOM OAM api: Drop the request type, and let everything
hinge on the "verb" parameter which the class gets to interpret as
it sees fit.

Move the entire request into the kernel and move changed parameters
back when done.


115616 01-Jun-2003 phk

Add pc98 arch to test set.
Remove ktrace which leaked out of test-setup.


115449 31-May-2003 obrien

Protext copyright[].


115288 24-May-2003 ru

mdoc(7) fixes.

Approved by: re (blanket)


115254 23-May-2003 peter

Add amd64 to the MACHINE_ARCH list of systems that link bsdlabel to
disklabel. I just got burnt again by having an old disklabel binary
kicking around.

Discussed with: phk
Approved by: re (safe amd64 stuff)


115105 17-May-2003 ru

Style fixes.

Reviewed by: phk
Approved by: re (scottl)


115104 17-May-2003 ru

Moved libgeom.so dependencies to where they belong.

Reviewed by: phk
Approved by: re (scottl)


114982 13-May-2003 phk

Add pc98 archtecture entry.

Approved by: re/rwatson


114862 09-May-2003 phk

Before reading an ascii label, initialize with defaults so that
getasciipartspec() has a sectorisize in case it needs one.

Approved by: re/jhb


114860 09-May-2003 phk

Sigh, this shows just how much one can be conditioned my the environment:

Just because we for the last ten years have fought for every byte
in the boot code on i386, doesn't mean that other architectures could
not actually have space to spare there.

Remore debugging message.


114759 05-May-2003 phk

Compile bsdlabel on all platforms.

Install a link to the disklabel(8) name on i386 and alpha platforms.

Leave old disklabel(8) sources intact but disconnected from the build
for now.


114673 04-May-2003 phk

Add transparent handling of mbroffset for backwards compatibility.


114574 03-May-2003 phk

More axe-work:

Hide all the historical fields of the label, unless people ask for them with -A,
set them to intelligently chosen defaults otherwise.

Distill the manual page to remove inaccuracies, misundertandings and obsolete
information. It can probably still be done better but now at least it is
not misinforming people.


114571 03-May-2003 phk

Some minor remodelling with a large axe.


114569 03-May-2003 phk

Use new geom.ctl based OAM instead of ioctls.
Various cleanup.


114557 02-May-2003 phk

bsd_disklabel_le_dec() takes an extra argument now.


114552 02-May-2003 phk

Vastly simplify architecture handling: Use properties of label as
recorded in global variables, rather than checks on the architecture.

Drop horribly code to handle MBR/PC98's embedded in the BSD label area.
If you need to have an MBR or PC98 on your disk, you should not overlap
it with a BSDLABEL, if you don't need it, this code is nothing but trouble.


114551 02-May-2003 phk

Default the location to the compiled for architecture if no -m arg specified.


114550 02-May-2003 phk

Add three global variables which contain the location, size and a flag
for the alpha checksum, and set them depending on the specified architecture

Don't look for disklabels every 16 bytes, look the only place they should
be for the current architecture.

Always read the label from the raw disk and decode it into struct
disklabel rather than trust a cast from random addresses.

When writing to the raw disk, encode the label properly.


114549 02-May-2003 phk

Pull in geom_bsd_enc.c from sys/geom to encode and decode our labels.


114545 02-May-2003 phk

Remove the well-intentioned, but ill thought out check which prevents us
from dd(1)'ing the boot code off one drive and have bsdlabel write it
on another.


114544 02-May-2003 phk

Update the test-script based on the sunlabel version, but put a for-loop
in there to run over the various architectures.


113695 18-Apr-2003 phk

Add the beginning of a regression test.

So far it checks the overwrites of the BSD label inband (ie: dd
if=/dev/ad0a of=/dev/ad2a).

This excercises the geom::slice::hotspot code.


113680 18-Apr-2003 phk

First scrub of s/disklabel/bsdlabel/

bsdlabel.5 deliberately exempted, its contents looks less than useful.


113604 17-Apr-2003 trhodes

Quick grammar fix.


112945 01-Apr-2003 yar

Don't die of SIGSEGV on a missing fstype field
in a saved disklabel file.

MFC after: 1 week


112766 29-Mar-2003 seanc

Small mdoc fix


112307 16-Mar-2003 ru

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


112290 15-Mar-2003 ru

Give this manpage a good overhaul, including the markup.
Notable changes:

- Removed the "disktype" argument from the -B only synopsis
form. This form doesn't touch the disk label, and doesn't
use this argument.

- Fixed the first example in the EXAMPLES section. Support
for compatibility slices has been recently dropped from
the GEOM kernels, and a bit later GEOM became standard.

- Removed the buggy notion from rev. 1.37 that disklabel(8)
may be used to define mount points; it cannot. Improve
some DOS partition / FreeBSD slice wording. Among these,
``dangerously-dedicated slice'' was just a nonsense. ;-)


112231 14-Mar-2003 ru

Properly mark "auto" as a keyword.


111286 23-Feb-2003 ru

Deal with vestiges of d_boot[01].


109901 26-Jan-2003 phk

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.


109891 26-Jan-2003 phk

IA64 still needs to be able to run on MBR+BSD combination, so put disklabel
back.

Pointed out by: peter


109889 26-Jan-2003 phk

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.


109887 26-Jan-2003 phk

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.


109884 26-Jan-2003 phk

Offer better advice in #error.

Remove yet a usage message about -N/-W


109882 26-Jan-2003 phk

Remove ia64 and powerpc #ifdefs: this is i386/pc98/alpha only code.


109879 26-Jan-2003 phk

Remove #ifdef __sparc64__ code. GEOM uses native SUN labels on this arch,
so no hacks are needed.


109878 26-Jan-2003 phk

Fix typo in last commit.
Rearrange bits in writelabel() a bit for improved readability.


109875 26-Jan-2003 phk

Remember to remove -N and -W from usage.


109874 26-Jan-2003 phk

Don't fiddle write-protect status of disklabel, it's a discontinued feature.


109872 26-Jan-2003 phk

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


109378 16-Jan-2003 des

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


108650 04-Jan-2003 nyan

Rename the dos_partition structure for pc98 to pc98_partition.


108257 24-Dec-2002 ru

mdoc(7) police: Deal with self-xrefs.


107788 12-Dec-2002 ru

Uniformly refer to a file system as "file system".

Approved by: re


107534 02-Dec-2002 grog

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)


107232 25-Nov-2002 ru

mdoc(7) police: Added missing markup bit.

Approved by: re


107041 18-Nov-2002 julian

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


104813 10-Oct-2002 schweikh

Document that write(2) et al can return EROFS for attempts to write the
disk label area.

PR: 43891
Submitted by: Diomidis D. Spinellis <dds@istlab.dmst.aueb.gr>
MFC after: 3 days


104674 08-Oct-2002 nyan

Fix to support pc98.


104543 05-Oct-2002 phk

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.


104272 01-Oct-2002 phk

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.


103669 20-Sep-2002 phk

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


102231 21-Aug-2002 trhodes

s/filesystem/file system/g as discussed on -developers


101994 16-Aug-2002 bmilekic

Fix more breakage due to FSTYPENAMES/DKTYPENAMES split.

Also submitted by: David Wolfskill <david@catwhisker.org>


99501 06-Jul-2002 charnier

The .Nm utility


99365 03-Jul-2002 markm

Apply __FBSDID(); fix local variable(names) that stomp on global
definitions; fix some const strings; fix some signedness issues.


97855 05-Jun-2002 iedowse

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


97553 30-May-2002 alfred

correct comment (replace i386 with __i386__)


97535 30-May-2002 iedowse

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>


97534 30-May-2002 iedowse

Split out the code for parsing the partition specification lines
into a separate function to avoid some over-long lines.


97047 21-May-2002 benno

Spread the word of PowerPC.


96707 16-May-2002 trhodes

more file system > filesystem


96475 12-May-2002 phk

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.


94803 15-Apr-2002 trhodes

disklabel(8) manual page:

--change "-s newboot" to "-s newboot2" in an example
--Fixed spelling
--Fixed some confusion between slice/parition/primary partition and other
things.

PR: 35947 and 35951
Noticed by: Gary W. Swearingen <swear@blarg.net>
Reviewed by: keramida
Thanks to: grog
MFC after: 2 days


94166 08-Apr-2002 phk

Don't set WARNS to 2, we're default compatible now.

Noticed by: bde


94065 07-Apr-2002 phk

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.


94061 07-Apr-2002 phk

Nuke a totally pointless optional debug option

Sponsored by: DARPA and NAI Labs.


93809 04-Apr-2002 phk

Remove remaining traces of d_boot[01]


93724 03-Apr-2002 phk

Kill only usage of the undocumnted and unuse d_boot[01] fields of
struct disklabel.

Sponsored by: DARPA & NAI Labs.


92715 19-Mar-2002 imp

Remove stray register


92714 19-Mar-2002 imp

De-__P the man page, but I suspect that we need to freshly import
sys/disklabel.h since the one in here looks a little crunchy.


92541 18-Mar-2002 imp

o remove __P
o Use ANSI function definitions
o const poison
o remove register


92058 11-Mar-2002 obrien

Add complete Sparc64 support.
Submitted by: tmm

Dike out vax support.


92057 11-Mar-2002 obrien

* Support the Sparc64.
* Do not default to any particular platform. Require that we explicitly
support a particular platform.


91993 10-Mar-2002 dd

Remove inappropriate .Op calls in examples.

PR: 35689
Submitted by: Gary W. Swearingen <swear@blarg.net>


91603 03-Mar-2002 phk

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.


88987 07-Jan-2002 dd

In the words of the submitter:

disklabel(8)'s "Reading the disk label" section starts out "To examine
or save the label on a disk drive,...". This is confusing. The given
command (disklabel [-r] disk) doesn't save anything (except to standard
out, but that should go without saying). It reads as if the command
might save something on the disk drive.

PR: 32452
Submitted by: Gary W. Swearingen <swear@blarg.net>


87325 04-Dec-2001 obrien

Default to WARNS=2.
Binary builds that cannot handle this must explicitly set WARNS=0.

Reviewed by: mike


84765 10-Oct-2001 ru

-r is implied with -B.


84306 01-Oct-2001 ru

mdoc(7) police: Use the new .In macro for #include statements.


83066 05-Sep-2001 ru

The defaults for bsize and fsize were interchanged.

PR: docs/30330


81911 19-Aug-2001 kris

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


81622 14-Aug-2001 ru

mdoc(7) police: s/BSD/.Bx/ where appropriate.


79754 15-Jul-2001 dd

Remove whitespace at EOL.


79530 10-Jul-2001 ru

mdoc(7) police: removed HISTORY info from the .Os call.


79454 09-Jul-2001 dd

mdoc(7) police: remove extraneous .Pp before and/or after .Sh.


79452 09-Jul-2001 brian

Fix the type of the NULL arg to execl()

Idea from: Theo de Raadt <deraadt@openbsd.org>


78735 24-Jun-2001 dd

Nuke unused variables.


76624 15-May-2001 ru

mdoc(7) police: fix markup in revision 1.27.


76604 14-May-2001 grog

Clarify the currently used partition types.

Add cross-references to ccd(4) and vinum(8).


75915 24-Apr-2001 imp

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.


74815 26-Mar-2001 ru

- Backout botched attempt to introduce MANSECT feature.
- MAN[1-9] -> MAN.


73755 05-Mar-2001 ru

mdoc(7) police: misc formatting fixes.
(This page still needs a lot of work.)


73573 05-Mar-2001 imp

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.


73516 04-Mar-2001 obrien

Fix style nit.


73034 25-Feb-2001 jwd

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>


71895 01-Feb-2001 ru

mdoc(7) police: split punctuation characters + misc fixes.


70434 28-Dec-2000 hoek

typo: modifes -> modifies


70152 18-Dec-2000 ru

Prepare for mdoc(7)NG.


69323 28-Nov-2000 ben

Fix typos and layout problem.

PR: 23109
Submitted by: Jimmy Olgeni <olgeni@uli.it>


68960 20-Nov-2000 ru

mdoc(7) police: use the new features of the Nm macro.


68716 14-Nov-2000 ru

Use Fx macro wherever possible.


68575 10-Nov-2000 ru

Avoid use of direct troff requests in mdoc(7) manual pages.


68044 31-Oct-2000 jkh

Add support for virgin disklabels

Submitted by: dillon


65921 16-Sep-2000 phk

Turn dkcksum() into an __inline function.

Change its type to u_int_16_t.


65183 29-Aug-2000 grog

Correct typo.


60256 09-May-2000 nyan

Add '-DPC98' to CFLAGS if MACHINE == pc98.


59648 26-Apr-2000 obrien

/dev/r<FOO> => /dev/<FOO>


59457 21-Apr-2000 obrien

A local WIP snook in rev 1.31.

Noticed by: bde


59429 20-Apr-2000 obrien

Found more places where 'r' was being prepended to the device name.


59216 14-Apr-2000 imp

Add include of errno.h where needed, remove extern int errno where not.

These commits were inspired by a similar commit to netbsd.


59114 10-Apr-2000 obrien

Don't prepend "r" for the raw device anymore.


55795 11-Jan-2000 bde

Backed out removal of vendor id and gratuitous change of tmpfile prefix
in previous commit.


55742 10-Jan-2000 kris

10 X's for mkstemp(), and don't redefine _PATH_TMP


55469 05-Jan-2000 bde

Refreshed the silly copy of <sys/disklabel.h>. The old copy was
seriously out of date. It older than Lite1 (it has an undeprecated
DISKTAB but not _PATH_DISKTAB).


51637 25-Sep-1999 billf

Remove duplicate declarations for two internal functions.
Remove delcaration for getenv(), we already get it from stdlib.h


50476 28-Aug-1999 peter

$Id$ -> $FreeBSD$


49833 15-Aug-1999 mpp

Minor style fix.


49822 15-Aug-1999 mpp

Various man page cleanup:

- Sort xrefs
- FreeBSD.ORG -> FreeBSD.org
- Properly xref RFCs.
- Be consistent with section names as outlined in mdoc(7).
- Other misc mdoc cleanup.

PR: doc/13144
Submitted by: Alexey M. Zelkin <phantom@cris.net>


49339 01-Aug-1999 grog

Remove inappropriate references to the wrong name for the bootstrap
manager, thus killing two birds with one stone.

Objected-to-by: bde
rnordier


49306 31-Jul-1999 grog

Make intelligible:
Describe the command formats in English.
Add references to other programs (boot0cfg, fdisk).
Remove some old cruft, including FUD about single-level bootstraps.
Add example of output format.

Not-objected-to-by: msmith
rnordier


48957 21-Jul-1999 billf

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.


42256 02-Jan-1999 jkh

Update for boot block location change.


41901 17-Dec-1998 jkh

Look for boot blocks in new default location.


41381 28-Nov-1998 rnordier

Refer to "da" rather than "sd" device.

Suggested by: jdp


40615 23-Oct-1998 bde

Oops, don't quite use RAW_PART instead of RAWPARTITION. Use 'a' + RAW_PART
in both places.


40475 17-Oct-1998 bde

Updated the error message for EXDEV to match recent kernel fixes.
Fixed nearby indentation.

Use RAW_PART instead of RAWPARTITION.


38483 23-Aug-1998 bde

Attempt to fix my breakage of the alpha makebootarea() in rev.1.19.
The previous attempt just converted compile time breakage to runtime
breakage.


38474 21-Aug-1998 gpalmer

Try to make this compile on both alpha and i386


38411 17-Aug-1998 bde

Fixed style bugs in previous commit.

Added some comments on #endifs.


38384 17-Aug-1998 dfr

Teach disklabel how to install a bootstrap on an alpha with SRM console.


37865 25-Jul-1998 bde

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.


37773 20-Jul-1998 bde

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().


37234 28-Jun-1998 bde

Fixed printf format errors.


36756 08-Jun-1998 charnier

Use warnx()+fprintf() to handle multi-line messages. Correct K&R support and
KNF continuation indent rule.
Requested by: Bruce.


36632 04-Jun-1998 charnier

Add section number to .Xr. Use of .Nm. Typo. Add rcsid. Remove unused
#includes. Use err(3).


36461 29-May-1998 jkoshy

Use the correct macro for file names. Remove empty `HISTORY' section.

PR: 6780
Submitted by: Yoshishige Arai <ryo2@on.rim.or.jp>


33775 24-Feb-1998 bde

Fixed annoying warning for unused sccsid.


27187 04-Jul-1997 jdp

Die and stay dead. Ya got it?!


27163 02-Jul-1997 bde

Import Lite2's src/sbin, except for XNSrouted and routed. All relevant
files in src/sbin are off the vendor branch, so this doesn't change the
active versions.


26826 23-Jun-1997 steve

Show the real revision date and not the date that this
manpage is being viewed.


26542 10-Jun-1997 charnier

Add Id. Use err(3). Costmetic in usage string.


24359 29-Mar-1997 imp

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


24180 24-Mar-1997 imp

Use mkstemp rather than mktemp to prevent a small race.

Obtained from: OpenBSD


22990 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


21635 13-Jan-1997 wosch

Sort cross references.


16431 17-Jun-1996 bde

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.


15082 07-Apr-1996 mpp

Correct some man page cross references and file location references.


13892 03-Feb-1996 joerg

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.


13550 22-Jan-1996 joerg

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


13544 21-Jan-1996 joerg

Declare functions, resolve printf-format warnings.


13122 30-Dec-1995 peter

recording cvs-1.6 file death


8871 30-May-1995 rgrimes

Remove trailing whitespace.


6643 22-Feb-1995 bde

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.


5393 04-Jan-1995 gibbs

Allow for the specification of bsize, fsize, and bps (blocks per segment)
for LFS filesystems.


3111 26-Sep-1994 pst

disklabel will dump core if you give it too few numbers to process
Obtained from: NetBSD misc/490 - John Kohl


1855 05-Aug-1994 wollman

Convert to our man installation style. Also fixed long-standing bug
in `fastboot'/`fasthalt' in which the interpreter would hang around
after `reboot' or `halt' is run, causing an irritating ``Killed'' message.


1607 28-May-1994 rgrimes

Remove stuff for building manual pages the old way.


1558 26-May-1994 rgrimes

BSD 4.4 Lite sbin Sources

Note: XNSrouted and routed NOT imported here, they shall be imported with
usr.sbin.