diff options
author | srs5694 <srs5694@users.sourceforge.net> | 2011-06-10 01:16:51 -0400 |
---|---|---|
committer | srs5694 <srs5694@users.sourceforge.net> | 2011-06-10 01:16:51 -0400 |
commit | 6aae2a9b70e9f88926baad94c1eea40e0b534f01 (patch) | |
tree | 1e6d2e25970f415091b8f6518eb1f6d8e0988847 /gpttext.cc | |
parent | 699941e25a1fcf0beec124203747c8ed20842989 (diff) | |
download | sgdisk-6aae2a9b70e9f88926baad94c1eea40e0b534f01.tar.gz |
Miscellaneous bug fixes.
Diffstat (limited to 'gpttext.cc')
-rw-r--r-- | gpttext.cc | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -400,7 +400,11 @@ void GPTDataTextUI::MakeHybrid(void) { << "just hit the Enter key at the below prompt and your MBR partition table will\n" << "be untouched.\n\n\a"; - hybridMBR.SetDisk(&myDisk); + // Use a local MBR structure, copying from protectiveMBR to keep its + // boot loader code intact.... + hybridMBR = protectiveMBR; + hybridMBR.EmptyMBR(0); + // Now get the numbers of up to three partitions to add to the // hybrid MBR.... cout << "Type from one to three GPT partition numbers, separated by spaces, to be\n" @@ -424,9 +428,9 @@ void GPTDataTextUI::MakeHybrid(void) { hybridPart.SetInclusion(PRIMARY); cout << "Set the bootable flag? "; if (GetYN() == 'Y') - hybridPart.SetStatus(1); + hybridPart.SetStatus(0x80); else - hybridPart.SetStatus(0); + hybridPart.SetStatus(0x00); hybridPart.SetInclusion(PRIMARY); } else { cerr << "\nGPT partition #" << j + 1 << " does not exist; skipping.\n"; @@ -478,7 +482,7 @@ void GPTDataTextUI::MakeHybrid(void) { int GPTDataTextUI::XFormToMBR(void) { uint32_t i; - protectiveMBR.EmptyMBR(); + protectiveMBR.EmptyMBR(0); for (i = 0; i < numParts; i++) { if (partitions[i].IsUsed()) { protectiveMBR.MakePart(i, partitions[i].GetFirstLBA(), |