Skip to content

Fix two separate El Torito bugs. - #183

Merged
clalancette merged 1 commit into
masterfrom
clalancette/fix-eltorito
Aug 24, 2026
Merged

Fix two separate El Torito bugs.#183
clalancette merged 1 commit into
masterfrom
clalancette/fix-eltorito

Conversation

@clalancette

Copy link
Copy Markdown
Owner
  1. The OpenBSD ISO apparently uses 0xdf instead of 0x00 for padding, which means our earlier heuristic for determining the end of the El Torito section (used for FreeBSD) didn't work there. Now we instead make sure that the number of sections equals the number we were told at the beginning, ignoring the padding. That makes it work for both, even in the absence of a proper terminator.

  2. Running "genisoimage -no-boot" created an ISO that we couldn't parse because it added in 0x00 in the list, and 0x00 was being handled up-front so could never be hit later. 0x0 is unfortunately ambiguous; it means both non-bootable entry and terminator simultaneously, so we have to use context to figure out which one we should do. If the last section header still needs an entry, and the record has non-zero content, we treat it as a non-bootable entry. Otherwise we treat it as the terminator.

This fixes #180

1.  The OpenBSD ISO apparently uses 0xdf instead of 0x00
for padding, which means our earlier heuristic for determining
the end of the El Torito section (used for FreeBSD) didn't
work there.  Now we instead make sure that the number of
sections equals the number we were told at the beginning,
ignoring the padding.  That makes it work for both, even
in the absence of a proper terminator.

2.  Running "genisoimage -no-boot" created an ISO that we
couldn't parse because it added in 0x00 in the list, and
0x00 was being handled up-front so could never be hit
later.  0x0 is unfortunately ambiguous; it means both
non-bootable entry and terminator simultaneously, so we
have to use context to figure out which one we should do.
If the last section header still needs an entry, and the
record has non-zero content, we treat it as a non-bootable
entry.  Otherwise we treat it as the terminator.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
@clalancette
clalancette merged commit 2182bce into master Aug 24, 2026
5 checks passed
@clalancette
clalancette deleted the clalancette/fix-eltorito branch August 24, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error reading official OpenBSD install iso

1 participant