Discussion:
Bug#1051445: syslinux.efi crashes on isohybrid boot as cdrom
(too old to reply)
Ralph Ronnquist
2023-09-08 07:00:01 UTC
Permalink
Package: syslinux-efi
Version: 6.04~git20190206.bf6db5b4+dfsg1

The use case of a hybrid ISO where an EFI partition with syslinux.efi
is set up as El Torrito boot option, all duly equipped. works fine
when the media is provided as disk drive, but not when the same media
is provided as cdrom drive.

The cause seems to be in a mixup between the actual and assumed media
sector sizes; a cdrom has 2048 byte sectors while a disk has 256 byte
sectors. (In particular the partition table on the ISO has sector
indexes based on 256 byte sectors)

As an attempt to resolve that, I made teh attached patch for
efi/diskio.c. It resolves the sector size "mixup" by means of a
wrapper function for disk reading/writing that translates between
(hardcoded) "wanted" sectors of 256 byte size, and "actual"
(bio->Media->BlockSize) when different from that. The implementation
lacks some in efficiency but works well enough for boot loading.

I also attch the patch for efi/efi.h I needed in order to build the
package.

Hopefully this patching can be applied to the syslinux-efi package, to
allow for isohybrid ISO that has only isolinux/syslinux as boot setup.

Ralph.
Thomas Schmitt
2023-09-09 09:10:01 UTC
Permalink
Hi,

congrats for solving this long standing problem.

A few years ago this would have been great news for Knoppix, which staid
for quite a while with SYSLINUX for EFI. But somewhere between versions
8.6 (2019) and 9.3 (2022) it switched to GRUB.

Although the most recent commit on https://repo.or.cz/syslinux.git is
4.5 years old, consider to post your patches to
***@syslinux.org
Maybe it helps some puzzled SYSLINUX user in the future.


Have a nice day :)

Thomas
Ralph Ronnquist
2023-09-23 05:30:01 UTC
Permalink
Note that a debian package patch on 3:6.04~git20190206.bf6db5b4+dfsg1-3
is available at:

https://git.devuan.org/devuan/syslinux/raw/branch/suites/experimental/debian/patches/0020-fix-cdrom-on-uefi.patch

That's the patch used for the Devuan experimental release package.
Presumably it can be used directly a Debian pcakage upgrade.

regards,

Ralph.

Loading...