path: root/sys/sys/gpt.h
Commit message (Collapse)AuthorAgeFilesLines
* sys/sys: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=326256
* Re-apply change 306811 or alternatively, revert change 307385.Marcel Moolenaar2016-10-161-175/+2
| | | | Notes: svn path=/head/; revision=307386
* Revert change 306811 so that the change can be re-done usingMarcel Moolenaar2016-10-161-2/+175
| | | | | | | | svn copy instead of svn move. This to preserve history on the originals headers as well. Notes: svn path=/head/; revision=307385
* In order to allow mkimg(1) (and other tools) to become a build toolMarcel Moolenaar2016-10-071-175/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=306811
* Add some additional GPT partition typesAllan Jude2015-12-271-4/+20
| | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=292788
* Add GUID and alias for Apple Core Storage partition.Andrey V. Elsukov2015-03-121-0/+2
| | | | | | | | PR: 196241 MFC after: 1 week Notes: svn path=/head/; revision=279935
* After EFI support was added to the installer, it needed to allow bootNathan Whitehorn2014-07-041-0/+2
| | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=268256
* Linux uses its own UUID for data partitions.Andrey V. Elsukov2014-07-011-1/+2
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=268089
* Add UUIDs for DragonFlyBSD's partition types.Andrey V. Elsukov2014-06-111-0/+19
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=267355
* Fixing build bustage.Tai-hwa Liang2013-12-271-1/+1
| | | | Notes: svn path=/head/; revision=259938
* In sys/sys/gpt.h, add a missing backslash at the end of theDimitry Andric2013-12-261-1/+1
| | | | | | | | | | | GPT_ENT_TYPE_VSANHDR define. Pointy hat to: marck MFC after: 2 weeks X-MFC-With: r259925 Notes: svn path=/head/; revision=259926
* Add GPT UUID for VMware vSAN meta-data partition.Dmitry Morozovsky2013-12-261-0/+2
| | | | | | | | Approved by: ae MFC after: 2 weeks Notes: svn path=/head/; revision=259925
* Add a partition type for nandfs to the apm, bsd, gpt and vtoc8 schemes.Marcel Moolenaar2012-05-251-2/+4
| | | | | | | The gpart alias for these partition types is "freebsd-nandfs". Notes: svn path=/head/; revision=236023
* VMware environments are not unusual now. Add VMware partitions recognitionDmitry Morozovsky2012-04-181-0/+7
| | | | | | | | | | | (both MBR for ESXi <= 4.1 and GPT for ESXi 5) to g_part. Reviewed by: ae Approved by: ae MFC after: 2 weeks Notes: svn path=/head/; revision=234417
* Add new user-friendly aliases for partition types for the MBR andAndrey V. Elsukov2011-01-281-0/+6
| | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=218014
* Add three GPT attributes:Pawel Jakub Dawidek2010-09-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=213133
* Add more Apple partition types.Rui Paulo2009-12-141-0/+6
| | | | Notes: svn path=/head/; revision=200535
* Add a couple more Apple GPT entries and NetBSD GPT entries.Rui Paulo2008-09-051-0/+21
| | | | Notes: svn path=/head/; revision=182796
* First cut at support for booting a GPT labeled disk via the BIOS bootstrapJohn Baldwin2007-10-241-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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) Notes: svn path=/head/; revision=172940
* Add a UUID for ZFS file systems.Marcel Moolenaar2007-10-211-0/+2
| | | | | | | UUID reused from: Craig Boston Notes: svn path=/head/; revision=172853
* Add the UUID of Apple's HFS file system as can be found in the IntelMarcel Moolenaar2006-06-221-0/+3
| | | | | | | based Macs. Notes: svn path=/head/; revision=159866
* o Change the type of the ent_name field from short to uint16_t.Marcel Moolenaar2005-09-171-1/+1
| | | | | | | | | 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. Notes: svn path=/head/; revision=150239
* /* -> /*- for license, minor formatting changesWarner Losh2005-01-071-1/+1
| | | | Notes: svn path=/head/; revision=139825
* Remove GPT_ENT_TYPE_FREEBSD_UFS2. It was speculatively added beforeMarcel Moolenaar2004-08-021-2/+7
| | | | | | | | | | | 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. Notes: svn path=/head/; revision=133024
* o Include <sys/uuid.h>. This avoids that applications such asMarcel Moolenaar2002-11-101-1/+3
| | | | | | | | | | | | 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. Notes: svn path=/head/; revision=106739
* Add GPT entry types for partitions we're likely to encounter in theMarcel Moolenaar2002-11-031-0/+23
| | | | | | | | wild. These include MS partitions and Linux partitions. At this time there's no evidence that HP-UX uses GPT. Notes: svn path=/head/; revision=106390
* Don't use an incomplete array type to mark the start of the paddingMarcel Moolenaar2002-05-311-1/+8
| | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=97644
* o Remove GCC specific attribute packed.Marcel Moolenaar2002-05-301-1/+2
| | | | | | | o Add incomplete array padding. Notes: svn path=/head/; revision=97537
* Add attribute packed to struct gpt_hdr to avoid unwanted padding atMarcel Moolenaar2002-05-291-1/+1
| | | | | | | | 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. Notes: svn path=/head/; revision=97437
* Add support to GEOM for GUID Partition Tables (GPTs). The supportMarcel Moolenaar2002-05-281-0/+78
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. Notes: svn path=/head/; revision=97392