]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/shared/gpt.h
Merge pull request #2719 from evverx/add-test-to-makefile
[thirdparty/systemd.git] / src / shared / gpt.h
CommitLineData
0ef6f454
LP
1#pragma once
2
e48fdd84
LP
3/***
4 This file is part of systemd.
5
6 Copyright 2014 Lennart Poettering
7
8 systemd is free software; you can redistribute it and/or modify it
9 under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or
11 (at your option) any later version.
12
13 systemd is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public License
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
20***/
21
6017365a
LP
22#include <endian.h>
23
e48fdd84
LP
24#include "sd-id128.h"
25
f827e09f 26/* We only support root disk discovery for x86, x86-64, Itanium and ARM for
a86eae57
LP
27 * now, since EFI for anything else doesn't really exist, and we only
28 * care for root partitions on the same disk as the EFI ESP. */
cbd353ce
LP
29
30#define GPT_ROOT_X86 SD_ID128_MAKE(44,47,95,40,f2,97,41,b2,9a,f7,d1,31,d5,f0,45,8a)
31#define GPT_ROOT_X86_64 SD_ID128_MAKE(4f,68,bc,e3,e8,cd,4d,b1,96,e7,fb,ca,f9,84,b7,09)
a86eae57
LP
32#define GPT_ROOT_ARM SD_ID128_MAKE(69,da,d7,10,2c,e4,4e,3c,b1,6c,21,a1,d4,9a,be,d3)
33#define GPT_ROOT_ARM_64 SD_ID128_MAKE(b9,21,b0,45,1d,f0,41,c3,af,44,4c,6f,28,0d,3f,ae)
f827e09f 34#define GPT_ROOT_IA64 SD_ID128_MAKE(99,3d,8d,3d,f8,0e,42,25,85,5a,9d,af,8e,d7,ea,97)
cbd353ce
LP
35
36#define GPT_ESP SD_ID128_MAKE(c1,2a,73,28,f8,1f,11,d2,ba,4b,00,a0,c9,3e,c9,3b)
37#define GPT_SWAP SD_ID128_MAKE(06,57,fd,6d,a4,ab,43,c4,84,e5,09,33,c8,4b,4f,4f)
38#define GPT_HOME SD_ID128_MAKE(93,3a,c7,e1,2e,b4,4f,13,b8,44,0e,14,e2,ae,f9,15)
39#define GPT_SRV SD_ID128_MAKE(3b,8f,84,25,20,e0,4f,3b,90,7f,1a,25,a7,6f,98,e8)
40
41#if defined(__x86_64__)
42# define GPT_ROOT_NATIVE GPT_ROOT_X86_64
1b9e5b12 43# define GPT_ROOT_SECONDARY GPT_ROOT_X86
cbd353ce
LP
44#elif defined(__i386__)
45# define GPT_ROOT_NATIVE GPT_ROOT_X86
46#endif
cca1dfdd 47
f827e09f
AW
48#if defined(__ia64__)
49# define GPT_ROOT_NATIVE GPT_ROOT_IA64
50#endif
51
4f4b92ba 52#if defined(__aarch64__) && (__BYTE_ORDER != __BIG_ENDIAN)
a86eae57
LP
53# define GPT_ROOT_NATIVE GPT_ROOT_ARM_64
54# define GPT_ROOT_SECONDARY GPT_ROOT_ARM
4f4b92ba 55#elif defined(__arm__) && (__BYTE_ORDER != __BIG_ENDIAN)
a86eae57
LP
56# define GPT_ROOT_NATIVE GPT_ROOT_ARM
57#endif
58
cca1dfdd
LP
59/* Flags we recognize on the root, swap, home and srv partitions when
60 * doing auto-discovery. These happen to be identical to what
61 * Microsoft defines for its own Basic Data Partitions, but that's
62 * just because we saw no point in defining any other values here. */
63#define GPT_FLAG_READ_ONLY (1ULL << 60)
64#define GPT_FLAG_NO_AUTO (1ULL << 63)
f6c51a81
LP
65
66#define GPT_LINUX_GENERIC SD_ID128_MAKE(0f,c6,3d,af,84,83,47,72,8e,79,3d,69,d8,47,7d,e4)