Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gptfdisk
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
public-release-test-restored
platform
external
gptfdisk
Commits
9b338c50
Commit
9b338c50
authored
11 years ago
by
Roderick W. Smith
Browse files
Options
Downloads
Patches
Plain Diff
Fixed new bug with hybrid MBR creation in gdisk; couldn't do more than
one partition because of sscanf weirdness.
parent
84aaff6b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
NEWS
+10
-0
10 additions, 0 deletions
NEWS
gptpart.cc
+5
-0
5 additions, 0 deletions
gptpart.cc
gptpart.h
+1
-0
1 addition, 0 deletions
gptpart.h
gpttext.cc
+7
-4
7 additions, 4 deletions
gpttext.cc
parttypes.cc
+1
-1
1 addition, 1 deletion
parttypes.cc
support.h
+1
-1
1 addition, 1 deletion
support.h
with
25 additions
and
6 deletions
NEWS
+
10
−
0
View file @
9b338c50
0.8.10 (?/??/2014):
-------------------
- Fixed new (in 0.8.9) bug that caused a failure to create more than one
hybridized partition when creating a hybrid MBR.
- Fixed bug that caused gdisk to create hybridized partitions that ended
above the 2^32 sector point with incorrect end values. The program now
refuses to create such hybridized partitions at all.
0.8.9 (2/17/2014):
------------------
...
...
This diff is collapsed.
Click to expand it.
gptpart.cc
+
5
−
0
View file @
9b338c50
...
...
@@ -138,6 +138,11 @@ int GPTPart::IsUsed(void) {
return
(
partitionType
!=
GUIDData
(
"0x00"
));
}
// GPTPart::IsUsed()
// Returns 1 if the partition's end point is under (2^32 - 1) sectors, 0 if it's over that value.
int
GPTPart
::
IsSizedForMBR
(
void
)
{
return
(
lastLBA
<
UINT32_MAX
);
}
// GPTPart::IsSizedForMBR()
// Set the type code to the specified one. Also changes the partition
// name *IF* the current name is the generic one for the current partition
// type.
...
...
This diff is collapsed.
Click to expand it.
gptpart.h
+
1
−
0
View file @
9b338c50
...
...
@@ -63,6 +63,7 @@ class GPTPart {
void
ShowAttributes
(
uint32_t
partNum
)
{
attributes
.
ShowAttributes
(
partNum
);}
UnicodeString
GetDescription
(
void
);
int
IsUsed
(
void
);
int
IsSizedForMBR
(
void
);
// Simple data assignment:
void
SetType
(
PartType
t
);
...
...
This diff is collapsed.
Click to expand it.
gpttext.cc
+
7
−
4
View file @
9b338c50
...
...
@@ -396,7 +396,7 @@ void GPTDataTextUI::ShowDetails(void) {
void
GPTDataTextUI
::
MakeHybrid
(
void
)
{
uint32_t
partNums
[
3
];
string
line
;
int
numPartsToCvt
,
i
,
j
,
mbrNum
=
0
;
int
numPartsToCvt
=
0
,
i
,
j
,
mbrNum
=
0
;
unsigned
int
hexCode
=
0
;
MBRPart
hybridPart
;
MBRData
hybridMBR
;
...
...
@@ -416,7 +416,10 @@ void GPTDataTextUI::MakeHybrid(void) {
cout
<<
"Type from one to three GPT partition numbers, separated by spaces, to be
\n
"
<<
"added to the hybrid MBR, in sequence: "
;
line
=
ReadString
();
numPartsToCvt
=
sscanf
(
line
.
c_str
(),
"%ud %ud %ud"
,
&
partNums
[
0
],
&
partNums
[
1
],
&
partNums
[
2
]);
istringstream
inLine
(
line
);
do
{
inLine
>>
partNums
[
numPartsToCvt
++
];
}
while
(
!
inLine
.
eof
()
&&
(
numPartsToCvt
<
3
));
if
(
numPartsToCvt
>
0
)
{
cout
<<
"Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? "
;
...
...
@@ -425,7 +428,7 @@ void GPTDataTextUI::MakeHybrid(void) {
for
(
i
=
0
;
i
<
numPartsToCvt
;
i
++
)
{
j
=
partNums
[
i
]
-
1
;
if
(
partitions
[
j
].
IsUsed
())
{
if
(
partitions
[
j
].
IsUsed
()
&&
partitions
[
j
].
IsSizedForMBR
()
)
{
mbrNum
=
i
+
(
eeFirst
==
'Y'
);
cout
<<
"
\n
Creating entry for GPT partition #"
<<
j
+
1
<<
" (MBR partition #"
<<
mbrNum
+
1
<<
")
\n
"
;
...
...
@@ -439,7 +442,7 @@ void GPTDataTextUI::MakeHybrid(void) {
hybridPart
.
SetStatus
(
0x00
);
hybridPart
.
SetInclusion
(
PRIMARY
);
}
else
{
cerr
<<
"
\n
GPT partition #"
<<
j
+
1
<<
" does not exist; skipping.
\n
"
;
cerr
<<
"
\n
GPT partition #"
<<
j
+
1
<<
" does not exist
or is too big
; skipping.
\n
"
;
}
// if/else
hybridMBR
.
AddPart
(
mbrNum
,
hybridPart
);
}
// for
...
...
This diff is collapsed.
Click to expand it.
parttypes.cc
+
1
−
1
View file @
9b338c50
...
...
@@ -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-201
3
by Roderick W. Smith. It is distributed
/* This program is copyright (c) 2009-201
4
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
...
...
This diff is collapsed.
Click to expand it.
support.h
+
1
−
1
View file @
9b338c50
...
...
@@ -8,7 +8,7 @@
#ifndef __GPTSUPPORT
#define __GPTSUPPORT
#define GPTFDISK_VERSION "0.8.9"
#define GPTFDISK_VERSION "0.8.9
.1
"
#if defined (__FreeBSD__) || defined (__FreeBSD_kernel__) || defined (__APPLE__)
// Darwin (Mac OS) & FreeBSD: disk IOCTLs are different, and there is no lseek64
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment