Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ptgen: don’t insert CHS gap head in MBR partition tables #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ptgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ static inline void init_utf16(char *str, uint16_t *buf, unsigned bufsize)
static int gen_ptable(uint32_t signature, int nr)
{
struct pte pte[MBR_ENTRY_MAX];
unsigned long start, len, sect = 0;
unsigned long start, len, sect = kb_align ? 1 : sectors;
int i, fd, ret = -1;

memset(pte, 0, sizeof(struct pte) * MBR_ENTRY_MAX);
Expand All @@ -321,7 +321,7 @@ static int gen_ptable(uint32_t signature, int nr)
pte[i].active = ((i + 1) == active) ? 0x80 : 0;
pte[i].type = parts[i].type;

start = sect + sectors;
start = sect;
if (parts[i].start != 0) {
if (parts[i].start * 2 < start) {
fprintf(stderr, "Invalid start %ld for partition %d!\n",
Expand Down