GPT fdisk 0.5.0

Added several features, including a restructuring of the menu system,
GPT-to-MBR conversion, and the ability to re-read the MBR to generate
a fresh GPT from the current on-disk MBR.
This commit is contained in:
srs5694
2009-09-21 20:51:47 -04:00
parent e35eb1beb6
commit 978041ca61
13 changed files with 1167 additions and 966 deletions

10
gpt.h
View File

@@ -67,7 +67,6 @@ protected:
int secondPartsCrcOk;
int apmFound; // set to 1 if APM detected
int bsdFound; // set to 1 if BSD disklabel detected in MBR
// uint32_t units; // display units, in multiples of sectors
PartTypes typeHelper;
public:
// Basic necessary functions....
@@ -87,6 +86,7 @@ public:
int FindOverlaps(void);
// Load or save data from/to disk
int LoadMBR(char* f) {return protectiveMBR.ReadMBRData(f);}
void PartitionScan(int fd);
int LoadPartitions(char* deviceFilename);
int ForceLoadGPTData(int fd);
@@ -111,13 +111,15 @@ public:
void DeletePartition(void);
void ChangePartType(void);
void SetAttributes(uint32_t partNum);
int DestroyGPT(void); // Returns 1 if user proceeds
int DestroyGPT(int prompt = 1); // Returns 1 if user proceeds
// Convert to GPT from other formats (may require user interaction)
// Convert between GPT and other formats (may require user interaction)
WhichToUse UseWhichPartitions(void);
int XFormPartitions(void);
int XFormDisklabel(int OnGptPart = -1);
int XFormDisklabel(BSDData* disklabel, int startPart);
int OnePartToMBR(uint32_t gptPart, int mbrPart); // add one partition to MBR. Returns 1 if successful
int XFormToMBR(void); // convert GPT to MBR, wiping GPT afterwards. Returns 1 if successful
void MakeHybrid(void);
// Adjust GPT structures WITHOUT user interaction...
@@ -139,6 +141,8 @@ public:
uint64_t GetSecondPartsLBA(void) {return secondHeader.partitionEntriesLBA;}
uint64_t GetBlocksInPartTable(void) {return (mainHeader.numParts *
mainHeader.sizeOfPartitionEntries) / blockSize;}
uint32_t CountParts(void);
// Find information about free space
uint64_t FindFirstAvailable(uint64_t start = 0);