diff --git a/SOURCES/gptfdisk-0.8.7-alignment.patch b/SOURCES/gptfdisk-0.8.7-alignment.patch new file mode 100644 index 0000000..622df35 --- /dev/null +++ b/SOURCES/gptfdisk-0.8.7-alignment.patch @@ -0,0 +1,100 @@ +commit f5dfbfa418675ca862408e4fb2240b21dd07d558 +Author: srs5694 +Date: Thu Feb 14 20:47:14 2013 -0500 + + Change to alignment code in sgdisk. + +diff --git a/gdisk_test.sh b/gdisk_test.sh +index e567d4c..8c5d800 100755 +--- a/gdisk_test.sh ++++ b/gdisk_test.sh +@@ -147,7 +147,7 @@ EOF + ;; + + sgdisk) +- $SGDISK_BIN $TEMP_DISK -${OPT_NEW}=1 -${OPT_CHANGE_NAME}=1:"${TEST_PART_DEFAULT_NAME}" ++ $SGDISK_BIN $TEMP_DISK -${OPT_NEW} 1 -${OPT_CHANGE_NAME} 1:"${TEST_PART_DEFAULT_NAME}" + ;; + esac + +@@ -171,7 +171,7 @@ EOF + ;; + + sgdisk) +- $SGDISK_BIN $TEMP_DISK -${OPT_CHANGE_NAME}=1:${TEST_PART_NEWNAME} ++ $SGDISK_BIN $TEMP_DISK -${OPT_CHANGE_NAME} 1:${TEST_PART_NEWNAME} + ;; + esac + +@@ -195,7 +195,7 @@ EOF + ;; + + sgdisk) +- $SGDISK_BIN $TEMP_DISK -${OPT_CHANGE_TYPE}=1:${TEST_PART_NEWTYPE} ++ $SGDISK_BIN $TEMP_DISK -${OPT_CHANGE_TYPE} 1:${TEST_PART_NEWTYPE} + ;; + esac + +@@ -219,7 +219,7 @@ echo "" + ;; + + sgdisk) +- $SGDISK_BIN $TEMP_DISK -${OPT_BACKUP}=${GPT_BACKUP_FILENAME} ++ $SGDISK_BIN $TEMP_DISK -${OPT_BACKUP} ${GPT_BACKUP_FILENAME} + ;; + esac + +@@ -248,7 +248,7 @@ EOF + ;; + + sgdisk) +- $SGDISK_BIN $TEMP_DISK -${OPT_DELETE}=1 ++ $SGDISK_BIN $TEMP_DISK -${OPT_DELETE} 1 + ;; + esac + +diff --git a/gpt.cc b/gpt.cc +index 40dd55e..d692561 100644 +--- a/gpt.cc ++++ b/gpt.cc +@@ -2088,7 +2088,7 @@ uint64_t GPTData::FindFirstInLargest(void) { + } // GPTData::FindFirstInLargest() + + // Find the last available block on the disk. +-// Returns 0 if there are no available partitions ++// Returns 0 if there are no available sectors + uint64_t GPTData::FindLastAvailable(void) { + uint64_t last; + uint32_t i; +diff --git a/gptcl.cc b/gptcl.cc +index 31d05b5..af83eb5 100644 +--- a/gptcl.cc ++++ b/gptcl.cc +@@ -280,6 +280,7 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) { + if (partNum < 0) + partNum = FindFirstFreePart(); + low = FindFirstInLargest(); ++ Align(&low); + high = FindLastInFree(low); + startSector = IeeeToInt(GetString(newPartInfo, 2), sSize, low, high, low); + endSector = IeeeToInt(GetString(newPartInfo, 3), sSize, startSector, high, high); +@@ -295,6 +296,7 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) { + case 'N': + JustLooking(0); + startSector = FindFirstInLargest(); ++ Align(&startSector); + endSector = FindLastInFree(startSector); + if (largestPartNum < 0) + largestPartNum = FindFirstFreePart(); +diff --git a/gptpart.cc b/gptpart.cc +index bbd28ae..4b8c369 100644 +--- a/gptpart.cc ++++ b/gptpart.cc +@@ -114,7 +114,6 @@ void GPTPart::SetName(const string & theName) { + // Set the name for a partition to theName, using a Unicode string as + // input. + void GPTPart::SetName(const UnicodeString & theName) { +- cout << "Entering GPTPart::SetName(const UnicodeString...)\n"; + if (theName.isBogus()) { + cerr << "Bogus UTF-16 name found in GPTPart::SetName()! Name not changed!\n"; + } else { diff --git a/SPECS/gdisk.spec b/SPECS/gdisk.spec index c782135..a8a49c3 100644 --- a/SPECS/gdisk.spec +++ b/SPECS/gdisk.spec @@ -1,7 +1,7 @@ Summary: An fdisk-like partitioning tool for GPT disks Name: gdisk Version: 0.8.6 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv2 URL: http://www.rodsbooks.com/gdisk/ Group: System Environment/Base @@ -11,6 +11,11 @@ Patch0: gptfdisk-0.8.1-gcc47.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1007761 # Fedora RHBZ#1007847 - patch sent upstream on 2013-09-13. Patch1: gdisk-0.8.7-add-range-check.patch + +# Create partition with sgdisk failed +# https://bugzilla.redhat.com/show_bug.cgi?id=1087353 +Patch2: gptfdisk-0.8.7-alignment.patch + BuildRequires: popt-devel BuildRequires: libicu-devel BuildRequires: libuuid-devel @@ -26,6 +31,7 @@ tables, and the ability to convert MBR disks to GPT format. %setup -q -n gptfdisk-%{version} %patch0 -p1 %patch1 -p1 +%patch2 -p1 chmod 0644 gdisk_test.sh %build @@ -54,6 +60,9 @@ done %{_mandir}/man8/fixparts.8* %changelog +* Fri Oct 03 2014 Tomas Bzatek - 0.8.6-5 +- Fix sgdisk alignment code (#1087353) + * Fri Jan 24 2014 Daniel Mach - 0.8.6-4 - Mass rebuild 2014-01-24