[BACK]Return to cpu_rootconf.9 CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / share / man / man9

File: [cvs.NetBSD.org] / src / share / man / man9 / cpu_rootconf.9 (download)

Revision 1.10, Wed Nov 26 20:46:46 2014 UTC (9 years, 4 months ago) by wiz
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-base, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, phil-wifi, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, netbsd-10-base, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, matt-nb8-mediatek-base, matt-nb8-mediatek, localcount-20160914, is-mlppp-base, is-mlppp, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan, HEAD
Changes since 1.9: +17 -12 lines

New sentence, new line. Use more markup. Sort SEE ALSO.

.\"     $NetBSD: cpu_rootconf.9,v 1.10 2014/11/26 20:46:46 wiz Exp $
.\"
.\" Copyright (c) 2002 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to The NetBSD Foundation
.\" by Gregory McGarry.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd November 11, 2014
.Dt CPU_ROOTCONF 9
.Os
.Sh NAME
.Nm cpu_rootconf ,
.Nm rootconf ,
.Nm setroot
.Nd root file system setup
.Sh SYNOPSIS
.In sys/types.h
.In sys/systm.h
.Ft void
.Fn cpu_rootconf "void"
.Ft void
.Fn rootconf "void"
.Ft void
.Fn setroot "device_t bootdv" "int bootpartition"
.Sh DESCRIPTION
The
.Fn cpu_rootconf
is a machine-dependent interface invoked during system bootstrap to
determine the root file system device and initialize machine-dependent
file system state.
.Fn cpu_rootconf
provides the global variables
.Fa booted_device ,
.Fa booted_partition ,
.Fa booted_startblk ,
.Fa booted_nblks ,
and
.Fa bootspec .
.Fa cpu_rootconf
invokes the machine-independent function
.Fa rootconf
which calls the function
.Fa setroot
to record the root device and the root partition information
for use in machine-independent code.
.Pp
.Fa rootconf
may adjust the global variables and determines the parameters
for setroot.
This is for example used to translate a device
and partition number provided by the bootloader into a disk
wedge device covering the same partition.
.Pp
If the bootloader already identified a disk wedge, it passes
a non-zero value for
.Fa booted_nblks ,
then
.Fa booted_startblk
and
.Fa booted_nblks
specify a disk wedge as the boot device.
.Pp
.Fa setroot
evaluates several sources to identify the root device in the
following order until a valid device is selected:
.Bl -enum
.It
The kernel configuration variable
.Fa rootspec
which is set by
.Xr config 1 .
The value is the name and unit of the root device, e.g., "sd0" (disk)
or "dk0" (wedge) or "le0" (network) or the prefix "wedge:" followed
by the name of the disk wedge.
For disk devices the partition passed as argument to
.Fa setroot
is used.
.It
The variable
.Fa bootspec
following the same syntax.
.It
The result of an interactive query of the root device if
.Fa boothowto
has set the flag
.Dv RB_ASKNAME .
The input uses the same syntax as the previous sources.
Here also the kernel dump device is queried.
.It
The boot device and partition passed as arguments.
.El
.Pp
If a root device cannot be selected,
.Fa setroot
sets the
.Dv RB_ASKNAME
flag and loops.
.Pp
Otherwise the kernel dump device is identified in a similar
manner from
.Bl -enum
.It
The result of a previous interactive query.
See above.
.It
The kernel configuration variable
.Fa dumpspec ,
if set.
.It
The second partition of the root device, if it is a regular disk.
.It
The first disk wedge device of type DKW_PTYPE_SWAP.
.El
.Sh SEE ALSO
.Xr config 1 ,
.Xr dk 4 ,
.Xr boot 8 ,
.Xr boothowto 9