syslinux-efi 6.04 bug?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

syslinux-efi 6.04 bug?

Carl Karsten
I think something is broken, but I'm hardly sure what I am doing.  I
should be using a script or something and not just moving files around
like I am.

so before I open a bug report I'd like someone to look over what I have:

The script below builds an image and boots it with qemu, first with
packaged files, then with kernel.org/.../syslinux-6.04-pre1.tar.gz

 ../bld/build_uefi.sh deb
script runs, qemu boots, see errors:
Undef symbol FAIL: memset
Failed to load libcom32.c32

 ../bld/build_uefi.sh
script runs, qemu boots, see menu (no errors)


#!/bin/bash -x

# build_uefi.sh

# make an empty boot.img
# mkfs
# cp the files needed to uefi boot the installer
# from either tarbal or apt installed packaged files
# test it

# clean up leftovers
sudo umount target
set -e

dd if=/dev/zero of=boot.img bs=100M count=1
/sbin/mkfs.msdos boot.img

mkdir -p target
sudo mount -o user,uid=1000,loop boot.img target
target=target

mkdir -p $target/EFI/BOOT $target/EFI/BOOT/SYSLINUX/EFI64

if [ $1 = deb ]; then

    sudo apt install syslinux-common syslinux-efi -t stretch-backports
    cp /usr/lib/SYSLINUX.EFI/efi64/syslinux.efi $target/EFI/BOOT/BOOTX64.EFI
    cp /usr/lib/syslinux/modules/efi64/ldlinux.e64 $target/EFI/BOOT/LDLINUX.E64
    cp /usr/lib/syslinux/modules/efi64/*.c32 $target/EFI/BOOT/SYSLINUX/EFI64

else

    wget -N https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/Testing/6.04/syslinux-6.04-pre1.tar.gz
    tar -xvf syslinux-6.04-pre1.tar.gz

    cp syslinux-6.04-pre1/efi64/efi/syslinux.efi $target/EFI/BOOT/BOOTX64.EFI

    cp syslinux-6.04-pre1/efi64/com32/elflink/ldlinux/ldlinux.e64
$target/EFI/BOOT/LDLINUX.E64
    cp syslinux-6.04-pre1/efi64/com32/modules/*.c32
$target/EFI/BOOT/SYSLINUX/EFI64
    cp syslinux-6.04-pre1/efi64/com32/lib/*.c32 $target/EFI/BOOT/SYSLINUX/EFI64
    cp syslinux-6.04-pre1/efi64/com32/libutil/*.c32
$target/EFI/BOOT/SYSLINUX/EFI64
    cp syslinux-6.04-pre1/efi64/com32/menu/*.c32 $target/EFI/BOOT/SYSLINUX/EFI64

fi

cat > $target/EFI/BOOT/SYSLX64.CFG <<EOF
###  EFI/BOOT/SYSLX64.CFG  start ###

PATH SYSLINUX/EFI64/

UI SYSLINUX/EFI64/vesamenu.c32
DEFAULT lslabel
PROMPT 1
SAY *** Press enter to boot the default label ***

LABEL lslabel
COM32 SYSLINUX/EFI64/ls.c32

LABEL pwdlabel
COM32 SYSLINUX/EFI64/pwd.c32

LABEL mylabel
LINUX /linux
INITRD /initrd.gz

###  EFI/BOOT/SYSLX64.CFG  end ###
EOF

sudo umount $target

# test it
sudo apt install qemu qemu-utils qemu-system ovmf

# eufi
qemu-system-x86_64 -m 512 \
    -bios OVMF.fd \
    -drive file=boot.img,format=raw


--
Carl K

Reply | Threaded
Open this post in threaded view
|

Re: syslinux-efi 6.04 bug?

Lukas Schwaighofer
Hi Carl,

thanks for reporting!

On Mon, 3 Dec 2018 00:15:21 -0600
Carl Karsten <[hidden email]> wrote:

> Undef symbol FAIL: memset
> Failed to load libcom32.c32

This is indeed a problem with the most recent syslinux version from
Debian.  I introduced it by taking the gnu-efi 3.0.8 compatibility patch
from Ubuntu.  I've just now uploaded a new version that should fix the
problem (Carl already tested it in a private conversation, thanks!).


@Mathieu:
Since you were the author if the patch that I took, I put you in CC.  I
believe that all syslinux versions in Ubuntu that link against
gnu-efi >= 3.0.8 are affected as well.  You can check by trying to use
the vesamenu.c32 module with the efi version of syslinux.  I expect it
will fail with "Undef symbol FAIL: module memset".

I'm now no longer filtering out the memset and memcpy implementations
from syslinux.  Instead I pass -zmuldefs to the linker to avoid the
duplicate symbol linking error.  That causes the linker to use the first
definition for memset and memcpy encountered which is the one from
syslinux.  This fixes the problem.  See
https://salsa.debian.org/images-team/syslinux/commit/2d1ebd6ab76fa39adb260a522e8da788d59bb5ec
for details.

Regards
Lukas

Reply | Threaded
Open this post in threaded view
|

Re: syslinux-efi 6.04 bug?

Mathieu Trudel-Lapierre-4
On Mon, Dec 3, 2018 at 6:10 PM Lukas Schwaighofer
<[hidden email]> wrote:
>
[...]

> @Mathieu:
> Since you were the author if the patch that I took, I put you in CC.  I
> believe that all syslinux versions in Ubuntu that link against
> gnu-efi >= 3.0.8 are affected as well.  You can check by trying to use
> the vesamenu.c32 module with the efi version of syslinux.  I expect it
> will fail with "Undef symbol FAIL: module memset".
>
> I'm now no longer filtering out the memset and memcpy implementations
> from syslinux.  Instead I pass -zmuldefs to the linker to avoid the
> duplicate symbol linking error.  That causes the linker to use the first
> definition for memset and memcpy encountered which is the one from

Thanks!

I'll have another look.

--

Mathieu Trudel-Lapierre <[hidden email]>
Freenode: cyphermox, Jabber: [hidden email]
4096R/65B58DA1 818A D123 0992 275B 23C2  CF89 C67B B4D6 65B5 8DA1

Reply | Threaded
Open this post in threaded view
|

Re: syslinux-efi 6.04 bug?

Carl Karsten
  303  sudo apt-get purge "syslinux*"
  309  sudo vim /etc/apt/sources.list
add sid
  310  sudo apt update
  311  sudo apt install -t sid syslinux syslinux-efi syslinux-common

re-ran my test, no error, so good.

Thanks all.

On Tue, Dec 4, 2018 at 7:20 AM Mathieu Trudel-Lapierre
<[hidden email]> wrote:

>
> On Mon, Dec 3, 2018 at 6:10 PM Lukas Schwaighofer
> <[hidden email]> wrote:
> >
> [...]
> > @Mathieu:
> > Since you were the author if the patch that I took, I put you in CC.  I
> > believe that all syslinux versions in Ubuntu that link against
> > gnu-efi >= 3.0.8 are affected as well.  You can check by trying to use
> > the vesamenu.c32 module with the efi version of syslinux.  I expect it
> > will fail with "Undef symbol FAIL: module memset".
> >
> > I'm now no longer filtering out the memset and memcpy implementations
> > from syslinux.  Instead I pass -zmuldefs to the linker to avoid the
> > duplicate symbol linking error.  That causes the linker to use the first
> > definition for memset and memcpy encountered which is the one from
>
> Thanks!
>
> I'll have another look.
>
> --
>
> Mathieu Trudel-Lapierre <[hidden email]>
> Freenode: cyphermox, Jabber: [hidden email]
> 4096R/65B58DA1 818A D123 0992 275B 23C2  CF89 C67B B4D6 65B5 8DA1



--
Carl K