From c61974b09f5abb21b18e1f9847fd6a2a0997a3e5a5d8e95a36b7b38ba6e33c2d Mon Sep 17 00:00:00 2001 From: Petr Uzel Date: Tue, 27 Sep 2011 09:17:42 +0000 Subject: [PATCH] - improve parted-gpt-sync-mbr-label.patch: do not sync partitions that can not be represented by the DOS label (bnc#710402) OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=52 --- parted-gpt-sync-mbr-label.patch | 20 +++++++++++++++++--- parted.changes | 7 +++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/parted-gpt-sync-mbr-label.patch b/parted-gpt-sync-mbr-label.patch index 1d0b472..f098b12 100644 --- a/parted-gpt-sync-mbr-label.patch +++ b/parted-gpt-sync-mbr-label.patch @@ -195,7 +195,21 @@ Index: parted-2.4/libparted/labels/gpt.c /* Search for an EFI System Partition */ esp = _find_first_part(disk); if (!esp || !esp->fs_type || strncmp (esp->fs_type->name, "fat", 3) != 0) -@@ -1203,8 +1282,7 @@ _write_pmbr (const PedDisk *disk) +@@ -1191,6 +1270,13 @@ _write_pmbr (const PedDisk *disk) + i--; + continue; + } ++ ++ /* partition can not be represented by dos label - don't sync it */ ++ if (part->geom.start > 0xFFFFFFFF || ++ (part->geom.end - part->geom.start + 1) > 0xFFFFFFFF) { ++ continue; ++ } ++ + pmbr->PartitionRecord[i].OSType = _part_to_ostype(part); + pmbr->PartitionRecord[i].StartHead = 0xFE; + pmbr->PartitionRecord[i].StartSector = 0xFF; +@@ -1203,8 +1289,7 @@ _write_pmbr (const PedDisk *disk) pmbr->PartitionRecord[i].BootIndicator = 0x80; pmbr->PartitionRecord[i].SizeInLBA = _part_32bitmax(part->geom.end - part->geom.start + 1); } @@ -205,7 +219,7 @@ Index: parted-2.4/libparted/labels/gpt.c int write_ok = ped_device_write (dev, pmbr, GPT_PMBR_LBA, GPT_PMBR_SECTORS); free (s0); -@@ -1902,6 +1980,38 @@ static PedDiskOps gpt_disk_ops = +@@ -1902,6 +1987,38 @@ static PedDiskOps gpt_disk_ops = PT_op_function_initializers (gpt) }; @@ -244,7 +258,7 @@ Index: parted-2.4/libparted/labels/gpt.c static PedDiskType gpt_disk_type = { next: NULL, -@@ -1910,16 +2020,26 @@ static PedDiskType gpt_disk_type = +@@ -1910,16 +2027,26 @@ static PedDiskType gpt_disk_type = features: PED_DISK_TYPE_PARTITION_NAME }; diff --git a/parted.changes b/parted.changes index b9a0e3f..f107bc4 100644 --- a/parted.changes +++ b/parted.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Sep 26 08:41:49 UTC 2011 - puzel@suse.com + +- improve parted-gpt-sync-mbr-label.patch: do not + sync partitions that can not be represented by the DOS label + (bnc#710402) + ------------------------------------------------------------------- Wed Sep 7 15:05:08 UTC 2011 - puzel@suse.com