Assorted mdoc(7) fixes.

This commit is contained in:
Ruslan Ermilov 2003-06-02 11:19:24 +00:00
parent cff6c3cab1
commit f937c268cf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=115694
6 changed files with 373 additions and 249 deletions

View File

@ -29,7 +29,7 @@
.Dt GPT 8
.Sh NAME
.Nm gpt
.Nd GUID partition table maintenance utility
.Nd "GUID partition table maintenance utility"
.Sh SYNOPSIS
.Nm
.Op Ar general_options
@ -40,7 +40,9 @@
The
.Nm
utility provides the necessary functionality to manipulate GUID partition
tables (GPTs), but see BUGS below for how and where functionality is missing.
tables (GPTs), but see
.Sx BUGS
below for how and where functionality is missing.
The general usage model of the
.Nm
tool follows that of the
@ -48,22 +50,25 @@ tool follows that of the
tool.
The general options are described in the following paragraph.
The remaining paragraphs describe the individual commands with their options.
Here we conclude by mentioning that a device is either a special file
Here we conclude by mentioning that a
.Ar device
is either a special file
corresponding to a disk-like device or a regular file.
The command is applied to each device listed on the command line.
.Ss General options
.Pp
The command is applied to each
.Ar device
listed on the command line.
.Ss General Options
The general options allow the user to change default settings or otherwise
change behaviour that's applicable to all commands.
change the behaviour that is applicable to all commands.
Not all commands use all default settings, so some general options may not
have an effect on all commands.
.Pp
The
.Fl p Ar count
option allows the user to change the the number of partitions the GPT can
option allows the user to change the number of partitions the GPT can
accomodate.
This is used whenever a new GPT is created.
By default the
By default, the
.Nm
utility will create space for 128 partitions (or 32 sectors of 512 bytes).
.Pp
@ -72,7 +77,9 @@ The
option causes the
.Nm
utility to open the device for reading only.
Currently this option is primarily useful for the show command, but the intend
Currently this option is primarily useful for the
.Ic show
command, but the intent
is to use it to implement dry-run behaviour.
.Pp
The
@ -80,28 +87,29 @@ The
option controls the verbosity level.
The level increases with every occurrence of this option.
There is no formalized definition of the different levels yet.
.Ss Commands
.Bl -tag -width indent
.\" ==== add ====
.Ss The add command
.Pp
.It Xo
.Nm
.Ic add
.Op Fl b Ar number
.Op Fl s Ar count
.Op Fl t Ar type
.Ar device ...
.Pp
.Xc
The
.Ic add
command allows the user to add a new partition to an existing table.
By default it will create an UFS partition covering the first available block
of unused disk space.
By default, it will create a UFS partition covering the first available block
of an unused disk space.
The command-specific options can be used to control this behaviour.
.Pp
The
.Fl b Ar number
option allows the user to specify the starting (beginning) sector number of
the partition.
The minium sector number is 1, but has to fall inside an unused region of
The minimum sector number is 1, but has to fall inside an unused region of
disk space that is covered by the GPT.
.Pp
The
@ -115,19 +123,17 @@ option allows the user to specify the partition type.
The type is given as an UUID, but
.Nm
has created
.Em efi ,
.Em swap
.Cm efi , swap
and
.Em ufs
.Cm ufs
as aliases for the three most commonly used partition types.
.\" ==== create ====
.Ss The create command
.Pp
.It Xo
.Nm
.Ic create
.Op Fl p
.Ar device ...
.Pp
.Xc
The
.Ic create
command allows the user to create a new (empty) GPT.
@ -139,13 +145,12 @@ option tells
to create only the primary table and not the backup table.
This option is only useful for debugging and should not be used otherwise.
.\" ==== destroy ====
.Ss The destroy command
.Pp
.It Xo
.Nm
.Ic destroy
.Op Fl r
.Ar device ...
.Pp
.Xc
The
.Ic destroy
command allows the user to destroy an existing, possibly not empty GPT.
@ -156,17 +161,16 @@ option instructs
.Nm
to destroy the table in a way that it can be recovered.
.\" ==== migrate ====
.Ss The migrate command
.Pp
.It Xo
.Nm
.Ic migrate
.Op Fl k
.Op Fl s
.Ar device ...
.Pp
.Xc
The
.Ic migrate
command allows the user to migrate a MBR-based disk partitioning into a
command allows the user to migrate an MBR-based disk partitioning into a
GPT-based partitioning.
.Pp
The
@ -179,20 +183,21 @@ users.
.Pp
The
.Fl s
option prevents migrating BSD disklabels into GPT partitions by creating
option prevents migrating
.Bx
disk labels into GPT partitions by creating
the GPT equivalent of a slice.
.\" ==== show ====
.Ss The show command
.Pp
.It Xo
.Nm
.Ic show
.Ar device ...
.Pp
.Xc
The
.Ic show
command displays the current partitioning on the listed devices and gives
an overall view of the disk contents.
.Pp
.El
.Sh SEE ALSO
.Xr fdisk 8 ,
.Xr mount 8 ,
@ -202,7 +207,7 @@ an overall view of the disk contents.
The
.Nm
utility appeared in
.Fx 5.0
.Fx 5.0
for ia64.
.Sh BUGS
The development of the
@ -222,9 +227,9 @@ of the word.
For example, the
.Fl p Ar count
option may be changed to a command option rather than a generic option.
There are only two commands that use it so there's a chance that the natural
There are only two commands that use it so there is a chance that the natural
tendency for people is to use it as a command option.
Also, options primarily intended for diagnostic of debug purposes may be
Also, options primarily intended for diagnostic or debug purposes may be
removed in future versions.
.Pp
Another possibility is that the current usage model is accompanied by

View File

@ -1,4 +1,3 @@
.\" $FreeBSD$
.\" $NetBSD: raid.4,v 1.16 2000/11/02 03:34:08 oster Exp $
.\"
.\" Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -61,6 +60,8 @@
.\" any improvements or extensions that they make and grant Carnegie the
.\" rights to redistribute these changes.
.\"
.\" $FreeBSD$
.\"
.Dd October 20, 2002
.Dt RAID 4
.Os
@ -68,7 +69,7 @@
.Nm raid
.Nd RAIDframe disk driver
.Sh SYNOPSIS
.Cd device raidframe
.Cd "device raidframe"
.Sh DESCRIPTION
The
.Nm
@ -76,94 +77,109 @@ driver provides RAID 0, 1, 4, and 5 (and more!) capabilities to
.Fx .
This
document assumes that the reader has at least some familiarity with RAID
and RAID concepts. The reader is also assumed to know how to configure
disks and pseudo-devices into kernels, how to generate kernels, and how
and RAID concepts.
The reader is also assumed to know how to configure
disks and add devices into kernels, how to generate kernels, and how
to partition disks.
.Pp
RAIDframe provides a number of different RAID levels including:
.Bl -tag -width indent
.It RAID 0
provides simple data striping across the components.
.It RAID 1
provides mirroring.
.It RAID 4
provides data striping across the components, with parity
.Bl -item
.It
RAID 0 provides simple data striping across the components.
.It
RAID 1 provides mirroring.
.It
RAID 4 provides data striping across the components, with parity
stored on a dedicated drive (in this case, the last component).
.It RAID 5
provides data striping across the components, with parity
.It
RAID 5 provides data striping across the components, with parity
distributed across all the components.
.El
.Pp
There are a wide variety of other RAID levels supported by RAIDframe,
including Even-Odd parity, RAID level 5 with rotated sparing, Chained
declustering, and Interleaved declustering. The reader is referred
declustering, and Interleaved declustering.
The reader is referred
to the RAIDframe documentation mentioned in the
.Sx HISTORY
section for more detail on these various RAID configurations.
.Pp
Depending on the parity level configured, the device driver can
support the failure of component drives. The number of failures
allowed depends on the parity level selected. If the driver is able
support the failure of component drives.
The number of failures allowed depends on the parity level selected.
If the driver is able
to handle drive failures, and a drive does fail, then the system is
operating in "degraded mode". In this mode, all missing data must be
operating in
.Dq "degraded mode" .
In this mode, all missing data must be
reconstructed from the data and parity present on the other
components. This results in much slower data accesses, but
components.
This results in much slower data accesses, but
does mean that a failure need not bring the system to a complete halt.
.Pp
The RAID driver supports and enforces the use of
.Sq component labels .
.Dq "component labels" .
A
.Sq component label
.Dq "component label"
contains important information about the component, including a
user-specified serial number, the row and column of that component in
the RAID set, and whether the data (and parity) on the component is
.Sq clean .
.Dq clean .
If the driver determines that the labels are very inconsistent with
respect to each other (e.g. two or more serial numbers do not match)
or that the component label is not consistent with it's assigned place
in the set (e.g. the component label claims the component should be
respect to each other (e.g., two or more serial numbers do not match)
or that the component label is not consistent with its assigned place
in the set (e.g., the component label claims the component should be
the 3rd one a 6-disk set, but the RAID set has it as the 3rd component
in a 5-disk set) then the device will fail to configure. If the
in a 5-disk set) then the device will fail to configure.
If the
driver determines that exactly one component label seems to be
incorrect, and the RAID set is being configured as a set that supports
a single failure, then the RAID set will be allowed to configure, but
the incorrectly labeled component will be marked as
.Sq failed ,
.Dq failed ,
and the RAID set will begin operation in degraded mode.
If all of the components are consistent among themselves, the RAID set
will configure normally.
.Pp
Component labels are also used to support the auto-detection and
auto-configuration of RAID sets. A RAID set can be flagged as
auto-configuration of RAID sets.
A RAID set can be flagged as
auto-configurable, in which case it will be configured automatically
during the kernel boot process. RAID file systems which are
during the kernel boot process.
RAID file systems which are
automatically configured are also eligible to be the root file system.
There is currently only limited support (alpha and pmax architectures)
for booting a kernel directly from a RAID 1 set, and no support for
booting from any other RAID sets. To use a RAID set as the root
booting from any other RAID sets.
To use a RAID set as the root
file system, a kernel is usually obtained from a small non-RAID
partition, after which any auto-configuring RAID set can be used for the
root file system. See
root file system.
See
.Xr raidctl 8
for more information on auto-configuration of RAID sets.
.Pp
The driver supports
.Sq hot spares ,
.Dq "hot spares" ,
disks which are on-line, but are not
actively used in an existing file system. Should a disk fail, the
actively used in an existing file system.
Should a disk fail, the
driver is capable of reconstructing the failed disk onto a hot spare
or back onto a replacement drive.
If the components are hot swapable, the failed disk can then be
removed, a new disk put in its place, and a copyback operation
performed. The copyback operation, as its name indicates, will copy
performed.
The copyback operation, as its name indicates, will copy
the reconstructed data from the hot spare to the previously failed
(and now replaced) disk. Hot spares can also be hot-added using
(and now replaced) disk.
Hot spares can also be hot-added using
.Xr raidctl 8 .
.Pp
If a component cannot be detected when the RAID device is configured,
that component will be simply marked as 'failed'.
that component will be simply marked as
.Dq failed .
.Pp
The user-land utility for doing all
The userland utility for doing all
.Nm
configuration and other operations
is
@ -172,77 +188,103 @@ Most importantly,
.Xr raidctl 8
must be used with the
.Fl i
option to initialize all RAID sets. In particular, this
initialization includes re-building the parity data. This rebuilding
option to initialize all RAID sets.
In particular, this initialization includes re-building the parity data.
This rebuilding
of parity data is also required when either a) a new RAID device is
brought up for the first time or b) after an un-clean shutdown of a
RAID device. By using the
brought up for the first time or b) after an unclean shutdown of a
RAID device.
By using the
.Fl P
option to
.Xr raidctl 8 ,
and performing this on-demand recomputation of all parity
before doing a
before doing an
.Xr fsck 8
or a
.Xr newfs 8 ,
file system integrity and parity integrity can be ensured. It bears
file system integrity and parity integrity can be ensured.
It bears
repeating again that parity recomputation is
.Ar required
before any file systems are created or used on the RAID device. If the
.Em required
before any file systems are created or used on the RAID device.
If the
parity is not correct, then missing data cannot be correctly recovered.
.Pp
RAID levels may be combined in a hierarchical fashion. For example, a RAID 0
RAID levels may be combined in a hierarchical fashion.
For example, a RAID 0
device can be constructed out of a number of RAID 5 devices (which, in turn,
may be constructed out of the physical disks, or of other RAID devices).
.Pp
It is important that drives be hard-coded at their respective
addresses (i.e. not left free-floating, where a drive with SCSI ID of
4 can end up as /dev/da0c) for well-behaved functioning of the RAID
device. This is true for all types of drives, including IDE, SCSI,
etc. For IDE drivers, use the option ATAPI_STATIC_ID in your kernel
config file. For SCSI, you should 'wire down' the devices according to
their ID. See
addresses (i.e., not left free-floating, where a drive with SCSI ID of
4 can end up as
.Pa /dev/da0c )
for well-behaved functioning of the RAID
device.
This is true for all types of drives, including IDE, SCSI,
etc.
For IDE drivers, use the
.Cd "options ATA_STATIC_ID"
in your kernel config file.
For SCSI, you should
.Dq "wire down"
the devices according to their ID.
See
.Xr cam 4
for examples of this.
The rationale for fixing the device addresses
is as follows: Consider a system with three SCSI drives at SCSI ID's
4, 5, and 6, and which map to components /dev/da0e, /dev/da1e, and
/dev/da2e of a RAID 5 set. If the drive with SCSI ID 5 fails, and the
system reboots, the old /dev/da2e will show up as /dev/da1e. The RAID
is as follows: consider a system with three SCSI drives at SCSI IDs
4, 5, and 6, and which map to components
.Pa /dev/da0e , /dev/da1e ,
and
.Pa /dev/da2e
of a RAID 5 set.
If the drive with SCSI ID 5 fails, and the
system reboots, the old
.Pa /dev/da2e
will show up as
.Pa /dev/da1e .
The RAID
driver is able to detect that component positions have changed, and
will not allow normal configuration. If the device addresses are hard
will not allow normal configuration.
If the device addresses are hard
coded, however, the RAID driver would detect that the middle component
is unavailable, and bring the RAID 5 set up in degraded mode. Note
is unavailable, and bring the RAID 5 set up in degraded mode.
Note
that the auto-detection and auto-configuration code does not care
about where the components live. The auto-configuration code will
about where the components live.
The auto-configuration code will
correctly configure a device even after any number of the components
have been re-arranged.
.Pp
The first step to using the
.Nm
driver is to ensure that it is suitably configured in the kernel. This is
done by adding a line similar to:
.Bd -unfilled -offset indent
pseudo-device raidframe # RAIDframe disk device
.Ed
driver is to ensure that it is suitably configured in the kernel.
This is done by adding the
.Pp
to the kernel configuration file. No count argument is required as the
.D1 Cd "device raidframe"
.Pp
line to the kernel configuration file.
No count argument is required as the
driver will automatically create and configure new device units as needed.
To turn on component auto-detection and auto-configuration of RAID
sets, simply add:
.Bd -unfilled -offset indent
options RAID_AUTOCONFIG
.Ed
sets, simply add
.Pp
.D1 Cd "options RAID_AUTOCONFIG"
.Pp
to the kernel configuration file.
.Pp
All component partitions must be of the type
.Dv FS_BSDFFS
(e.g. 4.2BSD) or
(e.g.,
.Cm 4.2BSD )
or
.Dv FS_RAID .
The use of the latter is strongly encouraged, and is required if
auto-configuration of the RAID set is desired. Since RAIDframe leaves
room for disklabels, RAID components can be simply raw disks, or
auto-configuration of the RAID set is desired.
Since RAIDframe leaves
room for disk labels, RAID components can be simply raw disks, or
partitions which use an entire disk.
.Pp
A more detailed treatment of actually using a
@ -251,37 +293,39 @@ device is found in
.Xr raidctl 8 .
It is highly recommended that the steps to reconstruct, copyback, and
re-compute parity are well understood by the system administrator(s)
.Ar before
a component failure. Doing the wrong thing when a component fails may
.Em before
a component failure.
Doing the wrong thing when a component fails may
result in data loss.
.Pp
.Sh WARNINGS
Certain RAID levels (1, 4, 5, 6, and others) can protect against some
data loss due to component failure. However the loss of two
data loss due to component failure.
However, the loss of two
components of a RAID 4 or 5 system, or the loss of a single component
of a RAID 0 system, will result in the entire file systems on that RAID
device being lost.
RAID is
.Ar NOT
.Em NOT
a substitute for good backup practices.
.Pp
Recomputation of parity
.Ar MUST
.Em MUST
be performed whenever there is a chance that it may have been
compromised. This includes after system crashes, or before a RAID
device has been used for the first time. Failure to keep parity
correct will be catastrophic should a component ever fail -- it is
compromised.
This includes after system crashes, or before a RAID
device has been used for the first time.
Failure to keep parity
correct will be catastrophic should a component ever fail \[em] it is
better to use RAID 0 and get the additional space and speed, than it
is to use parity, but not keep the parity correct. At least with RAID
0 there is no perception of increased data security.
.Pp
is to use parity, but not keep the parity correct.
At least with RAID 0 there is no perception of increased data security.
.Sh FILES
.Bl -tag -width /dev/XXrXraidX -compact
.Bl -tag -width ".Pa /dev/raid*" -compact
.It Pa /dev/raid*
The
.Nm
device special files.
.El
.Pp
.Sh SEE ALSO
.Xr config 8 ,
.Xr fsck 8 ,
@ -295,19 +339,28 @@ driver in
.Fx
is a port of RAIDframe, a framework for rapid prototyping of RAID
structures developed by the folks at the Parallel Data Laboratory at
Carnegie Mellon University (CMU). RAIDframe, as originally distributed
Carnegie Mellon University (CMU).
RAIDframe, as originally distributed
by CMU, provides a RAID simulator for a number of different
architectures, and a user-level device driver and a kernel device
driver for Digital Unix. The
driver for Digital
.Ux .
The
.Nm
driver is a kernelized version of RAIDframe v1.1, based on the
.Nx
port of RAIDframe by Greg Oster.
port of RAIDframe by
.An "Greg Oster" .
.Pp
A more complete description of the internals and functionality of
RAIDframe is found in the paper "RAIDframe: A Rapid Prototyping Tool
for RAID Systems", by William V. Courtright II, Garth Gibson, Mark
Holland, LeAnn Neal Reilly, and Jim Zelenka, and published by the
RAIDframe is found in the paper
.%T "RAIDframe: A Rapid Prototyping Tool for RAID Systems" ,
by
.An "William V. Courtright II" , "Garth Gibson" , "Mark Holland" ,
.An "LeAnn Neal Reilly" ,
and
.An "Jim Zelenka" ,
and published by the
Parallel Data Laboratory of Carnegie Mellon University.
The
.Nm

View File

@ -32,14 +32,17 @@
.Nd POSIX semaphores
.Sh SYNOPSIS
To link into the kernel:
.Bd -ragged -offset indent
.Cd "options P1003_1B_SEMAPHORES"
.Ed
.Pp
To load as a kernel loadable module:
.Dl kldload sem
.Pp
.Dl "kldload sem"
.Sh DESCRIPTION
The
.Nm
facility provides system calls used by the C library
facility provides system calls used by the standard C library
.Pq Pa libc
to implement
.Tn POSIX

View File

@ -32,39 +32,42 @@
.\" SUCH DAMAGE.
.\"
.\" $FreeBSD$
.Dd OCTOBER 25, 2002
.\"
.Dd October 25, 2002
.Os
.Dt MACLABEL 7
.Sh NAME
.Nm maclabel
.Nd Mandatory Access Control label format
.Sh DESCRIPTION
If Mandatory Access Control, or
.Dq MAC ,
is enabled in your kernel,
If Mandatory Access Control, or MAC, is enabled in the kernel,
then in addition to the traditional credentials,
each subject
(typically a user or a socket)
and object
(file system object, socket, etc)
(file system object, socket, etc.\&)
is given a
.Em MAC label .
.Em "MAC label" .
The MAC label specifies the necessary subject-specific or
object-specific information necessary for a MAC security policy
.\" .Xr ( mac 9 )
.\" .Pq Xr mac 9
to enforce access control on the subject/object.
.Pp
The format for a MAC label is defined as follows:
.Dl Sy policy1 Ns No / Ns Sy qualifier1 , Ns Sy policy2 Ns No / Ns Sy qualifier2 , Ns ...
.Pp
.Sm off
.D1 Ar policy1 No / Ar qualifier1 , policy2 No / Ar qualifier2 , No ...
.Sm on
.Pp
A MAC label consists of a policy name,
followed by a forward slash,
followed by the subject or object's qualifier,
optionally followed by a comma and one or more additional policy labels.
For example:
.Pp
.Dl Li "biba/low(low-low)"
.Dl Li "biba/high(low-high),mls/equal(equal-equal),partition/0"
.Bd -literal -offset indent
biba/low(low-low)
biba/high(low-high),mls/equal(equal-equal),partition/0
.Ed
.Sh SEE ALSO
.Xr mac 3 ,
.Xr posix1e 3 ,
@ -77,12 +80,12 @@ For example:
.Xr mac_seeotheruids 4 ,
.Xr mac_test 4 ,
.Xr login.conf 5 ,
.Xr ifconfig 8 ,
.Xr getfmac 8 ,
.Xr getpmac 8 ,
.Xr ifconfig 8 ,
.Xr setfmac 8 ,
.Xr setpmac 8 ,
.Xr mac 9 ,
.Xr mac 9
.Sh HISTORY
MAC first appeared in
.Fx 5.0 .
@ -90,5 +93,6 @@ MAC first appeared in
This software was contributed to the
.Fx
Project by NAI Labs, the Security Research Division of Network Associates
Inc. under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"),
Inc. under DARPA/SPAWAR contract N66001-01-C-8035
.Pq Dq CBOSS ,
as part of the DARPA CHATS research program.

View File

@ -46,13 +46,7 @@
.Sh SYNOPSIS
.Nm
.Op Fl FLnq
.Oo
.Fl f Ar format |
.Fl l |
.Fl r |
.Fl s |
.Fl x
.Oc
.Op Fl f Ar format | Fl l | r | s | x
.Op Fl t Ar timefmt
.Op Ar
.Nm readlink
@ -82,14 +76,28 @@ The information displayed is obtained by calling
with the given argument and evaluating the returned structure.
.Pp
The options are as follows:
.Bl -tag -width Ds
.Bl -tag -width indent
.It Fl F
As in
.Ic ls ,
display a slash (/) immediately after each pathname that is a directory, an
asterisk (*) after each that is executable, an at sign (@) after each symbolic
link, a percent sign (%) after each whiteout, an equal sign (=) after each
socket, and a vertical bar (|) after each that is a FIFO.
.Xr ls 1 ,
display a slash
.Pq Ql /
immediately after each pathname that is a directory,
an asterisk
.Pq Ql *
after each that is executable,
an at sign
.Pq Ql @
after each symbolic link,
a percent sign
.Pq Ql %
after each whiteout,
an equal sign
.Pq Ql =
after each socket,
and a vertical bar
.Pq Ql |
after each that is a FIFO.
The use of
.Fl F
implies
@ -124,17 +132,22 @@ See the
section for a description of valid formats.
.It Fl l
Display output in
.Ic ls Fl lT
.Nm ls Fl lT
format.
.It Fl r
Display raw information.
That is, for all the fields in the stat-structure,
That is, for all the fields in the
.Vt stat
structure,
display the raw, numerical value (for example, times in seconds since the
epoch, etc.)
epoch, etc.).
.It Fl s
Display information in ``shell output'', suitable for initializing variables.
Display information in
.Dq "shell output" ,
suitable for initializing variables.
.It Fl x
Display information in a more verbose way as known from some Linux
Display information in a more verbose way as known from some
.Tn Linux
distributions.
.It Fl t Ar timefmt
Display timestamps using the specified format.
@ -142,20 +155,19 @@ This format is
passed directly to
.Xr strftime 3 .
.El
.Ss FORMATS
.Ss Formats
Format strings are similar to
.Xr printf 3
formats in that they start with
.Cm % ,
are then followed by a sequence of formatting characters, and end in
a character that selects the field of the struct stat which is to be
formatted.
a character that selects the field of the
.Vt "struct stat"
which is to be formatted.
If the
.Cm %
is immediately followed by one of
.Cm n ,
.Cm t ,
.Cm % ,
.Cm n , t , % ,
or
.Cm @ ,
then a newline character, a tab character, a percent character,
@ -163,11 +175,13 @@ or the current file number is printed, otherwise the string is
examined for the following:
.Pp
Any of the following optional flags:
.Bl -tag -width Ds
.Bl -tag -width indent
.It Cm #
Selects an alternate output form for octal and hexadecimal output.
Non-zero octal output will have a leading zero, and non-zero
hexadecimal output will have ``0x'' prepended to it.
hexadecimal output will have
.Dq Li 0x
prepended to it.
.It Cm +
Asserts that a sign indicating whether a number is positive or negative
should always be printed.
@ -176,8 +190,9 @@ with a sign.
.It Cm -
Aligns string output to the left of the field, instead of to the right.
.It Cm 0
Sets the fill character for left padding to the 0 character, instead of
a space.
Sets the fill character for left padding to the
.Ql 0
character, instead of a space.
.It space
Reserves a space at the front of non-negative signed output fields.
A
@ -186,31 +201,28 @@ overrides a space if both are used.
.El
.Pp
Then the following fields:
.Bl -tag -width Ds
.It Cm size
.Bl -tag -width indent
.It Ar size
An optional decimal digit string specifying the minimum field width.
.It Cm prec
.It Ar prec
An optional precision composed of a decimal point
.Sq Cm \&.
and a decimal digit string that indicates the maximum string length,
the number of digits to appear after the decimal point in floating point
output, or the minimum number of digits to appear in numeric output.
.It Cm fmt
.It Ar fmt
An optional output format specifier which is one of
.Cm D ,
.Cm O ,
.Cm U ,
.Cm X ,
.Cm F ,
.Cm D , O , U , X , F ,
or
.Cm S .
These represent signed decimal output, octal output, unsigned decimal
output, hexadecimal output, floating point output, and string output,
respectively.
Some output formats do not apply to all fields.
Floating point output only applies to timespec fields (the
.Cm a ,
.Cm m ,
Floating point output only applies to
.Vt timespec
fields (the
.Cm a , m ,
and
.Cm c
fields).
@ -219,10 +231,12 @@ The special output specifier
.Cm S
may be used to indicate that the output, if
applicable, should be in string format.
May be used in combination with
.Bl -tag -width Ds
May be used in combination with:
.Bl -tag -width indent
.It Cm amc
Display date in strftime(3) format.
Display date in
.Xr strftime 3
format.
.It Cm dr
Display actual device name.
.It Cm gu
@ -231,7 +245,7 @@ Display group or user name.
Display the mode of
.Ar file
as in
.Ic ls -lTd .
.Nm ls Fl lTd .
.It Cm N
Displays the name of
.Ar file .
@ -239,68 +253,92 @@ Displays the name of
Displays the type of
.Ar file .
.It Cm Y
Insert a `` -\*[Gt] '' into the output.
Insert a
.Dq Li " -\*[Gt] "
into the output.
Note that the default output format
for
.Cm Y
is a string, but if specified explicitly, these four characters are
prepended.
.El
.It Cm sub
.It Ar sub
An optional sub field specifier (high, middle, low).
Only applies to
the
.Cm p ,
.Cm d ,
.Cm r ,
.Cm p , d , r ,
and
.Cm T
output formats.
It can be one of the following:
.Bl -tag -width Ds
.Bl -tag -width indent
.It Cm H
``High'' -- specifies the major number for devices from
.Dq High
\[em]
specifies the major number for devices from
.Cm r
or
.Cm d ,
the ``user'' bits for permissions from the string form of
the
.Dq user
bits for permissions from the string form of
.Cm p ,
the file ``type'' bits from the numeric forms of
the file
.Dq type
bits from the numeric forms of
.Cm p ,
and the long output form of
.Cm T .
.It Cm L
``Low'' -- specifies the minor number for devices from
.Dq Low
\[em]
specifies the minor number for devices from
.Cm r
or
.Cm d ,
the ``other'' bits for permissions from the string form of
the
.Dq other
bits for permissions from the string form of
.Cm p ,
the ``user'', ``group'', and ``other'' bits from the numeric forms of
the
.Dq user ,
.Dq group ,
and
.Dq other
bits from the numeric forms of
.Cm p ,
and the
.Ic ls -F
.Nm ls Fl F
style output character for file type when used with
.Cm T
(the use of
.Cm L
for this is optional).
.It Cm M
``Middle'' -- specifies the ``group'' bits for permissions from the
.Dq Middle
\[em]
specifies the
.Dq group
bits for permissions from the
string output form of
.Cm p ,
or the ``suid'', ``sgid'', and ``sticky'' bits for the numeric forms of
or the
.Dq suid ,
.Dq sgid ,
and
.Dq sticky
bits for the numeric forms of
.Cm p .
.El
.It Cm datum
.It Ar datum
A required field specifier, being one of the following:
.Bl -tag -width Ds
.Bl -tag -width indent
.It Cm d
Device upon which
.Ar file
resides.
.It Cm i
.Ar file Ap s
.Ar file Ns 's
inode number.
.It Cm p
File type and permissions.
@ -308,8 +346,8 @@ File type and permissions.
Number of hard links to
.Ar file .
.It Cm u , g
User-id and group-id of
.Ar file Ap s
User ID and group ID of
.Ar file Ns 's
owner.
.It Cm r
Device number for character and block device special files.
@ -335,20 +373,28 @@ Inode generation number.
.El
.Pp
The following four field specifiers are not drawn directly from the
data in struct stat, but are
.Bl -tag -width Ds
data in
.Vt "struct stat" ,
but are:
.Bl -tag -width indent
.It Cm N
The name of the file.
.It Cm T
The file type, either as in
.Ic ls -F
or in a more descriptive form if the sub field specifier
.Nm ls Fl F
or in a more descriptive form if the
.Ar sub
field specifier
.Cm H
is given.
.It Cm Y
The target of a symbolic link.
.It Cm Z
Expands to ``major,minor'' from the rdev field for character or block
Expands to
.Dq major,minor
from the
.Va rdev
field for character or block
special devices and gives size output for all others.
.El
.El
@ -371,14 +417,19 @@ which default to
and
.Cm Y , T ,
and
.Cm N ,
.Cm N
which default to
.Cm S .
.Sh EXIT STATUS
.Nm
exits 0 on success, and \*[Gt]0 if an error occurred.
.Ex -std stat readlink
.Sh EXAMPLES
Given a symbolic link ``foo'' that points from /tmp/foo to /, you would use
Given a symbolic link
.Pa foo
that points from
.Pa /tmp/foo
to
.Pa / ,
you would use
.Nm
as follows:
.Bd -literal -offset indent
@ -389,7 +440,7 @@ lrwxrwxrwx 1 jschauma cs 1 Apr 24 16:37:28 2002 /tmp/foo@ -\*[Gt] /
drwxr-xr-x 16 root wheel 512 Apr 19 10:57:54 2002 /tmp/foo/
.Ed
.Pp
To initialize some shell-variables, you could use the
To initialize some shell variables, you could use the
.Fl s
flag as follows:
.Bd -literal -offset indent
@ -460,6 +511,7 @@ The
utility appeared in
.Nx 1.6 .
.Sh AUTHORS
.An -nosplit
The
.Nm
utility was written by

View File

@ -24,7 +24,6 @@
.\"
.\" $FreeBSD$
.\"
.\"
.Dd December 30, 2002
.Dt FWCONTROL 8
.Os
@ -51,9 +50,10 @@ utility is designed to provide a way for users to access and control the
FireWire subsystem.
Without options,
.Nm
will output a list of devices those are/were connected to the bus.
will output a list of devices that are/were connected to the bus.
.Pp
.Bl -tag -width indent
The following options are available:
.Bl -tag -width indent
.It Fl r
Initiate bus reset.
.It Fl t
@ -65,70 +65,77 @@ Hex dump of the configuration ROM.
.It Fl o Ar node
Send a link-on PHY packet to the node.
.It Fl s Ar node
Write to RESET_START register on the node.
Write to
.Dv RESET_START
register on the node.
.It Fl l Ar file
Load hex dump file of the configuration ROM and parse it.
.It Fl g Ar gap_count
Broadcast gap_count by phy_config packet.
Broadcast
.Ar gap_count
by phy_config packet.
.It Fl i Ar pri_req
Set PRIORITY_BUDGET register on all supported nodes.
Set
.Dv PRIORITY_BUDGET
register on all supported nodes.
.It Fl R Ar filename
Receive DV stream and dump it to a file. Use Ctl-C to stop the receiving.
Receive DV stream and dump it to a file.
Use Ctrl-C to stop the receiving.
Some DV cameras seem not to send the stream if a bus manager exits.
If you cannot get the stream, try the following commands.
If you cannot get the stream, try the following commands:
.Bd -literal -offset indent
sysctl hw.firewire.try_bmr=0; fwcontrol -r
sysctl hw.firewire.try_bmr=0
fwcontrol -r
.Ed
.Pp
The resulting file contains raw DV data excluding isochronus header
and CIP header. It can be handled by
.Ic libdv
in the ports collection.
and CIP header.
It can be handled by
.Nm libdv
in the
.Fx
Ports Collection.
.It Fl S Ar filename
Send a DV file as isochronus stream.
.El
.Sh EXAMPLES
Each DV frame has fixed size and it is easy to edit those frame order.
.Bd -literal -offset indent
fwcontrol -R original.dv
.Ed
.Pp
.Dl "fwcontrol -R original.dv"
.Pp
Receive stream.
.Bd -literal -offset indent
dd if=original.dv of=first.dv bs=120000 count=30
.Ed
.Pp
.Dl "dd if=original.dv of=first.dv bs=120000 count=30"
.Pp
Get first 30 frames(NTSC).
.Bd -literal -offset indent
dd if=original.dv of=second.dv bs=120000 skip=30 count=30
.Ed
.Pp
.Dl "dd if=original.dv of=second.dv bs=120000 skip=30 count=30"
.Pp
Get second 30 frames(NTSC).
.Bd -literal -offset indent
cat second.dv first.dv | fwcontrol -S /dev/stdin
.Ed
.Pp
.Dl "cat second.dv first.dv | fwcontrol -S /dev/stdin"
.Pp
Swap first and second 30 frames and send them to DV recorder.
.Pp
For PAL, replace 'bs=120000' with 'bs=144000'.
.Pp
For PAL, replace
.Dq Li bs=120000
with
.Dq Li bs=144000 .
.Sh FILES
.Bl -tag -width indent
.Bl -tag
.It Pa /dev/fw0
.El
.Sh SEE ALSO
.Xr firewire 4 ,
.Xr fwe 4 ,
.Xr fwohci 4 ,
.Xr sbp 4 ,
.Xr fwe 4
.Xr sbp 4
.Sh HISTORY
The
.Nm
utility first appeared in
.Fx 5.0 .
.Pp
.Sh AUTHORS
.An Hidetoshi Shimokawa Aq simokawa@FreeBSD.org
.Sh BUGS
This utility is still under development and provided for debug purpose.
.Pp