History log of /freebsd-current/sys/sys/gpt.h
Revision Date Author Comments
# 95ee2897 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix


# c4e20cad 27-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

sys/sys: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.


# 50875ed2 15-Oct-2016 Marcel Moolenaar <marcel@FreeBSD.org>

Re-apply change 306811 or alternatively, revert change 307385.


# 9ffbf09f 15-Oct-2016 Marcel Moolenaar <marcel@FreeBSD.org>

Revert change 306811 so that the change can be re-done using
svn copy instead of svn move. This to preserve history on
the originals headers as well.


# 0974f66d 07-Oct-2016 Marcel Moolenaar <marcel@FreeBSD.org>

In order to allow mkimg(1) (and other tools) to become a build tool
that can be compiled on various OSes (including on older versions
of FreeBSD), make it possible to have it include the partitioning
scheme definitions without pulling in FreeBSD specifics.
In particular this means:
o move the scheme definitions iand related defines to header files
under sys/disk,
o make them (more) portable by using uint#_t (where applicable)
and renaming defines so that they at least have a good prefix,
o make the new headers stand-alone so that they don't need FreeBSD
definitions, like struct uuid(*)
o keep the original headers for compatibility, but rewrite them to
get the scheme definitions from <sys/disk/$scheme.h>.

(*) since UUID/GUID type definitions are non-portable and the GPT
scheme uses them, make it possible to have the scheme definitions
use an external type by allowing consumers of the header to set
GPT_UUID_TYPE. When GPT_UUID_TYPE has not been defined, the header
will use it's own type definition, which is the same as struct uuid.
The gpt_uuid_t typedef is created to abstract the details and allows
consumers to refer to a single type.

There is not conflict between the partitioning scheme headers and
what is defined in them. All headers can be included in the same
source files.

Note: consumers of the old headers have not been changed yet. Such
will be done if and when needed/beneficial.

Reviewed by: imp, jhb
MFC after: 1 month
Sponsored by: Bracket Computing


# 9c0c355f 27-Dec-2015 Allan Jude <allanjude@FreeBSD.org>

Add some additional GPT partition types

4 ChromeOS GPT types
2 Microsoft partition types
the new OpenBSD partition type

Approved by: marcel (mentor)
MFC after: 1 week
Relnotes: yes
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D3841


# 4fb4ebe0 12-Mar-2015 Andrey V. Elsukov <ae@FreeBSD.org>

Add GUID and alias for Apple Core Storage partition.

PR: 196241
MFC after: 1 week


# 1ee0f089 04-Jul-2014 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

After EFI support was added to the installer, it needed to allow boot
partitions of types other than "freebsd-boot" (in particular, "efi").
This allows the removal of some nasty hacks for supporting PowerPC systems,
in particular aliasing freebsd-boot to apple-boot on APM and an IBM-specific
code on MBR.

This changes the installer to use the correct names, which also breaks a
degeneracy in the meaning of "freebsd-boot" that allows the addition
of support for some newer IBM systems that can boot from GPT in addition to
MBR. Since I have no idea how to detect which those systems are, leave
the default on IBM PPC systems as MBR for now.


# 3f15cdff 30-Jun-2014 Andrey V. Elsukov <ae@FreeBSD.org>

Linux uses its own UUID for data partitions.

MFC after: 1 week


# b4c388a0 11-Jun-2014 Andrey V. Elsukov <ae@FreeBSD.org>

Add UUIDs for DragonFlyBSD's partition types.

MFC after: 2 weeks


# eaf8c2c4 27-Dec-2013 Tai-hwa Liang <avatar@FreeBSD.org>

Fixing build bustage.


# 9cb1a196 26-Dec-2013 Dimitry Andric <dim@FreeBSD.org>

In sys/sys/gpt.h, add a missing backslash at the end of the
GPT_ENT_TYPE_VSANHDR define.

Pointy hat to: marck
MFC after: 2 weeks
X-MFC-With: r259925


# 5cc596c4 26-Dec-2013 Dmitry Morozovsky <marck@FreeBSD.org>

Add GPT UUID for VMware vSAN meta-data partition.

Approved by: ae
MFC after: 2 weeks


# f24a8224 25-May-2012 Marcel Moolenaar <marcel@FreeBSD.org>

Add a partition type for nandfs to the apm, bsd, gpt and vtoc8 schemes.
The gpart alias for these partition types is "freebsd-nandfs".


# b20e4de3 18-Apr-2012 Dmitry Morozovsky <marck@FreeBSD.org>

VMware environments are not unusual now. Add VMware partitions recognition
(both MBR for ESXi <= 4.1 and GPT for ESXi 5) to g_part.

Reviewed by: ae
Approved by: ae
MFC after: 2 weeks


# 88007f61 28-Jan-2011 Andrey V. Elsukov <ae@FreeBSD.org>

Add new user-friendly aliases for partition types for the MBR and
EBR schemes: fat32, ebr, linux-data, linux-raid, linux-swap and
linux-lvm. Add bios-boot GUID and alias for the GPT scheme. It used by
GRUB 2 loader. Also do sorting definitions of types in diskmbr.h
and in g_part.c.

PR: bin/120990, kern/147664
MFC after: 2 weeks


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# 6efb3e34 24-Sep-2010 Pawel Jakub Dawidek <pjd@FreeBSD.org>

Add three GPT attributes:

GPT_ENT_ATTR_BOOTME - this is bootable partition

GPT_ENT_ATTR_BOOTONCE - try to boot only once from this partition

GPT_ENT_ATTR_BOOTFAILED - set this flag if we cannot boot from partition
containing GPT_ENT_ATTR_BOOTONCE flag; note that if we cannot
boot from partition that contains only GPT_ENT_ATTR_BOOTME flag,
the GPT_ENT_ATTR_BOOTFAILED flag won't be set

According to wikipedia Microsoft TechNet says that attributes are divided into
two halves: the lower 4 bytes representing partition independent attributes,
and the upper 4 bytes are partition type dependent. Microsoft is already using
bits 60 (read-only), 62 (hidden) and 63 (do not automount) and I'd like to not
collide with those, so we are using bit 59 (bootme), 58 (bootonce) and 57
(bootfailed).

Reviewed by: arch (Message-ID: <20100917234542.GE1902@garage.freebsd.pl>)
MFC after: 2 weeks


# f85c1a35 23-May-2010 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

MFC r200534,200535:

Simplify partition type parsing by using a data-oriented model.
While there add more Apple and Linux partition types.

This unbreaks the build after r208341.

Reported by: many
Pointy hat to: me


# ee085c33 14-Dec-2009 Rui Paulo <rpaulo@FreeBSD.org>

Add more Apple partition types.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# f877ae62 05-Sep-2008 Rui Paulo <rpaulo@FreeBSD.org>

Add a couple more Apple GPT entries and NetBSD GPT entries.


# f352a0d4 24-Oct-2007 John Baldwin <jhb@FreeBSD.org>

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)


# a6ef2fb2 21-Oct-2007 Marcel Moolenaar <marcel@FreeBSD.org>

Add a UUID for ZFS file systems.

UUID reused from: Craig Boston


# 97b94c0e 22-Jun-2006 Marcel Moolenaar <marcel@FreeBSD.org>

Add the UUID of Apple's HFS file system as can be found in the Intel
based Macs.


# 2d48a58f 17-Sep-2005 Marcel Moolenaar <marcel@FreeBSD.org>

o Change the type of the ent_name field from short to uint16_t.
UTF-16 characters are not negative.
o Change the corresponding comment from UNICODE-16 to UTF-16.
There's no such thing as UNICODE-16.


# 60727d8b 06-Jan-2005 Warner Losh <imp@FreeBSD.org>

/* -> /*- for license, minor formatting changes


# 4f72649f 02-Aug-2004 Marcel Moolenaar <marcel@FreeBSD.org>

Remove GPT_ENT_TYPE_FREEBSD_UFS2. It was speculatively added before
UFS2 was here. It so happened that UFS2 did not need a seperate
partition type. Keep the definition as a comment for documentation
purposes. If there is a benefit for UFS2 file systems to have a
seperate partition type under GPT, then this definition should be
restored as that was the intention of the definition.


# c7c8cf8b 10-Nov-2002 Marcel Moolenaar <marcel@FreeBSD.org>

o Include <sys/uuid.h>. This avoids that applications such as
gpt(8) have to include both <sys/uuid.h> and <uuid.h> only
because they include <sys/gpt.h> before <uuid.h>.
o Drop the triple bang in the unicode comment in favor of
adding '-16' to make it explicit that the unicode characters
are 16-bit. The fact that we use short as the type of the
array does give it away; but only to the careful reader.


# fb584e48 03-Nov-2002 Marcel Moolenaar <marcel@FreeBSD.org>

Add GPT entry types for partitions we're likely to encounter in the
wild. These include MS partitions and Linux partitions. At this time
there's no evidence that HP-UX uses GPT.


# 78dff92b 30-May-2002 Marcel Moolenaar <marcel@FreeBSD.org>

Don't use an incomplete array type to mark the start of the padding
because the padding should be inserted before the array and not after
it, as is done by GCC 3.1. Instead use an explicit uint32_t field
to get what was intended and on top of that make the size of the
padding explicit. This also doesn't depend on a C99 feature.
While here, expand the comment. Just to make a point.

Pointed out by: fanf


# 2e1cdcf3 29-May-2002 Marcel Moolenaar <marcel@FreeBSD.org>

o Remove GCC specific attribute packed.
o Add incomplete array padding.


# cd849834 28-May-2002 Marcel Moolenaar <marcel@FreeBSD.org>

Add attribute packed to struct gpt_hdr to avoid unwanted padding at
the end of the struct to make it an integral number of "longs" on
64-bit architectures. The size of the struct must be 92, not 96.


# bcd46c60 28-May-2002 Marcel Moolenaar <marcel@FreeBSD.org>

Add support to GEOM for GUID Partition Tables (GPTs). The support
is currently conditional on both the GEOM and GEOM_GPT options to
avoid getting GPT by default and having the MBR and GPT classes
clash.
The correct behaviour of the MBR class would be to back-off (reject)
a MBR if it's a Protective MBR (a MBR with a single partition of type
0xEE that spans the whole disk (as far as the MBR is concerned).
The correct behaviour if the GPT class would be to back-off (reject)
a GPT if there's a MBR that's not a Protective MBR.

At this stage it's inconvenient to destroy a good MBR when working
with GPTs that it's more convenient to have the MBR class back-off
when it detects the GPT signature on disk and have the GPT class
ignore the MBR.

In sys/gpt.h UUIDs (GUIDs) for the following FreeBSD partitions
have been defined:

GPT_ENT_TYPE_FREEBSD
FreeBSD slice with disklabel. This is the equivalent of
the well-known FreeBSD MBR partition type.
GPT_ENT_TYPE_FREEBSD_{SWAP|UFS|UFS2|VINUM}
FreeBSD partitions in the context of disklabel. This is
speculating on the idea to use the GPT to hold partitions
instead if slices and removing the fixed (and low) limits
we have on the number of partitions.

This commit lacks a GPT image for the regression suite.