diff options
author | Roderick W. Smith <rodsmith@rodsbooks.com> | 2013-09-24 12:56:11 -0400 |
---|---|---|
committer | Roderick W. Smith <rodsmith@rodsbooks.com> | 2013-09-24 12:56:11 -0400 |
commit | e3ee733ff8690af7568dac665bc20ecf869dea1d (patch) | |
tree | 2dd7293e1a607729d26174ace272524a17c5d24a | |
parent | 427c799b611e357223da28c778a08451fb789590 (diff) | |
download | sgdisk-e3ee733ff8690af7568dac665bc20ecf869dea1d.tar.gz |
Removed 0x8302 type code, since the Red Hat parted developers have
decided against using it.
-rw-r--r-- | NEWS | 11 | ||||
-rw-r--r-- | attributes.cc | 2 | ||||
-rw-r--r-- | basicmbr.cc | 8 | ||||
-rw-r--r-- | basicmbr.h | 2 | ||||
-rw-r--r-- | gdisk.cc | 2 | ||||
-rw-r--r-- | gpt.cc | 2 | ||||
-rw-r--r-- | gptcl.cc | 4 | ||||
-rw-r--r-- | gptcl.h | 2 | ||||
-rw-r--r-- | gptcurses.cc | 7 | ||||
-rw-r--r-- | gptcurses.h | 2 | ||||
-rw-r--r-- | gptpart.cc | 2 | ||||
-rw-r--r-- | gpttext.cc | 2 | ||||
-rw-r--r-- | gpttext.h | 2 | ||||
-rw-r--r-- | mbr.cc | 2 | ||||
-rw-r--r-- | mbr.h | 2 | ||||
-rw-r--r-- | parttypes.cc | 27 | ||||
-rw-r--r-- | parttypes.h | 4 | ||||
-rw-r--r-- | support.cc | 2 | ||||
-rw-r--r-- | support.h | 2 |
19 files changed, 49 insertions, 38 deletions
@@ -1,6 +1,12 @@ 0.8.8 (?/??/2013): ------------------ +- The number of partition type codes has grown large enough that it fills + an 80x24 display. I've therefore added a pause (with a prompt to hit + <Enter>) to display more items after showing 21 lines in gdisk or after + the screen has nearly filled with entries in cgdisk. There's no such + pause/prompt in sgdisk, though. + - Fine-tuned verification ('v') check for 0xEE partition that doesn't begin on sector 1: Previously, a disk with multiple 0xEE partitions would always trigger this warning. Now, the warning occurs only if NONE of the @@ -10,11 +16,6 @@ opted to create an extra partition to cover unused space following hybridized partitions, gdisk would hang. -- Added support for new partition type code, - 47CB5633-7E3E-408B-B7B8-2D915B7B21B1 (0x8302), which parted (git versions - leading up to 3.2) uses for HFS+ partitions that hold Linux boot files on - Macs. This type code corresponds to the "hfs_esp" flag in parted. - - Added check for an active/bootable 0xEE protective partition to the verify ('v') function. If found, this is not counted as an error, but it is called out to the user, since it can cause some EFIs (such as diff --git a/attributes.cc b/attributes.cc index 45de56e..f3cd585 100644 --- a/attributes.cc +++ b/attributes.cc @@ -3,7 +3,7 @@ // of which only four are currently (2/2011) documented on Wikipedia, and // two others found from other sources. -/* This program is copyright (c) 2009-2011 by Roderick W. Smith. It is distributed +/* This program is copyright (c) 2009-2013 by Roderick W. Smith. It is distributed under the terms of the GNU GPL version 2, as detailed in the COPYING file. */ #define __STDC_LIMIT_MACROS diff --git a/basicmbr.cc b/basicmbr.cc index 6cea80f..59d575c 100644 --- a/basicmbr.cc +++ b/basicmbr.cc @@ -3,7 +3,7 @@ /* Initial coding by Rod Smith, January to February, 2009 */ -/* This program is copyright (c) 2009-2011 by Roderick W. Smith. It is distributed +/* This program is copyright (c) 2009-2013 by Roderick W. Smith. It is distributed under the terms of the GNU GPL version 2, as detailed in the COPYING file. */ #define __STDC_LIMIT_MACROS @@ -907,7 +907,7 @@ int BasicMBRData::SpaceBeforeAllLogicals(void) { } // BasicMBRData::SpaceBeforeAllLogicals() // Returns 1 if the partitions describe a legal layout -- all logicals -// are contiguous and have at least one preceding empty partitions, +// are contiguous and have at least one preceding empty sector, // the number of primaries is under 4 (or under 3 if there are any // logicals), there are no overlapping partitions, etc. // Does NOT assume that primaries are numbered 1-4; uses the @@ -928,11 +928,11 @@ int BasicMBRData::IsLegal(void) { // Returns 1 if the 0xEE partition in the protective/hybrid MBR is marked as // active/bootable. int BasicMBRData::IsEEActive(void) { - int i, IsActive = FALSE; + int i, IsActive = 0; for (i = 0; i < MAX_MBR_PARTS; i++) { if ((partitions[i].GetStatus() & 0x80) && (partitions[i].GetType() == 0xEE)) - IsActive = TRUE; + IsActive = 1; } return IsActive; } // BasicMBRData::IsEEActive() @@ -1,6 +1,6 @@ /* basicmbr.h -- MBR data structure definitions, types, and functions */ -/* This program is copyright (c) 2009 by Roderick W. Smith. It is distributed +/* This program is copyright (c) 2009-2013 by Roderick W. Smith. It is distributed under the terms of the GNU GPL version 2, as detailed in the COPYING file. */ #include <stdint.h> @@ -4,7 +4,7 @@ // // by Rod Smith, project began February 2009 -/* This program is copyright (c) 2009-2011 by Roderick W. Smith. It is distributed +/* This program is copyright (c) 2009-2013 by Roderick W. Smith. It is distributed under the terms of the GNU GPL version 2, as detailed in the COPYING file. */ #include <string.h> @@ -3,7 +3,7 @@ /* By Rod Smith, initial coding January to February, 2009 */ -/* This program is copyright (c) 2009-2012 by Roderick W. Smith. It is distributed +/* This program is copyright (c) 2009-2013 by Roderick W. Smith. It is distributed under the terms of the GNU GPL version 2, as detailed in the COPYING file. */ #define __STDC_LIMIT_MACROS @@ -1,7 +1,7 @@ /* Implementation of GPTData class derivative with popt-based command line processing - Copyright (C) 2010-2011 Roderick W. Smith + Copyright (C) 2010-2013 Roderick W. Smith This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -131,7 +131,7 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) { Attributes::ListAttributes(); break; case 'L': - typeHelper.ShowAllTypes(); + typeHelper.ShowAllTypes(0); break; case 'P': pretend = 1; @@ -1,7 +1,7 @@ /* Implementation of GPTData class derivative with popt-based command line processing - Copyright (C) 2010-2011 Roderick W. Smith + Copyright (C) 2010-2013 Roderick W. Smith This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gptcurses.cc b/gptcurses.cc index ec653b0..2ec8a40 100644 --- a/gptcurses.cc +++ b/gptcurses.cc @@ -1,7 +1,7 @@ /* * Implementation of GPTData class derivative with curses-based text-mode * interaction - * Copyright (C) 2011 Roderick W. Smith + * Copyright (C) 2011-2013 Roderick W. Smith * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -737,8 +737,9 @@ void GPTDataCurses::DrawMenu(void) { string drive="Disk Drive: "; drive += device; ostringstream size; + size << "Size: " << diskSize << ", " << BytesToIeee(diskSize, blockSize); - + clear(); move(0, (COLS - title.length()) / 2); printw(title.c_str()); @@ -811,7 +812,7 @@ void ShowTypes(void) { def_prog_mode(); endwin(); - tempType.ShowAllTypes(); + tempType.ShowAllTypes(LINES - 3); cout << "\nPress the <Enter> key to continue: "; cin.get(junk); reset_prog_mode(); diff --git a/gptcurses.h b/gptcurses.h index 3b1fd9a..9a14f7e 100644 --- a/gptcurses.h +++ b/gptcurses.h @@ -1,7 +1,7 @@ /* * Implementation of GPTData class derivative with curses-based text-mode * interaction - * Copyright (C) 2011 Roderick W. Smith + * Copyright (C) 2011-2013 Roderick W. Smith * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -4,7 +4,7 @@ // Description: Class to implement a SINGLE GPT partition // // -// Author: Rod Smith <rodsmith@rodsbooks.com>, (C) 2009-2011 +// Author: Rod Smith <rodsmith@rodsbooks.com>, (C) 2009-2013 // // Copyright: See COPYING file that comes with this distribution // @@ -1,5 +1,5 @@ /* - Copyright (C) 2010-2011 <Roderick W. Smith> + Copyright (C) 2010-2013 <Roderick W. Smith> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1,6 +1,6 @@ /* Implementation of GPTData class derivative with basic text-mode interaction - Copyright (C) 2010-2011 Roderick W. Smith + Copyright (C) 2010-2013 Roderick W. Smith This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -3,7 +3,7 @@ /* Initial coding by Rod Smith, January to February, 2009 */ -/* This program is copyright (c) 2009 by Roderick W. Smith. It is distributed +/* This program is copyright (c) 2009-2013 by Roderick W. Smith. It is distributed under the terms of the GNU GPL version 2, as detailed in the COPYING file. */ #define __STDC_LIMIT_MACROS @@ -1,6 +1,6 @@ /* mbr.h -- MBR data structure definitions, types, and functions */ -/* This program is copyright (c) 2009 by Roderick W. Smith. It is distributed +/* This program is copyright (c) 2009-2013 by Roderick W. Smith. It is distributed under the terms of the GNU GPL version 2, as detailed in the COPYING file. */ #include <stdint.h> diff --git a/parttypes.cc b/parttypes.cc index c47b864..bcb730e 100644 --- a/parttypes.cc +++ b/parttypes.cc @@ -2,7 +2,7 @@ // Class to manage partition type codes -- a slight variant on MBR type // codes, GUID type codes, and associated names. -/* This program is copyright (c) 2009-2012 by Roderick W. Smith. It is distributed +/* This program is copyright (c) 2009-2013 by Roderick W. Smith. It is distributed under the terms of the GNU GPL version 2, as detailed in the COPYING file. */ #define __STDC_LIMIT_MACROS @@ -110,7 +110,6 @@ void PartType::AddAllTypes(void) { AddType(0x8200, "0657FD6D-A4AB-43C4-84E5-0933C84B4F4F", "Linux swap"); // Linux swap (or Solaris on MBR) AddType(0x8300, "0FC63DAF-8483-4772-8E79-3D69D8477DE4", "Linux filesystem"); // Linux native AddType(0x8301, "8DA63339-0007-60C0-C436-083AC8230908", "Linux reserved"); - AddType(0x8302, "47CB5633-7E3E-408B-B7B8-2D915B7B21B1", "Linux HFS+"); // Used by Fedora on Macs // Used by Intel Rapid Start technology AddType(0x8400, "D3BFE2DE-3DAF-11DF-BA40-E3A556D89593", "Intel Rapid Start"); @@ -349,11 +348,14 @@ uint16_t PartType::GetHexType() const { // Displays the available types and my extended MBR codes for same.... // Note: This function assumes an 80-column display. On wider displays, // it stops at under 80 columns; on narrower displays, lines will wrap -// in an ugly way. -void PartType::ShowAllTypes(void) const { - int colCount = 1; // column count +// in an ugly way. The maxLines value is the maximum number of lines +// to display before prompting to continue, or 0 (or a negative value) +// for no limit. +void PartType::ShowAllTypes(int maxLines) const { + int colCount = 1, lineCount = 1; size_t i; AType* thisType = allTypes; + string line; cout.unsetf(ios::uppercase); while (thisType != NULL) { @@ -364,17 +366,24 @@ void PartType::ShowAllTypes(void) const { cout << thisType->name.substr(0, 20); for (i = 0; i < (20 - (thisType->name.substr(0, 20).length())); i++) cout << " "; - if ((colCount % 3) == 0) - cout << "\n"; - else + if ((colCount % 3) == 0) { + if (thisType->next) { + cout << "\n"; + if ((maxLines > 0) && (lineCount++ % maxLines) == 0) { + cout << "Press the <Enter> key to see more codes: "; + getline(cin, line); + } // if reached screen line limit + } // if there's another entry following this one + } else { cout << " "; + } colCount++; } // if thisType = thisType->next; } // while cout.fill(' '); cout << "\n" << dec; -} // PartType::ShowTypes() +} // PartType::ShowAllTypes(int maxLines) // Returns 1 if code is a valid extended MBR code, 0 if it's not int PartType::Valid(uint16_t code) const { diff --git a/parttypes.h b/parttypes.h index c45d8e4..dd23e94 100644 --- a/parttypes.h +++ b/parttypes.h @@ -1,4 +1,4 @@ -/* This program is copyright (c) 2009 by Roderick W. Smith. It is distributed +/* This program is copyright (c) 2009-2013 by Roderick W. Smith. It is distributed under the terms of the GNU GPL version 2, as detailed in the COPYING file. */ #include <stdint.h> @@ -60,7 +60,7 @@ public: uint16_t GetHexType() const; // Information relating to all type data - void ShowAllTypes(void) const; + void ShowAllTypes(int maxLines = 21) const; int Valid(uint16_t code) const; }; @@ -3,7 +3,7 @@ // Primarily by Rod Smith, February 2009, but with a few functions // copied from other sources (see attributions below). -/* This program is copyright (c) 2009 by Roderick W. Smith. It is distributed +/* This program is copyright (c) 2009-2013 by Roderick W. Smith. It is distributed under the terms of the GNU GPL version 2, as detailed in the COPYING file. */ #define __STDC_LIMIT_MACROS @@ -1,4 +1,4 @@ -/* This program is copyright (c) 2009 by Roderick W. Smith. It is distributed +/* This program is copyright (c) 2009-2013 by Roderick W. Smith. It is distributed under the terms of the GNU GPL version 2, as detailed in the COPYING file. */ #include <stdint.h> |