diffstat for gdisk-0.8.10 gdisk-1.0.0 Makefile.mingw64 | 41 +++++++++++++++++++++++++++++++++++ NEWS | 47 +++++++++++++++++++++++++++++++++++++++++ basicmbr.cc | 2 - cgdisk.8 | 9 ++----- cgdisk.html | 20 +++++++---------- current.spec | 8 +++---- debian/changelog | 6 +++++ debian/patches/series | 4 +-- diskio-unix.cc | 3 +- fixparts.8 | 7 ++---- fixparts.html | 18 +++++++-------- gdisk.8 | 7 ++---- gdisk.cc | 9 +++++++ gdisk.html | 18 +++++++-------- gpt.cc | 17 ++++++++++++++ gptcl.cc | 4 +++ gptpart.cc | 2 - gpttext.cc | 4 +-- mbr.cc | 3 ++ mbr.h | 1 parttypes.cc | 21 ++++++++++++++++++ sgdisk.8 | 23 +++++++++++++------- sgdisk.html | 35 +++++++++++++++++++----------- support.cc | 57 ++++++++++++++++++++++++++++++++++---------------- support.h | 2 - 25 files changed, 273 insertions(+), 95 deletions(-) diff -Nru gdisk-0.8.10/Makefile.mingw64 gdisk-1.0.0/Makefile.mingw64 --- gdisk-0.8.10/Makefile.mingw64 1970-01-01 00:00:00.000000000 +0000 +++ gdisk-1.0.0/Makefile.mingw64 2015-03-17 22:50:38.000000000 +0000 @@ -0,0 +1,41 @@ +CC=/usr/bin/x86_64-w64-mingw32-gcc +CXX=/usr/bin/x86_64-w64-mingw32-g++ +STRIP=/usr/bin/x86_64-w64-mingw32-strip +CFLAGS=-O2 -Wall -static -static-libgcc -static-libstdc++ -D_FILE_OFFSET_BITS=64 -g +CXXFLAGS=-O2 -Wall -static -static-libgcc -static-libstdc++ -D_FILE_OFFSET_BITS=64 -g +#CXXFLAGS=-O2 -Wall -D_FILE_OFFSET_BITS=64 -I /usr/local/include -I/opt/local/include -g +LIB_NAMES=guid gptpart bsd parttypes attributes crc32 mbrpart basicmbr mbr gpt support diskio diskio-windows +MBR_LIBS=support diskio diskio-windows basicmbr mbrpart +LIB_SRCS=$(NAMES:=.cc) +LIB_OBJS=$(LIB_NAMES:=.o) +MBR_LIB_OBJS=$(MBR_LIBS:=.o) +LIB_HEADERS=$(LIB_NAMES:=.h) +DEPEND= makedepend $(CFLAGS) + +all: gdisk fixparts + +gdisk: $(LIB_OBJS) gdisk.o gpttext.o + $(CXX) $(CXXFLAGS) $(LIB_OBJS) gdisk.o gpttext.o -lrpcrt4 -static-libgcc -o gdisk64.exe + +sgdisk: $(LIB_OBJS) sgdisk.o + $(CXX) $(CXXFLAGS) $(LIB_OBJS) sgdisk.o -lpopt -static-libgcc -o sgdisk64.exe + +fixparts: $(MBR_LIB_OBJS) fixparts.o + $(CXX) $(CXXFLAGS) $(MBR_LIB_OBJS) fixparts.o $(LDFLAGS) -static-libgcc -o fixparts64.exe + +lint: #no pre-reqs + lint $(SRCS) + +clean: #no pre-reqs + rm -f core *.o *~ gdisk64.exe sgdisk64.exe + +strip: #no pre-reqs + $(STRIP) gdisk64.exe fixparts64.exe + +# what are the source dependencies +depend: $(SRCS) + $(DEPEND) $(SRCS) + +$(OBJS): + +# DO NOT DELETE diff -Nru gdisk-0.8.10/NEWS gdisk-1.0.0/NEWS --- gdisk-0.8.10/NEWS 2014-03-02 17:57:37.000000000 +0000 +++ gdisk-1.0.0/NEWS 2015-03-17 22:50:38.000000000 +0000 @@ -1,3 +1,50 @@ +1.0.0 (3/16/2015): +------------------ + +- I'm now building a binary package of gdisk_x64.efi, using the UEFI GPT + fdisk package. + +- Added partition type for OpenBSD data + (824CC7A0-36A8-11E3-890A-952519AD3F61/0xa601). Also mapped 0xa600 to the + FreeBSD disklabel type code (516E7CB4-6ECF-11D6-8FF8-00022D09712B). I'm + not sure that's 100% correct, but since I can't find references to an + OpenBSD disklabel GPT type code, it seems the best choice at the moment. + +- Added partition type for Windows Storage Spaces + (E75CAF8F-F680-4CEE-AFA3-B001E56EFC2D/0x4202) + +- Added -O/--print-mbr option to sgdisk, enabling easier display of MBR + data structures without invoking gdisk. + +- Updated warning message: "EBR describes a logical partition" now reads + "EBR points to an EBR," which is more technically correct. + +- Altered warning displayed when run from Windows on non-GPT disk, because + Windows on UEFI-based systems is becoming more common. + +- Fixed spurious "1" return value in gdisk. + +- Small code changes to support compilation as EFI application with the + UEFI GPT fdisk library + (http://sourceforge.net/projects/uefigptfdisk/?source=directory) + +- Added new partition type codes for Ceph + (https://github.com/ceph/ceph/blob/9bcc42a3e6b08521694b5c0228b2c6ed7b3d312e/src/ceph-disk#L76-L81): + 4FBD7E29-9D25-41B8-AFD0-062C0CEFF05D/0xf800 (Ceph OSD), + 4FBD7E29-9D25-41B8-AFD0-5EC00CEFF05D/0xf801 (Ceph dm-crypt OSD), + 45B0969E-9B03-4F30-B4C6-B4B80CEFF106/0xf802 (Ceph journal), + 45B0969E-9B03-4F30-B4C6-5EC00CEFF106/0xf803 (Ceph dm-crypt journal), + 89C57F98-2FE5-4DC0-89C1-F3AD0CEFF2BE/0xf804 (Ceph disk in creation), and + 89C57F98-2FE5-4DC0-89C1-5EC00CEFF2BE/0xf805 (Ceph dm-crypt disk in + creation) + +- Added new partition type codes from + http://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/: + 44479540-F297-41B2-9AF7-D131D5F0458A/0x8303 (Linux / on x86), + 4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709/0x8304 (Linux / on x86-64), + B921B045-1DF0-41C3-AF44-4C6F280D3FAE/0x8305 (Linux / on 64-bit ARM), + 3B8F8425-20E0-4F3B-907F-1A25A76F98E8/0x8306 (Linux /srv). + 0.8.10 (3/2/2014): ------------------ diff -Nru gdisk-0.8.10/basicmbr.cc gdisk-1.0.0/basicmbr.cc --- gdisk-0.8.10/basicmbr.cc 2014-03-02 17:57:37.000000000 +0000 +++ gdisk-1.0.0/basicmbr.cc 2015-03-17 22:50:38.000000000 +0000 @@ -296,7 +296,7 @@ // the logical partition when this is the case.... ebrType = ebr.partitions[0].partitionType; if ((ebrType == 0x05) || (ebrType == 0x0f) || (ebrType == 0x85)) { - cout << "EBR describes a logical partition!\n"; + cout << "EBR points to an EBR!\n"; offset = extendedStart + ebr.partitions[0].firstLBA; } else { // Copy over the basic data.... diff -Nru gdisk-0.8.10/cgdisk.8 gdisk-1.0.0/cgdisk.8 --- gdisk-0.8.10/cgdisk.8 2014-03-02 17:57:37.000000000 +0000 +++ gdisk-1.0.0/cgdisk.8 2015-03-17 22:50:38.000000000 +0000 @@ -1,6 +1,6 @@ .\" Copyright 2011-2013 Roderick W. Smith (rodsmith@rodsbooks.com) .\" May be distributed under the GNU General Public License -.TH "CGDISK" "8" "0.8.10" "Roderick W. Smith" "GPT fdisk Manual" +.TH "CGDISK" "8" "1.0.0" "Roderick W. Smith" "GPT fdisk Manual" .SH "NAME" cgdisk \- Curses-based GUID partition table (GPT) manipulator .SH "SYNOPSIS" @@ -276,10 +276,7 @@ .SH "BUGS" -As of March 2014 (version 0.8.10), \fBcgdisk\fR should be considered -beta software. Although the underlying partition manipulation code is much -older, the \fBcgdisk\fR ncurses user interface is brand new with GPT fdisk -version 0.8.0. Known bugs and limitations include: +Known bugs and limitations include: .TP .B * @@ -367,7 +364,7 @@ * Justin Maggard (justin.maggard@netgear.com) -* Dwight Schauer (dschauer@ti.com) +* Dwight Schauer (dschauer@gmail.com) * Florian Zumbiehl (florz@florz.de) diff -Nru gdisk-0.8.10/cgdisk.html gdisk-1.0.0/cgdisk.html --- gdisk-0.8.10/cgdisk.html 2014-03-02 17:57:37.000000000 +0000 +++ gdisk-1.0.0/cgdisk.html 2015-03-17 22:50:38.000000000 +0000 @@ -1,10 +1,11 @@ -Content-type: text/html +Content-type: text/html; charset=UTF-8 -Manpage of CGDISK + +Man page of CGDISK

CGDISK

-Section: GPT fdisk Manual (8)
Updated: 0.8.10
Index -Return to Main Contents
+Section: GPT fdisk Manual (8)
Updated: 1.0.0
Index +Return to Main Contents
 

NAME

@@ -330,10 +331,7 @@

BUGS

-As of March 2014 (version 0.8.10), cgdisk should be considered -beta software. Although the underlying partition manipulation code is much -older, the cgdisk ncurses user interface is brand new with GPT fdisk -version 0.8.0. Known bugs and limitations include: +Known bugs and limitations include:

* @@ -434,7 +432,7 @@

* Justin Maggard (justin.maggard@netgear.com)

-* Dwight Schauer (dschauer@ti.com) +* Dwight Schauer (dschauer@gmail.com)

* Florian Zumbiehl (florz@florz.de)

@@ -478,8 +476,8 @@


This document was created by -man2html, +man2html, using the manual pages.
-Time: 17:57:37 GMT, March 02, 2014 +Time: 22:50:38 GMT, March 17, 2015 diff -Nru gdisk-0.8.10/current.spec gdisk-1.0.0/current.spec --- gdisk-0.8.10/current.spec 2014-03-02 17:57:37.000000000 +0000 +++ gdisk-1.0.0/current.spec 2015-03-17 22:50:38.000000000 +0000 @@ -1,12 +1,12 @@ Summary: GPT partitioning and MBR repair software Name: gptfdisk -Version: 0.8.10 +Version: 1.0.0 Release: 1%{?dist} License: GPLv2 URL: http://www.rodsbooks.com/gdisk Group: Applications/System -Source: http://www.rodsbooks.com/gdisk/gptfdisk-0.8.10.tar.gz +Source: http://www.rodsbooks.com/gdisk/gptfdisk-1.0.0.tar.gz BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) %description @@ -81,5 +81,5 @@ %changelog -* Sun Mar 2 2014 R Smith - 0.8.10 -- Created spec file for 0.8.10 release +* Sun Mar 2 2014 R Smith - 1.0.0 +- Created spec file for 1.0.0 release diff -Nru gdisk-0.8.10/debian/changelog gdisk-1.0.0/debian/changelog --- gdisk-0.8.10/debian/changelog 2015-03-15 09:29:33.000000000 +0000 +++ gdisk-1.0.0/debian/changelog 2015-04-13 11:25:22.000000000 +0000 @@ -1,3 +1,9 @@ +gdisk (1.0.0-drbl1) unstable; urgency=medium + + * New upstream release. + + -- Steven Shiau Mon, 13 Apr 2015 19:24:58 +0800 + gdisk (0.8.10-2) unstable; urgency=medium [ intrigeri ] diff -Nru gdisk-0.8.10/debian/patches/series gdisk-1.0.0/debian/patches/series --- gdisk-0.8.10/debian/patches/series 2015-03-15 09:29:33.000000000 +0000 +++ gdisk-1.0.0/debian/patches/series 2015-04-13 11:26:10.000000000 +0000 @@ -1,7 +1,7 @@ -Fixed-bug-that-caused-spurious-1-exit-condition-in-g.patch +#Fixed-bug-that-caused-spurious-1-exit-condition-in-g.patch ncursesw5.diff set_default_partition_type-test.diff -manpages.diff +#manpages.diff kfreebsd_character_devices.diff fix-change_disk_uid-test.diff enable_make_test.diff diff -Nru gdisk-0.8.10/diskio-unix.cc gdisk-1.0.0/diskio-unix.cc --- gdisk-0.8.10/diskio-unix.cc 2014-03-02 17:57:37.000000000 +0000 +++ gdisk-1.0.0/diskio-unix.cc 2015-03-17 22:50:38.000000000 +0000 @@ -253,7 +253,8 @@ i = ioctl(fd, BLKRRPART); if (i) { cout << "Warning: The kernel is still using the old partition table.\n" - << "The new table will be used at the next reboot.\n"; + << "The new table will be used at the next reboot or after you\n" + << "run partprobe(8) or kpartx(8)\n"; } else { retval = 1; } // if/else diff -Nru gdisk-0.8.10/fixparts.8 gdisk-1.0.0/fixparts.8 --- gdisk-0.8.10/fixparts.8 2014-03-02 17:57:37.000000000 +0000 +++ gdisk-1.0.0/fixparts.8 2015-03-17 22:50:38.000000000 +0000 @@ -1,6 +1,6 @@ .\" Copyright 2011-2013 Roderick W. Smith (rodsmith@rodsbooks.com) .\" May be distributed under the GNU General Public License -.TH "FIXPARTS" "8" "0.8.10" "Roderick W. Smith" "FixParts Manual" +.TH "FIXPARTS" "8" "1.0.0" "Roderick W. Smith" "FixParts Manual" .SH "NAME" fixparts \- MBR partition table repair utility .SH "SYNOPSIS" @@ -202,8 +202,7 @@ .PP .SH "BUGS" -As of March 2014 (version 0.8.10), \fBfixparts\fR -should be considered beta software. Known bugs and limitations include: +Known bugs and limitations include: .TP .B * @@ -259,7 +258,7 @@ * Justin Maggard (justin.maggard@netgear.com) -* Dwight Schauer (dschauer@ti.com) +* Dwight Schauer (dschauer@gmail.com) * Florian Zumbiehl (florz@florz.de) diff -Nru gdisk-0.8.10/fixparts.html gdisk-1.0.0/fixparts.html --- gdisk-0.8.10/fixparts.html 2014-03-02 17:57:37.000000000 +0000 +++ gdisk-1.0.0/fixparts.html 2015-03-17 22:50:38.000000000 +0000 @@ -1,10 +1,11 @@ -Content-type: text/html +Content-type: text/html; charset=UTF-8 -Manpage of FIXPARTS + +Man page of FIXPARTS

FIXPARTS

-Section: FixParts Manual (8)
Updated: 0.8.10
Index -Return to Main Contents
+Section: FixParts Manual (8)
Updated: 1.0.0
Index +Return to Main Contents
 

NAME

@@ -245,8 +246,7 @@  

BUGS

-As of March 2014 (version 0.8.10), fixparts -should be considered beta software. Known bugs and limitations include: +Known bugs and limitations include:

* @@ -313,7 +313,7 @@

* Justin Maggard (justin.maggard@netgear.com)

-* Dwight Schauer (dschauer@ti.com) +* Dwight Schauer (dschauer@gmail.com)

* Florian Zumbiehl (florz@florz.de)

@@ -355,8 +355,8 @@


This document was created by -man2html, +man2html, using the manual pages.
-Time: 17:57:37 GMT, March 02, 2014 +Time: 22:50:38 GMT, March 17, 2015 diff -Nru gdisk-0.8.10/gdisk.8 gdisk-1.0.0/gdisk.8 --- gdisk-0.8.10/gdisk.8 2014-03-02 17:57:37.000000000 +0000 +++ gdisk-1.0.0/gdisk.8 2015-03-17 22:50:38.000000000 +0000 @@ -1,6 +1,6 @@ .\" Copyright 2011-2013 Roderick W. Smith (rodsmith@rodsbooks.com) .\" May be distributed under the GNU General Public License -.TH "GDISK" "8" "0.8.10" "Roderick W. Smith" "GPT fdisk Manual" +.TH "GDISK" "8" "1.0.0" "Roderick W. Smith" "GPT fdisk Manual" .SH "NAME" gdisk \- Interactive GUID partition table (GPT) manipulator .SH "SYNOPSIS" @@ -561,8 +561,7 @@ usually bypasses the prompt entirely. .SH "BUGS" -As of March 2014 (version 0.8.10), \fBgdisk\fR -should be considered beta software. Known bugs and limitations include: +Known bugs and limitations include: .TP .B * @@ -660,7 +659,7 @@ * Justin Maggard (justin.maggard@netgear.com) -* Dwight Schauer (dschauer@ti.com) +* Dwight Schauer (dschauer@gmail.com) * Florian Zumbiehl (florz@florz.de) diff -Nru gdisk-0.8.10/gdisk.cc gdisk-1.0.0/gdisk.cc --- gdisk-0.8.10/gdisk.cc 2014-03-02 17:57:37.000000000 +0000 +++ gdisk-1.0.0/gdisk.cc 2015-03-17 22:50:38.000000000 +0000 @@ -15,8 +15,11 @@ GPTDataTextUI theGPT; string device = ""; UnicodeString uString; + int isError = 0; +#ifndef EFI cout << "GPT fdisk (gdisk) version " << GPTFDISK_VERSION << "\n\n"; +#endif /*EFI*/ if (!SizesOK()) exit(1); @@ -47,16 +50,20 @@ device = (string) argv[1]; } else { // 3 arguments, but none is "-l" cerr << "Usage: " << argv[0] << " [-l] device_file\n"; + isError = 1; } // if/elseif/else if (device != "") { theGPT.JustLooking(); if (theGPT.LoadPartitions(device)) theGPT.DisplayGPTData(); + else + isError = 1; } // if break; default: cerr << "Usage: " << argv[0] << " [-l] device_file\n"; + isError = 1; break; } // switch - return 1 ; + return (isError); } // main diff -Nru gdisk-0.8.10/gdisk.html gdisk-1.0.0/gdisk.html --- gdisk-0.8.10/gdisk.html 2014-03-02 17:57:37.000000000 +0000 +++ gdisk-1.0.0/gdisk.html 2015-03-17 22:50:38.000000000 +0000 @@ -1,10 +1,11 @@ -Content-type: text/html +Content-type: text/html; charset=UTF-8 -Manpage of GDISK + +Man page of GDISK

GDISK

-Section: GPT fdisk Manual (8)
Updated: 0.8.10
Index -Return to Main Contents
+Section: GPT fdisk Manual (8)
Updated: 1.0.0
Index +Return to Main Contents
 

NAME

@@ -656,8 +657,7 @@  

BUGS

-As of March 2014 (version 0.8.10), gdisk -should be considered beta software. Known bugs and limitations include: +Known bugs and limitations include:

* @@ -770,7 +770,7 @@

* Justin Maggard (justin.maggard@netgear.com)

-* Dwight Schauer (dschauer@ti.com) +* Dwight Schauer (dschauer@gmail.com)

* Florian Zumbiehl (florz@florz.de)

@@ -814,8 +814,8 @@


This document was created by -man2html, +man2html, using the manual pages.
-Time: 17:57:37 GMT, March 02, 2014 +Time: 22:50:38 GMT, March 17, 2015 diff -Nru gdisk-0.8.10/gpt.cc gdisk-1.0.0/gpt.cc --- gdisk-0.8.10/gpt.cc 2014-03-02 17:57:37.000000000 +0000 +++ gdisk-1.0.0/gpt.cc 2015-03-17 22:50:38.000000000 +0000 @@ -38,6 +38,23 @@ #define log2(x) (log((double) x) / log(2.0)) #endif // Microsoft Visual C++ +#ifdef EFI +// in UEFI mode MMX registers are not yet available so using the +// x86_64 ABI to move "double" values around is not an option. +#ifdef log2 +#undef log2 +#endif +#define log2(x) log2_32( x ) +static inline uint32_t log2_32(uint32_t v) { + int r = -1; + while (v >= 1) { + r++; + v >>= 1; + } + return r; +} +#endif + /**************************************** * * * GPTData class and related structures * diff -Nru gdisk-0.8.10/gptcl.cc gdisk-1.0.0/gptcl.cc --- gdisk-0.8.10/gptcl.cc 2014-03-02 17:57:37.000000000 +0000 +++ gdisk-1.0.0/gptcl.cc 2015-03-17 22:50:38.000000000 +0000 @@ -93,6 +93,7 @@ {"new", 'n', POPT_ARG_STRING, &newPartInfo, 'n', "create new partition", "partnum:start:end"}, {"largest-new", 'N', POPT_ARG_INT, &largestPartNum, 'N', "create largest possible new partition", "partnum"}, {"clear", 'o', POPT_ARG_NONE, NULL, 'o', "clear partition table", ""}, + {"print-mbr", 'O', POPT_ARG_NONE, NULL, 'O', "print MBR partition table", ""}, {"print", 'p', POPT_ARG_NONE, NULL, 'p', "print partition table", ""}, {"pretend", 'P', POPT_ARG_NONE, NULL, 'P', "make changes in memory, but don't write them", ""}, {"transpose", 'r', POPT_ARG_STRING, &twoParts, 'r', "transpose two partitions", "partnum:partnum"}, @@ -320,6 +321,9 @@ ClearGPTData(); saveData = 1; break; + case 'O': + DisplayMBRData(); + break; case 'p': DisplayGPTData(); break; diff -Nru gdisk-0.8.10/gptpart.cc gdisk-1.0.0/gptpart.cc --- gdisk-0.8.10/gptpart.cc 2014-03-02 17:57:37.000000000 +0000 +++ gdisk-1.0.0/gptpart.cc 2015-03-17 22:50:38.000000000 +0000 @@ -302,7 +302,7 @@ cout << firstLBA << " "; cout.width(14); cout << lastLBA << " "; - cout << BytesToIeee(lastLBA - firstLBA + 1, blockSize) << " "; + cout << sizeInIeee << " "; if (sizeInIeee.length() < 10) for (i = 0; i < 10 - sizeInIeee.length(); i++) cout << " "; diff -Nru gdisk-0.8.10/gpttext.cc gdisk-1.0.0/gpttext.cc --- gdisk-0.8.10/gpttext.cc 2014-03-02 17:57:37.000000000 +0000 +++ gdisk-1.0.0/gpttext.cc 2015-03-17 22:50:38.000000000 +0000 @@ -198,9 +198,9 @@ Align(&firstInLargest); // Get partition number.... + prompt1 << "Partition number (" << firstFreePart + 1 << "-" << numParts + << ", default " << firstFreePart + 1 << "): "; do { - prompt1 << "Partition number (" << firstFreePart + 1 << "-" << numParts - << ", default " << firstFreePart + 1 << "): "; partNum = GetNumber(firstFreePart + 1, numParts, firstFreePart + 1, prompt1.str()) - 1; if (partitions[partNum].GetFirstLBA() != 0) diff -Nru gdisk-0.8.10/mbr.cc gdisk-1.0.0/mbr.cc --- gdisk-0.8.10/mbr.cc 2014-03-02 17:57:37.000000000 +0000 +++ gdisk-1.0.0/mbr.cc 2015-03-17 22:50:38.000000000 +0000 @@ -28,6 +28,9 @@ * * ****************************************/ +MBRData::~MBRData(void) { +} // MBRData destructor + /* // Assignment operator -- copy entire set of MBR data. MBRData & MBRData::operator=(const MBRData & orig) { BasicMBRData::operator=(orig); diff -Nru gdisk-0.8.10/mbr.h gdisk-1.0.0/mbr.h --- gdisk-0.8.10/mbr.h 2014-03-02 17:57:37.000000000 +0000 +++ gdisk-1.0.0/mbr.h 2015-03-17 22:50:38.000000000 +0000 @@ -28,6 +28,7 @@ MBRData(void) {} MBRData(string deviceFilename) : BasicMBRData(deviceFilename) {} MBRData & operator=(const BasicMBRData & orig); + ~MBRData(void); // Functions to create, delete, or change partitions // Pass EmptyMBR 1 to clear the boot loader code, 0 to leave it intact diff -Nru gdisk-0.8.10/parttypes.cc gdisk-1.0.0/parttypes.cc --- gdisk-0.8.10/parttypes.cc 2014-03-02 17:57:37.000000000 +0000 +++ gdisk-1.0.0/parttypes.cc 2015-03-17 22:50:38.000000000 +0000 @@ -103,6 +103,7 @@ // Windows LDM ("dynamic disk") types AddType(0x4200, "AF9B60A0-1431-4F62-BC68-3311714A69AD", "Windows LDM data"); // Logical disk manager AddType(0x4201, "5808C8AA-7E8F-42E0-85D2-E1E90434CFB3", "Windows LDM metadata"); // Logical disk manager + AddType(0x4202, "E75CAF8F-F680-4CEE-AFA3-B001E56EFC2D", "Windows Storage Spaces"); // A newer LDM-type setup // An oddball IBM filesystem.... AddType(0x7501, "37AFFC90-EF7D-4E96-91C3-2D7AE055B174", "IBM GPFS"); // General Parallel File System (GPFS) @@ -122,7 +123,12 @@ AddType(0x8300, "0FC63DAF-8483-4772-8E79-3D69D8477DE4", "Linux filesystem"); // Linux native AddType(0x8301, "8DA63339-0007-60C0-C436-083AC8230908", "Linux reserved"); // See http://www.freedesktop.org/software/systemd/man/systemd-gpt-auto-generator.html + // and http://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/ AddType(0x8302, "933AC7E1-2EB4-4F13-B844-0E14E2AEF915", "Linux /home"); // Linux /home (auto-mounted by systemd) + AddType(0x8303, "44479540-F297-41B2-9AF7-D131D5F0458A", "Linux x86 root (/)"); // Linux / on x86 (auto-mounted by systemd) + AddType(0x8304, "4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709", "Linux x86-64 root (/)"); // Linux / on x86-64 (auto-mounted by systemd) + AddType(0x8305, "B921B045-1DF0-41C3-AF44-4C6F280D3FAE", "Linux ARM64 root (/)"); // Linux / on 64-bit ARM (auto-mounted by systemd) + AddType(0x8306, "3B8F8425-20E0-4F3B-907F-1A25A76F98E8", "Linux /srv"); // Linux /srv (auto-mounted by systemd) // Used by Intel Rapid Start technology AddType(0x8400, "D3BFE2DE-3DAF-11DF-BA40-E3A556D89593", "Intel Rapid Start"); @@ -148,6 +154,13 @@ AddType(0xa584, "85D5E45D-237C-11E1-B4B3-E89A8F7FC3A7", "Midnight BSD ZFS"); AddType(0xa585, "85D5E45C-237C-11E1-B4B3-E89A8F7FC3A7", "Midnight BSD Vinum"); + // OpenBSD partition type.... + // Note: MBR type 0xa6 is normally subdivided with a BSD disklabel. It's unclear + // if that has a GPT equivalent, so I've mapped it to the same GUID as the + // FreeBSD diskalbel. + AddType(0xa600, "516E7CB4-6ECF-11D6-8FF8-00022D09712B", "OpenBSD disklabel", 0); + AddType(0xa601, "824CC7A0-36A8-11E3-890A-952519AD3F61", "OpenBSD data"); + // A MacOS partition type, separated from others by NetBSD partition types... AddType(0xa800, "55465300-0000-11AA-AA11-00306543ECAC", "Apple UFS"); // Mac OS X @@ -205,6 +218,14 @@ AddType(0xef01, "024DEE41-33E7-11D3-9D69-0008C781F39F", "MBR partition scheme"); // Used to nest MBR in GPT AddType(0xef02, "21686148-6449-6E6F-744E-656564454649", "BIOS boot partition"); // Used by GRUB + // Ceph type codes; see https://github.com/ceph/ceph/blob/9bcc42a3e6b08521694b5c0228b2c6ed7b3d312e/src/ceph-disk#L76-L81 + AddType(0xf800, "4FBD7E29-9D25-41B8-AFD0-062C0CEFF05D", "Ceph OSD"); // Ceph Object Storage Daemon + AddType(0xf801, "4FBD7E29-9D25-41B8-AFD0-5EC00CEFF05D", "Ceph dm-crypt OSD"); // Ceph Object Storage Daemon (encrypted) + AddType(0xf802, "45B0969E-9B03-4F30-B4C6-B4B80CEFF106", "Ceph journal"); + AddType(0xf803, "45B0969E-9B03-4F30-B4C6-5EC00CEFF106", "Ceph dm-crypt journal"); + AddType(0xf804, "89C57F98-2FE5-4DC0-89C1-F3AD0CEFF2BE", "Ceph disk in creation"); + AddType(0xf805, "89C57F98-2FE5-4DC0-89C1-5EC00CEFF2BE", "Ceph dm-crypt disk in creation"); + // VMWare ESX partition types codes AddType(0xfb00, "AA31E02A-400F-11DB-9590-000C2911D1B8", "VMWare VMFS"); AddType(0xfb01, "9198EFFC-31C0-11DB-8F78-000C2911D1B8", "VMWare reserved"); diff -Nru gdisk-0.8.10/sgdisk.8 gdisk-1.0.0/sgdisk.8 --- gdisk-0.8.10/sgdisk.8 2014-03-02 17:57:37.000000000 +0000 +++ gdisk-1.0.0/sgdisk.8 2015-03-17 22:50:38.000000000 +0000 @@ -1,6 +1,6 @@ .\" Copyright 2011-2013 Roderick W. Smith (rodsmith@rodsbooks.com) .\" May be distributed under the GNU General Public License -.TH "SGDISK" "8" "0.8.10" "Roderick W. Smith" "GPT fdisk Manual" +.TH "SGDISK" "8" "1.0.0" "Roderick W. Smith" "GPT fdisk Manual" .SH "NAME" sgdisk \- Command\-line GUID partition table (GPT) manipulator for Linux and Unix .SH "SYNOPSIS" @@ -353,11 +353,19 @@ same command line will be ignored. .TP +.B \-O, \-\-print\-mbr +Display basic \fIMBR\fR partition summary data. This includes partition +numbers, starting and ending sector numbers, partition sizes, MBR partition +types codes, and partition names. This option is useful mainly for +diagnosing partition table problems, particularly on disks with hybrid +MBRs. + +.TP .B \-p, \-\-print -Display basic partition summary data. This includes partition -numbers, starting and ending sector numbers, partition sizes, -\fBsgdisk\fR's partition types codes, and partition names. For -additional information, use the \fI\-i\fR (\fI\-\-info\fR) option. +Display basic GPT partition summary data. This includes partition numbers, +starting and ending sector numbers, partition sizes, \fBsgdisk\fR's +partition types codes, and partition names. For additional information, use +the \fI\-i\fR (\fI\-\-info\fR) option. .TP .B \-P, \-\-pretend @@ -491,8 +499,7 @@ Disk replication operation (-R) failed .SH "BUGS" -As of March 2014 (version 0.8.10), \fBsgdisk\fR -should be considered beta software. Known bugs and limitations include: +Known bugs and limitations include: .TP .B * @@ -578,7 +585,7 @@ * Justin Maggard (justin.maggard@netgear.com) -* Dwight Schauer (dschauer@ti.com) +* Dwight Schauer (dschauer@gmail.com) * Florian Zumbiehl (florz@florz.de) diff -Nru gdisk-0.8.10/sgdisk.html gdisk-1.0.0/sgdisk.html --- gdisk-0.8.10/sgdisk.html 2014-03-02 17:57:37.000000000 +0000 +++ gdisk-1.0.0/sgdisk.html 2015-03-17 22:50:38.000000000 +0000 @@ -1,10 +1,11 @@ -Content-type: text/html +Content-type: text/html; charset=UTF-8 -Manpage of SGDISK + +Man page of SGDISK

SGDISK

-Section: GPT fdisk Manual (8)
Updated: 0.8.10
Index -Return to Main Contents
+Section: GPT fdisk Manual (8)
Updated: 1.0.0
Index +Return to Main Contents
 

NAME

@@ -396,13 +397,22 @@ disk's original partition table is bad; however, most other options on the same command line will be ignored.

+

-O, --print-mbr + +
+Display basic MBR partition summary data. This includes partition +numbers, starting and ending sector numbers, partition sizes, MBR partition +types codes, and partition names. This option is useful mainly for +diagnosing partition table problems, particularly on disks with hybrid +MBRs. +

-p, --print
-Display basic partition summary data. This includes partition -numbers, starting and ending sector numbers, partition sizes, -sgdisk's partition types codes, and partition names. For -additional information, use the -i (--info) option. +Display basic GPT partition summary data. This includes partition numbers, +starting and ending sector numbers, partition sizes, sgdisk's +partition types codes, and partition names. For additional information, use +the -i (--info) option.

-P, --pretend @@ -564,8 +574,7 @@  

BUGS

-As of March 2014 (version 0.8.10), sgdisk -should be considered beta software. Known bugs and limitations include: +Known bugs and limitations include:

* @@ -665,7 +674,7 @@

* Justin Maggard (justin.maggard@netgear.com)

-* Dwight Schauer (dschauer@ti.com) +* Dwight Schauer (dschauer@gmail.com)

* Florian Zumbiehl (florz@florz.de)

@@ -710,8 +719,8 @@


This document was created by -man2html, +man2html, using the manual pages.
-Time: 17:57:37 GMT, March 02, 2014 +Time: 22:50:38 GMT, March 17, 2015 diff -Nru gdisk-0.8.10/support.cc gdisk-1.0.0/support.cc --- gdisk-0.8.10/support.cc 2014-03-02 17:57:37.000000000 +0000 +++ gdisk-1.0.0/support.cc 2015-03-17 22:50:38.000000000 +0000 @@ -34,6 +34,17 @@ // Reads a string from stdin, returning it as a C++-style string. // Note that the returned string will NOT include the carriage return // entered by the user. +#ifdef EFI +extern int __sscanf( const char * str , const char * format , ... ) ; +string ReadString(void) { + string inString; + char efiString[256]; + + fgets(efiString, 255, stdin); + inString = efiString; + return inString; +} // ReadString() +#else string ReadString(void) { string inString; @@ -42,6 +53,7 @@ exit(5); return inString; } // ReadString() +#endif // Get a numeric value from the user, between low and high (inclusive). // Keeps looping until the user enters a value within that range. @@ -138,7 +150,7 @@ if (sSize == 0) { sSize = SECTOR_SIZE; - cerr << "Bug: Sector size invalid in SIToInt()!\n"; + cerr << "Bug: Sector size invalid in IeeeToInt()!\n"; } // if // Remove leading spaces, if present @@ -217,30 +229,39 @@ // Takes a size and converts this to a size in IEEE-1541-2002 units (KiB, MiB, // GiB, TiB, PiB, or EiB), returned in C++ string form. The size is either in // units of the sector size or, if that parameter is omitted, in bytes. -// (sectorSize defaults to 1). +// (sectorSize defaults to 1). Note that this function uses peculiar +// manual computation of decimal value rather than simply setting +// theValue.precision() because this isn't possible using the available +// EFI library. string BytesToIeee(uint64_t size, uint32_t sectorSize) { - float sizeInIeee; - unsigned int index = 0; + uint64_t sizeInIeee; + uint64_t previousIeee; + float decimalIeee; + uint64_t index = 0; string units, prefixes = " KMGTPEZ"; ostringstream theValue; - sizeInIeee = size * (float) sectorSize; - while ((sizeInIeee > 1024.0) && (index < (prefixes.length() - 1))) { + sizeInIeee = previousIeee = size * (uint64_t) sectorSize; + while ((sizeInIeee > 1024) && (index < (prefixes.length() - 1))) { index++; - sizeInIeee /= 1024.0; + previousIeee = sizeInIeee; + sizeInIeee /= 1024; } // while - theValue.setf(ios::fixed); if (prefixes[index] == ' ') { - units = " bytes"; - theValue.precision(0); + theValue << sizeInIeee << " bytes"; } else { units = " iB"; units[1] = prefixes[index]; - theValue.precision(1); + decimalIeee = ((float) previousIeee - + ((float) sizeInIeee * 1024.0) + 51.2) / 102.4; + if (decimalIeee >= 10.0) { + decimalIeee = 0.0; + sizeInIeee++; + } + theValue << sizeInIeee << "." << (uint32_t) decimalIeee << units; } // if/else - theValue << sizeInIeee << units; return theValue.str(); -} // BlocksToIeee() +} // BytesToIeee() // Converts two consecutive characters in the input string into a // number, interpreting the string as a hexadecimal number, starting @@ -319,11 +340,11 @@ void WinWarning(void) { #ifdef _WIN32 cout << "\a************************************************************************\n" - << "Most versions of Windows cannot boot from a GPT disk, and most varieties\n" - << "prior to Vista cannot read GPT disks. Therefore, you should exit now\n" - << "unless you understand the implications of converting MBR to GPT or creating\n" - << "a new GPT disk layout!\n" - << "************************************************************************\n\n"; + << "Most versions of Windows cannot boot from a GPT disk except on a UEFI-based\n" + << "computer, and most varieties prior to Vista cannot read GPT disks. Therefore,\n" + << "you should exit now unless you understand the implications of converting MBR\n" + << "to GPT or creating a new GPT disk layout!\n" + << "************************************************************************\n\n"; cout << "Are you SURE you want to continue? "; if (GetYN() != 'Y') exit(0); diff -Nru gdisk-0.8.10/support.h gdisk-1.0.0/support.h --- gdisk-0.8.10/support.h 2014-03-02 17:57:37.000000000 +0000 +++ gdisk-1.0.0/support.h 2015-03-17 22:50:38.000000000 +0000 @@ -8,7 +8,7 @@ #ifndef __GPTSUPPORT #define __GPTSUPPORT -#define GPTFDISK_VERSION "0.8.10" +#define GPTFDISK_VERSION "1.0.0" #if defined (__FreeBSD__) || defined (__FreeBSD_kernel__) || defined (__APPLE__) // Darwin (Mac OS) & FreeBSD: disk IOCTLs are different, and there is no lseek64