blob: 5768a27c22d185e6c6e836772469f35d4868042c [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SRC_DEVICES_BLOCK_DRIVERS_GPT_GPT_TEST_DATA_H_
#define SRC_DEVICES_BLOCK_DRIVERS_GPT_GPT_TEST_DATA_H_
#include <stdint.h>
// A test GPT partition. Only the first 3 sectors are included.
//
// % fdisk -l gpt.img
// Disk gpt.img: 128 MiB, 134217728 bytes, 262144 sectors
// Units: sectors of 1 * 512 = 512 bytes
// Sector size (logical/physical): 512 bytes / 512 bytes
// I/O size (minimum/optimal): 512 bytes / 512 bytes
// Disklabel type: gpt
// Disk identifier: 4A0B1911-251A-4213-BA1B-6A52A9F6BFD7
//
// Device Start End Sectors Size Type
// gpt.img1 2048 22527 20480 10M Linux filesystem
// gpt.img2 22528 40960 18433 9M Linux filesystem
//
// Partition number (1-2): 1
// Partition GUID code: 0FC63DAF-8483-4772-8E79-3D69D8477DE4 (Linux filesystem)
// Partition unique GUID: A808623E-878B-47FF-AF93-31C727FB0E0C
// First sector: 2048 (at 1024.0 KiB)
// Last sector: 22527 (at 11.0 MiB)
// Partition size: 20480 sectors (10.0 MiB)
// Attribute flags: 0000000000000000
// Partition name: 'Linux filesystem'
// Partition number (1-2): 2
// Partition GUID code: 0FC63DAF-8483-4772-8E79-3D69D8477DE4 (Linux filesystem)
// Partition unique GUID: 97F1247A-288B-4619-8314-0A5EC97E98B8
// First sector: 22528 (at 11.0 MiB)
// Last sector: 40960 (at 20.0 MiB)
// Partition size: 18433 sectors (9.0 MiB)
// Attribute flags: 0000000000000000
// Partition name: 'Linux filesystem'
//
// N.B. the partition name for partition 2 has had its name changed from above such that it
// has codepoint 0x10000 as suffix which requires a surrogate pair to encode in UTF-16.
// These numbers match the below partition table.
constexpr uint32_t kBlockSz = 512;
constexpr uint32_t kBlockCnt = 262144;
#define GUID_LINUX_FILESYSTEM \
{ 0xAF, 0x3D, 0xC6, 0x0F, 0x83, 0x84, 0x72, 0x47, 0x8E, 0x79, 0x3D, 0x69, 0xD8, 0x47, 0x7D, 0xE4 }
#define GUID_METADATA \
{ 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF }
#define GUID_UNIQUE_PART0 \
{ 0x3E, 0x62, 0x08, 0xA8, 0x8B, 0x87, 0xFF, 0x47, 0xAF, 0x93, 0x31, 0xC7, 0x27, 0xFB, 0x0E, 0x0C }
#define GUID_UNIQUE_PART1 \
{ 0x7A, 0x24, 0xF1, 0x97, 0x8B, 0x28, 0x19, 0x46, 0x83, 0x14, 0x0A, 0x5E, 0xC9, 0x7E, 0x98, 0xB8 }
// clang-format off
constexpr uint8_t test_partition_table[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000000 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000010 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000020 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000030 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000040 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000050 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000060 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000070 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000080 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000090 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000000a0 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000000b0 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000000c0 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000000d0 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000000e0 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000000f0 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000100 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000110 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000120 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000130 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000140 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000150 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000160 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000170 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000180 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000190 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000001a0 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000001b0 |................|
0x02,0x00,0xee,0x51,0x01,0x10,0x01,0x00,
0x00,0x00,0xff,0xff,0x03,0x00,0x00,0x00, // 000001c0 |...Q............|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000001d0 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000001e0 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x55,0xaa, // 000001f0 |..............U.|
0x45,0x46,0x49,0x20,0x50,0x41,0x52,0x54,
0x00,0x00,0x01,0x00,0x5c,0x00,0x00,0x00, // 00000200 |EFI PART....\...|
0x17,0xfd,0x4e,0x5c,0x00,0x00,0x00,0x00,
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000210 |................|
0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,
0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000220 |........".......|
0xde,0xff,0x03,0x00,0x00,0x00,0x00,0x00,
0x11,0x19,0x0b,0x4a,0x1a,0x25,0x13,0x42, // 00000230 |...........J.%.B|
0xba,0x1b,0x6a,0x52,0xa9,0xf6,0xbf,0xd7,
0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000240 |..jR............|
0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,
0x8e,0x6e,0x19,0xac,0x00,0x00,0x00,0x00, // 00000250 |........:O......|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000260 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000270 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000280 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000290 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000002a0 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000002b0 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000002c0 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000002d0 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000002e0 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000002f0 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000300 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000310 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000320 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000330 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000340 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000350 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000360 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000370 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000380 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000390 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000003a0 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000003b0 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000003c0 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000003d0 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000003e0 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000003f0 |................|
0xaf,0x3d,0xc6,0x0f,0x83,0x84,0x72,0x47,
0x8e,0x79,0x3d,0x69,0xd8,0x47,0x7d,0xe4, // 00000400 |.=....rG.y=i.G}.|
0x3e,0x62,0x08,0xa8,0x8b,0x87,0xff,0x47,
0xaf,0x93,0x31,0xc7,0x27,0xfb,0x0e,0x0c, // 00000410 |>b.....G..1.'...|
0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,
0xff,0x57,0x00,0x00,0x00,0x00,0x00,0x00, // 00000420 |.........W......|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x4c,0x00,0x69,0x00,0x6e,0x00,0x75,0x00, // 00000430 |........L.i.n.u.|
0x78,0x00,0x20,0x00,0x66,0x00,0x69,0x00,
0x6c,0x00,0x65,0x00,0x73,0x00,0x79,0x00, // 00000440 |x. .f.i.l.e.s.y.|
0x73,0x00,0x74,0x00,0x65,0x00,0x6d,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000450 |s.t.e.m.........|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000460 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000470 |................|
0xaf,0x3d,0xc6,0x0f,0x83,0x84,0x72,0x47,
0x8e,0x79,0x3d,0x69,0xd8,0x47,0x7d,0xe4, // 00000480 |.=....rG.y=i.G}.|
0x7a,0x24,0xf1,0x97,0x8b,0x28,0x19,0x46,
0x83,0x14,0x0a,0x5e,0xc9,0x7e,0x98,0xb8, // 00000490 |z$...(.F...^.~..|
0x00,0x58,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xa0,0x00,0x00,0x00,0x00,0x00,0x00, // 000004a0 |.X..............|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x4c,0x00,0x69,0x00,0x6e,0x00,0x75,0x00, // 000004b0 |........L.i.n.u.|
0x78,0x00,0x20,0x00,0x66,0x00,0x69,0x00,
0x6c,0x00,0x65,0x00,0x73,0x00,0x79,0x00, // 000004c0 |x. .f.i.l.e.s.y.|
0x73,0x00,0x74,0x00,0x65,0x00,0x6d,0x00,
0x00,0xd8,0x00,0xdc,0x00,0x00,0x00,0x00, // 000004d0 |s.t.e.m.........|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000004e0 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000004f0 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000500 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000510 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000520 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000530 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000540 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000550 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000560 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000570 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000580 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 00000590 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000005a0 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000005b0 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000005c0 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000005d0 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000005e0 |................|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 000005f0 |................|
};
// clang-format on
#endif // SRC_DEVICES_BLOCK_DRIVERS_GPT_GPT_TEST_DATA_H_