parted/parted-GPT-add-support-for-PReP-GUID.patch
Petr Uzel b5a4ceef04 - update to parted-3.1 (fate#316110)
- changes in parted-3.1:
  * Changes in behavior
    - Floppy drives are no longer scanned on linux: they cannot be
      partitioned anyhow, and some users have a misconfigured BIOS
      that claims to have a floppy when they don't, and scanning
      gets hung up.
    - parted: the mkpart command has changed semantics with regard
      to specifying the end of the partition.  If the end is
      specified using units of MiB, GiB, etc., parted subtracts one
      sector from the specified value.  With this change, it is now
      possible to create partitions like 1MiB-2MiB, 2MiB-3MiB and
      so on.
  * Many bugfixes (see changelog)
- changes in parted-3.0:
  * Changes in behavior
    - Remove all FS-related (file system-related) sub-commands;
      these commands are no longer recognized because they were all
      dependent on parted "knowing" too much about file system:
      mkpartfs, mkfs, cp, move, check.
    - 'resize' command changed semantics:
      it no longer resizes the filesystem, but only moves end
      sector of the partition
- libparted-devel contains libparted-fs-resize library 
- add ability to change size of the partition (ignoring contained
  filesystem) with 'resize' command; this command has different
  semantics than the former 'resize' command which upstream
  decided to drop
  - parted-resize-command.patch (fate#316110)
- when using syncmbr on POWER, make the first partition type 0x41

OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=79
2014-01-09 16:35:35 +00:00

212 lines
8.2 KiB
Diff

From d151cc20af79c89383ffacc89c1f646f831fc3e6 Mon Sep 17 00:00:00 2001
From: Daniel Battaiola Kreling <dbkreling@br.ibm.com>
Date: Mon, 7 Oct 2013 11:51:50 +0530
Subject: [PATCH] GPT: add support for PReP GUID
PReP (PowerPC Reference Platform) boot partition is the first partition used in
PowerPC platform for containing the bootable kernel or bootloader. The firmware
searches for this partition and jumps to it for booting. So far no GUID was
specified for this partition type and hence booting from GPT disk was not
supported on this platform. A new GUID 9e1a2d38-c612-4316-aa26-8b49521e5a8b for
PReP partition is proposed to be included in GPT.
---
NEWS | 7 +++++++
doc/parted.texi | 2 +-
libparted/labels/gpt.c | 38 ++++++++++++++++++++++++++++++++++++++
3 files changed, 46 insertions(+), 1 deletion(-)
Index: parted-3.1/NEWS
===================================================================
--- parted-3.1.orig/NEWS
+++ parted-3.1/NEWS
@@ -1,5 +1,12 @@
GNU parted NEWS -*- outline -*-
+* Noteworthy changes post release 3.1
+
+** New features
+
+ Add support for prep flag to GPT to select PowerPC Reference Platform
+ boot partition type.
+
* Noteworthy changes in release 3.1 (2012-03-02) [stable]
** New features
Index: parted-3.1/doc/parted.texi
===================================================================
--- parted-3.1.orig/doc/parted.texi
+++ parted-3.1/doc/parted.texi
@@ -822,7 +822,7 @@ physical volume.
by the Linux/PA-RISC boot loader, palo.
@item PREP
-(MS-DOS) - this flag can be enabled so that the partition can be used
+(MS-DOS, GPT) - this flag can be enabled so that the partition can be used
as a PReP boot partition on PowerPC PReP or IBM RS6K/CHRP hardware.
@item DIAG
Index: parted-3.1/libparted/labels/gpt.c
===================================================================
--- parted-3.1.orig/libparted/labels/gpt.c
+++ parted-3.1/libparted/labels/gpt.c
@@ -142,6 +142,10 @@ typedef struct
((efi_guid_t) { PED_CPU_TO_LE32 (0x5265636F), PED_CPU_TO_LE16 (0x7665), \
PED_CPU_TO_LE16 (0x11AA), 0xaa, 0x11, \
{ 0x00, 0x30, 0x65, 0x43, 0xEC, 0xAC }})
+#define PARTITION_PREP_GUID \
+ ((efi_guid_t) { PED_CPU_TO_LE32 (0x9e1a2d38), PED_CPU_TO_LE16 (0xc612), \
+ PED_CPU_TO_LE16 (0x4316), 0xaa, 0x26, \
+ { 0x8b, 0x49, 0x52, 0x1e, 0x5a, 0x8b }})
#define PARTITION_IRST_GUID \
((efi_guid_t) { PED_CPU_TO_LE32 (0xD3BFE2DE), PED_CPU_TO_LE16 (0x3DAF), \
PED_CPU_TO_LE16 (0x11DF), 0xba, 0x40, \
@@ -286,6 +290,7 @@ typedef struct _GPTPartitionData
int atvrecv;
int msftrecv;
int legacy_boot;
+ int prep;
int irst;
} GPTPartitionData;
@@ -888,6 +893,7 @@ _parse_part_entry (PedDisk *disk, GuidPa
= gpt_part_data->hidden = gpt_part_data->msftres
= gpt_part_data->msftrecv
= gpt_part_data->legacy_boot
+ = gpt_part_data->prep
= gpt_part_data->irst
= gpt_part_data->bios_grub = gpt_part_data->atvrecv = 0;
@@ -912,6 +918,8 @@ _parse_part_entry (PedDisk *disk, GuidPa
gpt_part_data->msftrecv = 1;
else if (!guid_cmp (gpt_part_data->type, PARTITION_APPLE_TV_RECOVERY_GUID))
gpt_part_data->atvrecv = 1;
+ else if (!guid_cmp (gpt_part_data->type, PARTITION_PREP_GUID))
+ gpt_part_data->prep = 1;
else if (!guid_cmp (gpt_part_data->type, PARTITION_IRST_GUID))
gpt_part_data->irst = 1;
@@ -1526,6 +1534,7 @@ gpt_partition_new (const PedDisk *disk,
gpt_part_data->msftrecv = 0;
gpt_part_data->atvrecv = 0;
gpt_part_data->legacy_boot = 0;
+ gpt_part_data->prep = 0;
gpt_part_data->irst = 0;
uuid_generate ((unsigned char *) &gpt_part_data->uuid);
swap_uuid_and_efi_guid ((unsigned char *) (&gpt_part_data->uuid));
@@ -1600,6 +1609,11 @@ gpt_partition_set_system (PedPartition *
gpt_part_data->type = PARTITION_RAID_GUID;
return 1;
}
+ if (gpt_part_data->prep)
+ {
+ gpt_part_data->type = PARTITION_PREP_GUID;
+ return 1;
+ }
if (gpt_part_data->boot)
{
gpt_part_data->type = PARTITION_SYSTEM_GUID;
@@ -1735,6 +1749,7 @@ gpt_partition_set_flag (PedPartition *pa
= gpt_part_data->hp_service
= gpt_part_data->msftres
= gpt_part_data->msftrecv
+ = gpt_part_data->prep
= gpt_part_data->irst
= gpt_part_data->atvrecv = 0;
return gpt_partition_set_system (part, part->fs_type);
@@ -1747,6 +1762,7 @@ gpt_partition_set_flag (PedPartition *pa
= gpt_part_data->hp_service
= gpt_part_data->msftres
= gpt_part_data->msftrecv
+ = gpt_part_data->prep
= gpt_part_data->irst
= gpt_part_data->atvrecv = 0;
return gpt_partition_set_system (part, part->fs_type);
@@ -1759,6 +1775,7 @@ gpt_partition_set_flag (PedPartition *pa
= gpt_part_data->hp_service
= gpt_part_data->msftres
= gpt_part_data->msftrecv
+ = gpt_part_data->prep
= gpt_part_data->irst
= gpt_part_data->atvrecv = 0;
return gpt_partition_set_system (part, part->fs_type);
@@ -1771,6 +1788,7 @@ gpt_partition_set_flag (PedPartition *pa
= gpt_part_data->hp_service
= gpt_part_data->msftres
= gpt_part_data->msftrecv
+ = gpt_part_data->prep
= gpt_part_data->irst
= gpt_part_data->atvrecv = 0;
return gpt_partition_set_system (part, part->fs_type);
@@ -1783,6 +1801,7 @@ gpt_partition_set_flag (PedPartition *pa
= gpt_part_data->bios_grub
= gpt_part_data->msftres
= gpt_part_data->msftrecv
+ = gpt_part_data->prep
= gpt_part_data->irst
= gpt_part_data->atvrecv = 0;
return gpt_partition_set_system (part, part->fs_type);
@@ -1795,6 +1814,7 @@ gpt_partition_set_flag (PedPartition *pa
= gpt_part_data->bios_grub
= gpt_part_data->hp_service
= gpt_part_data->msftrecv
+ = gpt_part_data->prep
= gpt_part_data->irst
= gpt_part_data->atvrecv = 0;
return gpt_partition_set_system (part, part->fs_type);
@@ -1807,6 +1827,7 @@ gpt_partition_set_flag (PedPartition *pa
= gpt_part_data->bios_grub
= gpt_part_data->hp_service
= gpt_part_data->msftres
+ = gpt_part_data->prep
= gpt_part_data->irst
= gpt_part_data->atvrecv = 0;
return gpt_partition_set_system (part, part->fs_type);
@@ -1819,9 +1840,22 @@ gpt_partition_set_flag (PedPartition *pa
= gpt_part_data->bios_grub
= gpt_part_data->hp_service
= gpt_part_data->msftres
+ = gpt_part_data->prep
= gpt_part_data->irst
= gpt_part_data->msftrecv = 0;
return gpt_partition_set_system (part, part->fs_type);
+ case PED_PARTITION_PREP:
+ gpt_part_data->prep = state;
+ if (state)
+ gpt_part_data->boot
+ = gpt_part_data->raid
+ = gpt_part_data->lvm
+ = gpt_part_data->bios_grub
+ = gpt_part_data->hp_service
+ = gpt_part_data->msftres
+ = gpt_part_data->msftrecv
+ = gpt_part_data->atvrecv = 0;
+ return gpt_partition_set_system (part, part->fs_type);
case PED_PARTITION_IRST:
gpt_part_data->irst = state;
if (state)
@@ -1832,6 +1866,7 @@ gpt_partition_set_flag (PedPartition *pa
= gpt_part_data->hp_service
= gpt_part_data->msftres
= gpt_part_data->msftrecv
+ = gpt_part_data->prep
= gpt_part_data->atvrecv = 0;
return gpt_partition_set_system (part, part->fs_type);
case PED_PARTITION_HIDDEN:
@@ -1878,6 +1913,8 @@ gpt_partition_get_flag (const PedPartiti
return gpt_part_data->hidden;
case PED_PARTITION_LEGACY_BOOT:
return gpt_part_data->legacy_boot;
+ case PED_PARTITION_PREP:
+ return gpt_part_data->prep;
case PED_PARTITION_IRST:
return gpt_part_data->irst;
case PED_PARTITION_SWAP:
@@ -1906,6 +1943,7 @@ gpt_partition_is_flag_available (const P
case PED_PARTITION_HIDDEN:
case PED_PARTITION_LEGACY_BOOT:
case PED_PARTITION_IRST:
+ case PED_PARTITION_PREP:
return 1;
case PED_PARTITION_SWAP:
case PED_PARTITION_ROOT: