From owner-svn-src-stable@FreeBSD.ORG Thu Jul 11 15:45:52 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 597078FD; Thu, 11 Jul 2013 15:45:52 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 48C1B1685; Thu, 11 Jul 2013 15:45:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6BFjqdd022502; Thu, 11 Jul 2013 15:45:52 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6BFjpWO022498; Thu, 11 Jul 2013 15:45:51 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201307111545.r6BFjpWO022498@svn.freebsd.org> From: Warren Block Date: Thu, 11 Jul 2013 15:45:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r253211 - in stable/9: sbin/geom/class/part sbin/reboot sys/boot/i386/gptboot X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jul 2013 15:45:52 -0000 Author: wblock (doc committer) Date: Thu Jul 11 15:45:51 2013 New Revision: 253211 URL: http://svnweb.freebsd.org/changeset/base/253211 Log: MFC r245910,r247370,r249371,r252492,r252586: r252586: Add descriptions to the FILES list, fix some mdoc complaints, move the "neither" entry out of the table in BOOTING. r252492: Add a new gptboot(8) man page. Factor out the redundant information in gpart(8) and boot(8), adding references to gptboot(8) in both. r249371: Remove kernel options from the SYNOPSIS. They are already documented in the geom(4) manual page SYNOPSIS. r247370: Fix typo in EFI GPT GUID. r245910: Expand description of how gptboot and gptzfsboot choose a partition for booting. Added: stable/9/sys/boot/i386/gptboot/gptboot.8 - copied, changed from r252492, head/sys/boot/i386/gptboot/gptboot.8 Modified: stable/9/sbin/geom/class/part/gpart.8 stable/9/sbin/reboot/boot_i386.8 stable/9/sys/boot/i386/gptboot/Makefile Directory Properties: stable/9/sbin/geom/class/part/ (props changed) stable/9/sbin/reboot/ (props changed) stable/9/sys/boot/i386/gptboot/ (props changed) Modified: stable/9/sbin/geom/class/part/gpart.8 ============================================================================== --- stable/9/sbin/geom/class/part/gpart.8 Thu Jul 11 15:29:25 2013 (r253210) +++ stable/9/sbin/geom/class/part/gpart.8 Thu Jul 11 15:45:51 2013 (r253211) @@ -24,40 +24,13 @@ .\" .\" $FreeBSD$ .\" -.Dd January 3, 2013 +.Dd July 1, 2013 .Dt GPART 8 .Os .Sh NAME .Nm gpart .Nd "control utility for the disk partitioning GEOM class" .Sh SYNOPSIS -To add support for the disk partitioning GEOM class, -place one or more of the following -lines in the kernel configuration file: -.Bd -ragged -offset indent -.Cd "options GEOM_PART_APM" -.Cd "options GEOM_PART_BSD" -.Cd "options GEOM_PART_GPT" -.Cd "options GEOM_PART_LDM" -.Cd "options GEOM_PART_MBR" -.Cd "options GEOM_PART_EBR" -.Cd "options GEOM_PART_EBR_COMPAT" -.Cd "options GEOM_PART_PC98" -.Cd "options GEOM_PART_VTOC8" -.Ed -.Pp -These options provide support for the various types of partitioning -schemes supported by the -.Ns Nm -utility. -See -.Sx "PARTITIONING SCHEMES" -below for more details. -.Pp -Usage of the -.Ns Nm -utility: -.Pp .\" ==== ADD ==== .Nm .Cm add @@ -583,7 +556,7 @@ The system partition for computers that Interface (EFI). In such cases, the GPT partitioning scheme is used and the actual partition type for the system partition can also be specified as -.Qq Li "!c12a7328-f81f-11d2-ba4b-00a0c93ec93ab" . +.Qq Li "!c12a7328-f81f-11d2-ba4b-00a0c93ec93b" . .It Cm freebsd A .Fx @@ -672,14 +645,12 @@ The scheme-specific attributes for GPT: When set, the .Nm gptboot stage 1 boot loader will try to boot the system from this partition. -Multiple partitions might be marked with the +Multiple partitions can be marked with the .Cm bootme attribute. -In such scenario the -.Nm gptboot -will try all -.Cm bootme -partitions one by one, until the next boot stage is successfully entered. +See +.Xr gptboot 8 +for more details. .It Cm bootonce Setting this attribute automatically sets the .Cm bootme @@ -687,49 +658,14 @@ attribute. When set, the .Nm gptboot stage 1 boot loader will try to boot the system from this partition only once. -Partitions with both -.Cm bootonce -and -.Cm bootme -attributes are tried before partitions with only the -.Cm bootme -attribute. -Before -.Cm bootonce -partition is tried, the -.Nm gptboot -removes the -.Cm bootme -attribute and tries to execute the next boot stage. -If it fails, the -.Cm bootonce -attribute that is now alone is replaced with the -.Cm bootfailed -attribute. -If the execution of the next boot stage succeeds, but the system is not fully -booted, the -.Nm gptboot -will look for -.Cm bootonce -attributes alone (without the -.Cm bootme -attribute) on the next system boot and will replace those with the -.Cm bootfailed -attribute. -If the system is fully booted, the -.Pa /etc/rc.d/gptboot -start-up script will look for partition with the -.Cm bootonce -attribute alone, will remove the attribute and log that the system was -successfully booted from this partition. -There should be at most one -.Cm bootonce -partition when system is successfully booted. -Multiple partitions might be marked with the +Multiple partitions can be marked with the .Cm bootonce and .Cm bootme attribute pairs. +See +.Xr gptboot 8 +for more details. .It Cm bootfailed This attribute should not be manually managed. It is managed by the @@ -737,14 +673,9 @@ It is managed by the stage 1 boot loader and the .Pa /etc/rc.d/gptboot start-up script. -This attribute is used to mark partitions that had the -.Cm bootonce -attribute set, but we failed to boot from them. -Once we successfully boot, the -.Pa /etc/rc.d/gptboot -script will log all the partitions we failed to boot from and will remove the -.Cm bootfailed -attributes. +See +.Xr gptboot 8 +for more details. .El .Pp The scheme-specific attributes for MBR: @@ -807,34 +738,52 @@ Both types of bootstrap code are used to First, a protective MBR is embedded into the first disk sector from the .Pa /boot/pmbr image. -It searches the GPT +It searches through the GPT for a .Cm freebsd-boot partition (see the .Sx "PARTITION TYPES" -section) in the GPT and runs the next bootstrap stage from it. +section) and runs the next bootstrap stage from it. The .Cm freebsd-boot partition should be smaller than 545 KB. +It can be located either before or after other +.Fx +partitions on the disk. There are two variants of bootstrap code to write to this partition: .Pa /boot/gptboot and .Pa /boot/gptzfsboot . +.Pp +.Pa /boot/gptboot +is used to boot from UFS partitions. +.Cm gptboot +searches through +.Cm freebsd-ufs +partitions in the GPT and selects one to boot based on the +.Cm bootonce +and +.Cm bootme +attributes. +If neither attribute is found, .Pa /boot/gptboot -is used to boot from UFS. -It searches +boots from the first .Cm freebsd-ufs -GPT partitions and starts +partition. .Pa /boot/loader .Pq the third bootstrap stage -if found. -The +is loaded from the first partition that matches these conditions. +See +.Xr gptboot 8 +for more information. +.Pp .Pa /boot/gptzfsboot is used to boot from ZFS. -It searches +It searches through the GPT for .Cm freebsd-zfs -GPT partitions and starts +partitions, trying to detect ZFS pools. +After all pools are detected, .Pa /boot/zfsloader -if found. +is started from the first one found. .Pp The VTOC8 scheme does not support embedding bootstrap code. Instead, the 8 KBytes bootstrap code image @@ -945,7 +894,7 @@ The GEOM PART class can detect the same different GEOM providers, and some of them will be marked as corrupt. Be careful when choosing a provider for recovery. If you choose incorrectly you can destroy the metadata of another GEOM class, -e.g.\& GEOM MIRROR or GEOM LABEL. +e.g.,\& GEOM MIRROR or GEOM LABEL. .Sh SYSCTL VARIABLES The following .Xr sysctl 8 @@ -1115,7 +1064,8 @@ and .Xr dd 1 , .Xr geom 4 , .Xr boot0cfg 8 , -.Xr geom 8 +.Xr geom 8 , +.Xr gptboot 8 .Sh HISTORY The .Nm Modified: stable/9/sbin/reboot/boot_i386.8 ============================================================================== --- stable/9/sbin/reboot/boot_i386.8 Thu Jul 11 15:29:25 2013 (r253210) +++ stable/9/sbin/reboot/boot_i386.8 Thu Jul 11 15:45:51 2013 (r253211) @@ -36,7 +36,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 4, 2010 +.Dd July 1, 2013 .Dt BOOT 8 i386 .Os .Sh NAME @@ -352,6 +352,7 @@ requirement has not been adhered to. .Xr bsdlabel 8 , .Xr btxld 8 , .Xr config 8 , +.Xr gptboot 8 , .Xr halt 8 , .Xr loader 8 , .Xr nextboot 8 , Modified: stable/9/sys/boot/i386/gptboot/Makefile ============================================================================== --- stable/9/sys/boot/i386/gptboot/Makefile Thu Jul 11 15:29:25 2013 (r253210) +++ stable/9/sys/boot/i386/gptboot/Makefile Thu Jul 11 15:45:51 2013 (r253211) @@ -3,6 +3,7 @@ .PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../common ${.CURDIR}/../../common FILES= gptboot +MAN= gptboot.8 NM?= nm Copied and modified: stable/9/sys/boot/i386/gptboot/gptboot.8 (from r252492, head/sys/boot/i386/gptboot/gptboot.8) ============================================================================== --- head/sys/boot/i386/gptboot/gptboot.8 Mon Jul 1 22:38:36 2013 (r252492, copy source) +++ stable/9/sys/boot/i386/gptboot/gptboot.8 Thu Jul 11 15:45:51 2013 (r253211) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 1, 2013 +.Dd July 3, 2013 .Dt GPTBOOT 8 .Os .Sh NAME @@ -147,7 +147,8 @@ Middle priority: booting is attempted fr partitions with the .Cm bootme attribute. -.It neither +.El +.Pp If neither .Cm bootonce nor @@ -156,7 +157,6 @@ attributes are found on any partitions, first .Cm freebsd-ufs partition on the disk. -.El .Sh POST-BOOT ACTIONS The startup script .Pa /etc/rc.d/gptboot @@ -181,9 +181,12 @@ The attribute is cleared from the partition that successfully booted. There is normally only one of these. .Sh FILES -.Bl -tag -width /boot/loader -compact +.Bl -tag -width /boot/gptboot -compact .It Pa /boot/gptboot +bootcode binary .It Pa /boot.config +parameters for the boot blocks +.Pq optional .El .Sh EXAMPLES .Nm @@ -223,7 +226,6 @@ attribute: .Bd -literal -offset indent gpart set -a bootonce -i 2 ada0 .Ed -.Pp .Sh SEE ALSO .Xr boot.config 5 , .Xr rc.conf 5 ,