bugGNU GRUB - Bugs: bug #50518, GRUB iPXE UEFI -- sector sizes of...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #50518: GRUB iPXE UEFI -- sector sizes of 1 bytes aren't supported yet

Submitted by:  Jamin Collins <jamincollins>
Submitted on:  Sun 12 Mar 2017 03:47:26 AM UTC  
 
Category:  Booting Severity:  Major
Priority:  5 - Normal Item Group:  Software Error
Status:  Fixed Privacy:  Public
Assigned to:  None Originator Name:  Jamin Collins
Open/Closed:  Closed Release: 
Release:  2.02~rc1 Reproducibility:  Every Time
Planned Release:  2.02

( Jump to the original submission)

Tue 14 Mar 2017 04:22:40 PM UTC, comment #11: 

Fixed in c42cb97f0881a927b5039d830d1d007f2eaa5b50, should be in 2.02.

Andrei Borzenkov <arvidjaar>
Project Member
Sun 12 Mar 2017 07:21:43 PM UTC, comment #10: 

You are using linux16/initrd16. I would never expect someone to use them on EFI system.

Anyway this is unrelated problem because I get the same reset even without iPXE involved, loading from disk. Please open separate bug for it.

Andrei Borzenkov <arvidjaar>
Project Member
Sun 12 Mar 2017 07:13:00 PM UTC, comment #9: 

Interesting.

I'm using Arch Linux with iPXE pulled directly from ipxe.org

$ qemu-system-x86_64 --version
QEMU emulator version 2.8.0
Copyright (c) 2003-2016 Fabrice Bellard and the QEMU Project developers

$ md5sum /usr/share/ovmf/ovmf_*x64.bin
f9e60326b6b1b9983d60ef981a2a5ff4  /usr/share/ovmf/ovmf_code_x64.bin
aa9703e68b787f1a391bcbf201c84e02  /usr/share/ovmf/ovmf_vars_x64.bin

$ cat fetch-pxe-firmware
curl http://boot.ipxe.org/ipxe.efi -o ipxe.efi
curl http://boot.ipxe.org/undionly.kpxe -o undionly.kpxe

$ md5sum /srv/tftp/ipxe.efi /srv/tftp/undionly.kpxe
a54fe660d6ec7ba5473c432836720c81  /srv/tftp/ipxe.efi
59da3f6d9c7499adf4d27f95e4d44fcd  /srv/tftp/undionly.kpxe

My grub menu entry is fairly basic:

menuentry 'ramdisk' --class os {
    insmod net
    insmod tftp
    insmod gzio
    insmod part_gpt

    echo 'Network status: '
    net_ls_cards
    net_ls_addr
    net_ls_routes

    echo 'Loading kernel ...'
    linux16 (tftp)/boot/bzImage

    echo 'Loading ramdisk ...'
    initrd16 (tftp)/boot/rootfs.cpio.xz
}

Immediately after transferring the ramdisk, the host reboots.  Is there any way to gather additional information?

Would a few VMs (host and pxe client) that demonstrate this issue be useful?

Jamin Collins <jamincollins>
Sun 12 Mar 2017 06:58:05 PM UTC, comment #8: 

I cannot reproduce reset. I can successfully boot after loading linux/initrd both from local disk or network. This is using qemu 2.6.2 ffea0a2c and iPXE ROM from current QEMU git.

Andrei Borzenkov <arvidjaar>
Project Member
Sun 12 Mar 2017 09:46:22 AM UTC, comment #7: 

Well, perhaps I commented too soon.  While the patch does fix the reported problem and I can now get to the GRUB menu on UEFI iPXE systems.  It seems to result in a system reset when it attempts to boot a menu entry on both physical and virtual hosts.

I've verified that legacy iPXE booting still works.

Jamin Collins <jamincollins>
Sun 12 Mar 2017 09:38:13 AM UTC, comment #6: 

The patch fixes it.

Thank you!

Jamin Collins <jamincollins>
Sun 12 Mar 2017 08:04:15 AM UTC, comment #5: 

Sorry, fixed patch attached.

(file #39975)

Andrei Borzenkov <arvidjaar>
Project Member
Sun 12 Mar 2017 08:00:57 AM UTC, comment #4: 

Please try attached patch that detects iPXE pseudo-block-io and skips it. Unfortunately older versions of iPXE do not add PXE protocol to network handle; this was added in

commit 3376fa520b0ce4ba3f0d9bad626617acf88908df
Author: Michael Brown <mcb30@ipxe.org>
Date:   Tue Sep 1 21:23:34 2015 +0100

    [efi] Implement the EFI_PXE_BASE_CODE_PROTOCOL

So for example in my case booting still fails because now we are not able to auto-configure network. So if boot fails for you with something like "root is not set" - this is iPXE issue, you need to update it.

(file #39974)

Andrei Borzenkov <arvidjaar>
Project Member
Sun 12 Mar 2017 07:10:58 AM UTC, comment #3: 

iXPE option ROM started to bind BlockIO protocol to network handles. This causes GRUB to enumerate NIC as block device, so it skips network (auto-)configuration. Later it fails because iPXE BlockIO does not match our expectations.

In case of QEMU you can work around it by either removing option ROMs entirely or forcing to not use it:

-net user,tftp=/tmp/net,bootfile=/boot/grub/x86_64-efi/core.efi -device virtio-net-pci,romfile=,vlan=0

You must use virtio-net-pci, because this is the only device OVMF has built-in driver for.

For real hardware situation is bad indeed.

BlockIO protocol is added as side effect of adding simple filesystem protocol:

commit fc87adb46c1395b09302085e9d15fcd8ab3c31fe
Author: Michael Brown <mcb30@ipxe.org>
Date:   Wed Mar 13 22:36:32 2013 +0000

    [efi] Expose downloaded images via EFI_SIMPLE_FILE_SYSTEM_PROTOCOL

And later

       /* Install the simple file system protocol, block I/O
         * protocol, and disk I/O protocol.  We don't have a block
         * device, but large parts of the EDK2 codebase make the
         * assumption that file systems are normally attached to block
         * devices, and so we create a dummy block device on the same
         * handle just to keep things looking normal.
         */

I do not have immediate ideas how to fix it. Any heuristic to skip  such devices has potential of breaking later (like skipping iSCSI volumes or similar).

Andrei Borzenkov <arvidjaar>
Project Member
Sun 12 Mar 2017 04:01:30 AM UTC, comment #2: 

I should probably also note that this is 100% reproducible using either a physical host or Qemu based virtual machine and EDK2 OVMF.

Jamin Collins <jamincollins>
Sun 12 Mar 2017 03:50:38 AM UTC, comment #1: 

The command used was:

sudo grub-mknetdir --net-directory=/srv/tftp

Jamin Collins <jamincollins>
Sun 12 Mar 2017 03:47:26 AM UTC, original submission:  

When iPXE booting a UEFI host to a GRUB menu, I receive the following error:

...
Filename: boot/grub/x86_64-efi/core.efi
tftp://x.x.x.x/boot/grub/x86_64-efi/core.efi... ok
core.efi : 206848 bytes [EFI]
Welcome to GRUB!

error: sector sizes of 1 bytes aren't supported yet.
Entering rescue mode...
grub rescue>

The netboot directory was created using grub-mknetdir version 2.02~rc1

The same configuration is able to service legacy (BIOS) based hosts successfully.

Please let me know if there's any further information I can provide (or gather) to help clarify and/or resolve this issue.

Jamin Collins <jamincollins>

 

Attached Files
file #39975:  ipxe-block-io.patch added by arvidjaar (1KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by arvidjaar (Posted a comment)
  • -email is unavailable- added by jamincollins (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-03-14 arvidjaar StatusNone => Fixed
        Open/ClosedOpen => Closed
        Planned ReleaseNone => 2.02
    2017-03-12 arvidjaar Attached File- => Added ipxe-block-io.patch, #39975
    2017-03-12 arvidjaar Attached File#39974 => Removed
    2017-03-12 arvidjaar Attached File- => Added ipxe-block-io.patch, #39974

    Back to the top


    Powered by Savane 3.5