Fixed a major bug that caused improper partition tables to be created.

Version 1.0.3 release.
This commit is contained in:
Rod Smith
2017-07-27 21:59:14 -04:00
parent eed1122809
commit f1f6236fb4
8 changed files with 17 additions and 9 deletions

7
NEWS
View File

@@ -1,3 +1,10 @@
1.0.3 (7/27/2017):
------------------
- Fixed a major bug that caused invalid partition tables to be generated
when creating a new partition table (that is, partitioning a blank disk or
converting from MBR).
1.0.2 (7/26/2017): 1.0.2 (7/26/2017):
------------------ ------------------

View File

@@ -1,6 +1,6 @@
.\" Copyright 2011-2017 Roderick W. Smith (rodsmith@rodsbooks.com) .\" Copyright 2011-2017 Roderick W. Smith (rodsmith@rodsbooks.com)
.\" May be distributed under the GNU General Public License .\" May be distributed under the GNU General Public License
.TH "CGDISK" "8" "1.0.2" "Roderick W. Smith" "GPT fdisk Manual" .TH "CGDISK" "8" "1.0.3" "Roderick W. Smith" "GPT fdisk Manual"
.SH "NAME" .SH "NAME"
cgdisk \- Curses-based GUID partition table (GPT) manipulator cgdisk \- Curses-based GUID partition table (GPT) manipulator
.SH "SYNOPSIS" .SH "SYNOPSIS"

View File

@@ -1,12 +1,12 @@
Summary: GPT partitioning and MBR repair software Summary: GPT partitioning and MBR repair software
Name: gptfdisk Name: gptfdisk
Version: 1.0.2 Version: 1.0.3
Release: 1%{?dist} Release: 1%{?dist}
License: GPLv2 License: GPLv2
URL: http://www.rodsbooks.com/gdisk URL: http://www.rodsbooks.com/gdisk
Group: Applications/System Group: Applications/System
Source: http://www.rodsbooks.com/gdisk/gptfdisk-1.0.2.tar.gz Source: http://www.rodsbooks.com/gdisk/gptfdisk-1.0.3.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
%description %description
@@ -81,5 +81,5 @@ provides a few additional partition manipulation features.
%changelog %changelog
* Wed Jul 26 2017 R Smith <rodsmith@rodsbooks.com> - 1.0.2 * Thu Jul 27 2017 R Smith <rodsmith@rodsbooks.com> - 1.0.3
- Created spec file for 1.0.2 release - Created spec file for 1.0.3 release

View File

@@ -1,6 +1,6 @@
.\" Copyright 2011-2017 Roderick W. Smith (rodsmith@rodsbooks.com) .\" Copyright 2011-2017 Roderick W. Smith (rodsmith@rodsbooks.com)
.\" May be distributed under the GNU General Public License .\" May be distributed under the GNU General Public License
.TH "FIXPARTS" "8" "1.0.2" "Roderick W. Smith" "FixParts Manual" .TH "FIXPARTS" "8" "1.0.3" "Roderick W. Smith" "FixParts Manual"
.SH "NAME" .SH "NAME"
fixparts \- MBR partition table repair utility fixparts \- MBR partition table repair utility
.SH "SYNOPSIS" .SH "SYNOPSIS"

View File

@@ -1,6 +1,6 @@
.\" Copyright 2011-2017 Roderick W. Smith (rodsmith@rodsbooks.com) .\" Copyright 2011-2017 Roderick W. Smith (rodsmith@rodsbooks.com)
.\" May be distributed under the GNU General Public License .\" May be distributed under the GNU General Public License
.TH "GDISK" "8" "1.0.2" "Roderick W. Smith" "GPT fdisk Manual" .TH "GDISK" "8" "1.0.3" "Roderick W. Smith" "GPT fdisk Manual"
.SH "NAME" .SH "NAME"
gdisk \- Interactive GUID partition table (GPT) manipulator gdisk \- Interactive GUID partition table (GPT) manipulator
.SH "SYNOPSIS" .SH "SYNOPSIS"

1
gpt.cc
View File

@@ -1924,6 +1924,7 @@ int GPTData::ClearGPTData(void) {
mainHeader.currentLBA = UINT64_C(1); mainHeader.currentLBA = UINT64_C(1);
mainHeader.partitionEntriesLBA = (uint64_t) 2; mainHeader.partitionEntriesLBA = (uint64_t) 2;
mainHeader.sizeOfPartitionEntries = GPT_SIZE; mainHeader.sizeOfPartitionEntries = GPT_SIZE;
mainHeader.firstUsableLBA = GetTableSizeInSectors() + mainHeader.partitionEntriesLBA;
for (i = 0; i < GPT_RESERVED; i++) { for (i = 0; i < GPT_RESERVED; i++) {
mainHeader.reserved2[i] = '\0'; mainHeader.reserved2[i] = '\0';
} // for } // for

View File

@@ -1,6 +1,6 @@
.\" Copyright 2011-2017 Roderick W. Smith (rodsmith@rodsbooks.com) .\" Copyright 2011-2017 Roderick W. Smith (rodsmith@rodsbooks.com)
.\" May be distributed under the GNU General Public License .\" May be distributed under the GNU General Public License
.TH "SGDISK" "8" "1.0.2" "Roderick W. Smith" "GPT fdisk Manual" .TH "SGDISK" "8" "1.0.3" "Roderick W. Smith" "GPT fdisk Manual"
.SH "NAME" .SH "NAME"
sgdisk \- Command\-line GUID partition table (GPT) manipulator for Linux and Unix sgdisk \- Command\-line GUID partition table (GPT) manipulator for Linux and Unix
.SH "SYNOPSIS" .SH "SYNOPSIS"

View File

@@ -8,7 +8,7 @@
#ifndef __GPTSUPPORT #ifndef __GPTSUPPORT
#define __GPTSUPPORT #define __GPTSUPPORT
#define GPTFDISK_VERSION "1.0.2" #define GPTFDISK_VERSION "1.0.3"
#if defined (__FreeBSD__) || defined (__FreeBSD_kernel__) || defined (__APPLE__) #if defined (__FreeBSD__) || defined (__FreeBSD_kernel__) || defined (__APPLE__)
// Darwin (Mac OS) & FreeBSD: disk IOCTLs are different, and there is no lseek64 // Darwin (Mac OS) & FreeBSD: disk IOCTLs are different, and there is no lseek64