head	1.9;
access;
symbols
	RELENG_7_4_0_RELEASE:1.7.2.1.8.1
	RELENG_7_4:1.7.2.1.0.8
	RELENG_7_4_BP:1.7.2.1
	RELENG_7_3_0_RELEASE:1.7.2.1.6.1
	RELENG_7_3:1.7.2.1.0.6
	RELENG_7_3_BP:1.7.2.1
	RELENG_7_2_0_RELEASE:1.7.2.1.4.1
	RELENG_7_2:1.7.2.1.0.4
	RELENG_7_2_BP:1.7.2.1
	RELENG_7_1_0_RELEASE:1.7.2.1.2.1
	RELENG_6_4_0_RELEASE:1.6.8.2.2.1
	RELENG_7_1:1.7.2.1.0.2
	RELENG_7_1_BP:1.7.2.1
	RELENG_6_4:1.6.8.2.0.2
	RELENG_6_4_BP:1.6.8.2
	RELENG_7_0_0_RELEASE:1.7
	RELENG_6_3_0_RELEASE:1.6.8.1
	RELENG_7_0:1.7.0.4
	RELENG_7_0_BP:1.7
	RELENG_6_3:1.6.8.1.0.8
	RELENG_6_3_BP:1.6.8.1
	RELENG_7:1.7.0.2
	RELENG_7_BP:1.7
	RELENG_6_2_0_RELEASE:1.6.8.1
	RELENG_6_2:1.6.8.1.0.6
	RELENG_6_2_BP:1.6.8.1
	RELENG_5_5_0_RELEASE:1.6
	RELENG_5_5:1.6.0.10
	RELENG_5_5_BP:1.6
	RELENG_6_1_0_RELEASE:1.6.8.1
	RELENG_6_1:1.6.8.1.0.4
	RELENG_6_1_BP:1.6.8.1
	RELENG_6_0_0_RELEASE:1.6.8.1
	RELENG_6_0:1.6.8.1.0.2
	RELENG_6_0_BP:1.6.8.1
	RELENG_6:1.6.0.8
	RELENG_6_BP:1.6
	RELENG_5_4_0_RELEASE:1.6
	RELENG_5_4:1.6.0.6
	RELENG_5_4_BP:1.6
	RELENG_5_3_0_RELEASE:1.6
	RELENG_5_3:1.6.0.4
	RELENG_5_3_BP:1.6
	RELENG_5:1.6.0.2
	RELENG_5_BP:1.6
	RELENG_5_2_1_RELEASE:1.4
	RELENG_5_2_0_RELEASE:1.4
	RELENG_5_2:1.4.0.6
	RELENG_5_2_BP:1.4
	RELENG_5_1_0_RELEASE:1.4
	RELENG_5_1:1.4.0.4
	RELENG_5_1_BP:1.4
	RELENG_5_0_0_RELEASE:1.4
	RELENG_5_0:1.4.0.2
	RELENG_5_0_BP:1.4;
locks; strict;
comment	@# @;


1.9
date	2008.08.30.17.05.28;	author svn2cvs;	state dead;
branches;
next	1.8;

1.8
date	2007.10.24.21.32.57;	author jhb;	state Exp;
branches;
next	1.7;

1.7
date	2005.09.01.02.49.20;	author marcel;	state Exp;
branches
	1.7.2.1;
next	1.6;

1.6
date	2004.08.07.07.41.37;	author marcel;	state Exp;
branches
	1.6.8.1;
next	1.5;

1.5
date	2004.02.23.20.13.52;	author johan;	state Exp;
branches;
next	1.4;

1.4
date	2002.12.01.02.10.34;	author marcel;	state Exp;
branches;
next	1.3;

1.3
date	2002.10.27.03.23.05;	author marcel;	state Exp;
branches;
next	1.2;

1.2
date	2002.10.25.05.23.08;	author marcel;	state Exp;
branches;
next	1.1;

1.1
date	2002.07.20.19.27.43;	author peter;	state Exp;
branches;
next	;

1.7.2.1
date	2008.01.24.19.42.15;	author jhb;	state Exp;
branches
	1.7.2.1.2.1
	1.7.2.1.4.1
	1.7.2.1.6.1
	1.7.2.1.8.1;
next	1.7.2.2;

1.7.2.2
date	2012.11.17.08.03.36;	author svnexp;	state Exp;
branches;
next	;

1.7.2.1.2.1
date	2008.11.25.02.59.29;	author kensmith;	state Exp;
branches;
next	;

1.7.2.1.4.1
date	2009.04.15.03.14.26;	author kensmith;	state Exp;
branches;
next	;

1.7.2.1.6.1
date	2010.02.10.00.26.20;	author kensmith;	state Exp;
branches;
next	;

1.7.2.1.8.1
date	2010.12.21.17.10.29;	author kensmith;	state Exp;
branches;
next	1.7.2.1.8.2;

1.7.2.1.8.2
date	2012.11.17.08.16.54;	author svnexp;	state Exp;
branches;
next	;

1.6.8.1
date	2005.09.06.23.59.01;	author marcel;	state Exp;
branches;
next	1.6.8.2;

1.6.8.2
date	2008.01.24.22.23.21;	author jhb;	state Exp;
branches
	1.6.8.2.2.1;
next	1.6.8.3;

1.6.8.3
date	2012.11.17.07.41.17;	author svnexp;	state Exp;
branches;
next	;

1.6.8.2.2.1
date	2008.10.02.02.57.24;	author kensmith;	state Exp;
branches;
next	;


desc
@@


1.9
log
@Fixup exporter glitch.  sbin/gpt/* was removed in rev 179690.
@
text
@# $FreeBSD: src/sbin/gpt/Makefile,v 1.8 2007/10/24 21:32:57 jhb Exp $

PROG=	gpt
SRCS=	add.c boot.c create.c destroy.c gpt.c label.c map.c migrate.c \
	recover.c remove.c show.c
WARNS?=	4
MAN=	gpt.8

.include <bsd.prog.mk>
@


1.8
log
@First cut at support for booting a GPT labeled disk via the BIOS bootstrap
on i386 and amd64 machines.  The overall process is that /boot/pmbr lives
in the PMBR (similar to /boot/mbr for MBR disks) and is responsible for
locating and loading /boot/gptboot.  /boot/gptboot is similar to /boot/boot
except that it groks GPT rather than MBR + bsdlabel.  Unlike /boot/boot,
/boot/gptboot lives in its own dedicated GPT partition with a new
"FreeBSD boot" type.  This partition does not have a fixed size in that
/boot/pmbr will load the entire partition into the lower 640k.  However,
it is limited in that it can only be 545k.  That's still a lot better than
the current 7.5k limit for boot2 on MBR.  gptboot mostly acts just like
boot2 in that it reads /boot.config and loads up /boot/loader.  Some more
details:
- Include uuid_equal() and uuid_is_nil() in libstand.
- Add a new 'boot' command to gpt(8) which makes a GPT disk bootable using
  /boot/pmbr and /boot/gptboot.  Note that the disk must have some free
  space for the boot partition.
  - This required exposing the backend of the 'add' function as a
    gpt_add_part() function to the rest of gpt(8).  'boot' uses this to
    create a boot partition if needed.
- Don't cripple cgbase() in the UFS boot code for /boot/gptboot so that
  it can handle a filesystem > 1.5 TB.
- /boot/gptboot has a simple loader (gptldr) that doesn't do any I/O
  unlike boot1 since /boot/pmbr loads all of gptboot up front.  The
  C portion of gptboot (gptboot.c) has been repocopied from boot2.c.
  The primary changes are to parse the GPT to find a root filesystem
  and to use 64-bit disk addresses.  Currently gptboot assumes that the
  first UFS partition on the disk is the / filesystem, but this algorithm
  will likely be improved in the future.
- Teach the biosdisk driver in /boot/loader to understand GPT tables.
  GPT partitions are identified as 'disk0pX:' (e.g. disk0p2:) which is
  similar to the /dev names the kernel uses (e.g. /dev/ad0p2).
- Add a new "freebsd-boot" alias to g_part() for the new boot UUID.

MFC after:	1 month
Discussed with:	marcel (some things might still change, but am committing
			what I have so far)
@
text
@d1 1
a1 1
# $FreeBSD$
@


1.7
log
@Add support for setting GPT partition labels. The partitions to be
labeled are selected in the same way as with the remove command.
Update the manpage to have the selection options described for the
label command and referenced to it from the remove command.
The label can be specified on the command line with the -l option
or read from a file with the -f option. In both cases, the label
is assumed to be encoded in UTF-8.

PR: ia64/83124
MFC after: 1 week
@
text
@d4 2
a5 2
SRCS=	add.c create.c destroy.c gpt.c label.c map.c migrate.c recover.c \
	remove.c show.c
@


1.7.2.1
log
@MFC: Add support for booting from GPT-labeled disks from the BIOS.  This
includes /boot/pmbr, /boot/gptboot, and 'gpt boot'.
@
text
@d4 2
a5 2
SRCS=	add.c boot.c create.c destroy.c gpt.c label.c map.c migrate.c \
	recover.c remove.c show.c
@


1.7.2.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: stable/7/sbin/gpt/Makefile 175646 2008-01-24 19:42:17Z jhb $
@


1.7.2.1.8.1
log
@SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith

Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release.

Approved by:	re (implicit)
@
text
@@


1.7.2.1.8.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/7.4/sbin/gpt/Makefile 175646 2008-01-24 19:42:17Z jhb $
@


1.7.2.1.6.1
log
@SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith

Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process.

Approved by:	re (implicit)
@
text
@@


1.7.2.1.4.1
log
@SVN rev 191087 on 2009-04-15 03:14:26Z by kensmith

Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.

Approved by:	re (implicit)
@
text
@@


1.7.2.1.2.1
log
@SVN rev 185281 on 2008-11-25 02:59:29Z by kensmith

Create releng/7.1 in preparation for moving into RC phase of 7.1 release
cycle.

Approved by:	re (implicit)
@
text
@@


1.6
log
@Implement a remove command. The remove command iterates the GPT
partitions and removes any that matches the pre-conditions. The
options are the same for the add command and are used to select
the partitions to remove.
Currently the remove command without any options deletes all GPT
partitions. This is rather harmful and will need anti-footshooting
measures.
@
text
@d4 2
a5 2
SRCS=	add.c create.c destroy.c gpt.c map.c migrate.c recover.c remove.c \
	show.c
@


1.6.8.1
log
@Sync with HEAD:
	Makefile: 1.7
	add.c: 1.12, 1.23
	create.c: 1.11
	destroy.c: 1.6
	gpt.8: 1.14, 1.15
	gpt.c: 1.11, 1.12, 1.13
	gpt.h: 1.8, 1.9, 1.10
	label.c: 1.1
	map.c: 1.6
	map.h: 1.6
	migrate.c: 1.14, 1.15, 1.16
	recover.c: 1.8
	remove.c: 1.5, 1.6, 1.7, 1.8
	show.c: 1.12, 1.13
o  New -l and -u options to the show command,
o  New label command to support GPT labels,
o  The remove command doesn't print the total partitions removed,
   as it prints each partition it removes by name already,
o  Added ellipsis to most usage messages.

PR: ia64/83124
Approved by: re (scottl)
@
text
@d4 2
a5 2
SRCS=	add.c create.c destroy.c gpt.c label.c map.c migrate.c recover.c \
	remove.c show.c
@


1.6.8.2
log
@MFC: Add support for booting from GPT-labeled disks from the BIOS.  This
includes /boot/pmbr, /boot/gptboot, and 'gpt boot'.
@
text
@d4 2
a5 2
SRCS=	add.c boot.c create.c destroy.c gpt.c label.c map.c migrate.c \
	recover.c remove.c show.c
@


1.6.8.3
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: stable/6/sbin/gpt/Makefile 175651 2008-01-24 22:23:22Z jhb $
@


1.6.8.2.2.1
log
@SVN rev 183531 on 2008-10-02 02:57:24Z by kensmith

Create releng/6.4 from stable/6 in preparation for 6.4-RC1.

Approved by:	re (implicit)
@
text
@@


1.5
log
@style.Makefile(5):
	Use WARNS?= instead of WARNS=.
@
text
@d4 2
a5 1
SRCS=	add.c create.c destroy.c gpt.c map.c migrate.c recover.c show.c
@


1.4
log
@Add a manpage. Nobody expects the spanish inquisition, but the
mdoc(7) police... It's all yours ru :-)

Approved by: re (blanket)
@
text
@d5 1
a5 1
WARNS=	4
@


1.3
log
@o  Add functionality to add a GPT partition,
o  Use DCE compliant UUID functions and provide local
   implementations if they don't exist,
o  Move dumping of the map to show.c and print the
   partition type,
o  Some cleanups and rearrangements.

The default GPT partition type is UFS. When no starting block
or size are specified, the tool will create a partition in the
first free space it find (or that fits, depending on the size).
@
text
@d6 1
a6 1
NOMAN=	not yet
@


1.2
log
@Add the functionality to create an (empty) GPT from scratch. The
code is directly copied from migrate.c. The intend is to express
migrate in terms of create and add. The functionality to add
partitions is not yet there.
@
text
@d4 1
a4 1
SRCS=	create.c destroy.c gpt.c map.c migrate.c recover.c show.c
@


1.1
log
@Grab a snapshot of Marcel's gpt tool.  This is still a work-in-progress
but is useful to have handy.  EFI GPT partitions are used instead of the
fdisk+disklabel combination.  They are pure 64 bit LBA, are fully
extensible, support up to 16383 partitons per disk, etc.
@
text
@d4 1
a4 1
SRCS=	destroy.c gpt.c map.c migrate.c recover.c show.c
@

