bugGNU GRUB - Bugs: bug #42631, 64bit EFI net_bootp fails to...


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

bug #42631: 64bit EFI net_bootp fails to configure network

Submitter:  Curtis Larsen <fractal13>
Submitted:  Fri 27 Jun 2014 03:54:37 AM UTC
Category:  Network Severity:  Major
Priority:  5 - Normal Item Group:  Hardware-specific
Status:  None Privacy:  Public
Assigned to:  None Originator Name:  fractal13
Open/Closed:  Open Release:  Git master
Release:  Reproducibility:  Intermittent
Planned Release:  2.03+

Fri 12 Jun 2015 10:18:32 AM UTC, comment #4: 

Could you test current master? There are chances that it works here (there were changes in how grub enumerates cards).

Andrei Borzenkov <arvidjaar>
Group Member
Fri 05 Dec 2014 07:32:28 PM UTC, comment #3: 

We want to find interface that was used for netboot; this is the most likely to be the correct one. Configuring arbitrary interface is probably wrong here. If Apple does not support PXE protocol on this interface - is there any other Apple-specific protocol that can be used?

Andrei Borzenkov <arvidjaar>
Group Member
Sat 28 Jun 2014 11:24:18 PM UTC, comment #2: 

Attached is the git-diff output for 3 changes to make GRUB Netboot EFI correctly and automatically configure the network.  Be sure that your ISC DHCP server has the "dynamic-bootp" option for the "range" directive affecting your systems that use this.

1- Make net_bootp not bail if any of the network cards may be configurable.
2- Make net_bootp configure the net_default variables if it finds a DHCP server.
3- Make the efinet drive call the net_bootp command if it fails to initialize all of the cards.

I realize these changes are not elegant, but I hope they document the issues at hand and help others who work in the GRUB code regularly.

Thanks for the great software.

(file #31629)

Curtis Larsen <fractal13>
Sat 28 Jun 2014 06:26:18 PM UTC, comment #1: 

Updated information:

In grub-core/net/bootp.c:grub_cmd_bootp() I believe that choice to return if one of the network cards has an error could be improved by skipping that card, but continue to attempt to use the other card(s).  But that is not my core issue.

I was only using the net_bootp command in an attempt to force the network card to be configured using the DHCP configured information that is residing somewhere in EFI.

After more digging, I found grub-core/net/drivers/efi/grub_efi_net_config_real() which is called from grub_main()->grub_set_prefix_and_root()->grub_machine_get_bootlocation().

grub_efi_net_config_real() fails to configure the expected card when grub_efi_open_protocol() fails.  grub_efi_open_protocol() fails because efi_call_6() returns error code 3(GRUB_EFI_UNSUPPORTED).

Because of this the network card is not configured with an address, and networking is not working.

However, the network interface does become configured at a random time (many minutes) in the future, without any interaction by the user.  As stated earlier, it doesn't appear to be initiated by DHCP traffic between the DHCP server and the EFI firmware.

Any insight would be much appreciated.

Curtis Larsen <fractal13>
Fri 27 Jun 2014 03:54:37 AM UTC, original submission:  

I'm sending grub64.efi to two different apple iMacs (iMac11,2 and iMac14,1) via DHCP/BOOTP/TFTP configured to speak Apple's Netboot.

grub64.efi is built with "grub-mkimage -O x86_64-efi" and includes a whole slew of modules including efi_gop, efi_uga, efinet, net, and tftp.

At power-up the iMac is sent to Apple's boot menu by holding the "Option" key.  Monitoring of the DHCP/BOOTP server shows that the machine requests and is given DHCP configuration, as well as Netboot options.

In Apple's boot menu, the GRUB option is selected.  Monitoring of the TFTP server shows that the grub64.efi file is transferred as expected.

GRUB runs on the iMac and presents the shell from normal mode.

So far, so good.

At the grub> prompt run net_bootp, and "error: couldn't send network packet." is displayed.  net_ls_addr now shows both network cards (wired and wireless) with dhcp_tmp and temporary.  (DHCP server is configured with 5 minute leases.)  I know the iMac still has the lease, as the DHCP server shows the REQUEST/ACK of renews, and net_ls_addr still shows temporary.

Then, at some magically determined point, many minutes later, net_ls_addr shows that the network has been configured.  I've watched the DHCP REQUEST/ACK renewals and they are not responsible for the network configuration.

I've traced the error message to grub-core/net/drivers/efi/efinet.c:send_card_buffer.  The error is caught at the end of the function.  I inserted some debugging printfs to see that the error code is 7 (GRUB_EFI_DEVICE_ERROR).

I'd be very happy to work with someone to debug and fix this issue.

Thanks for the great software.

Curtis Larsen <fractal13>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files


Depends on the following items: None found

Items that depend on this one: None found


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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.


    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-03-02 phcoder Item GroupNone Hardware-specific
        Planned ReleaseNone 2.03+
    2014-06-28 fractal13 Attached File- Added grub-git-diff-netboot-efi-mac.diff, #31629

    Back to the top

    Powered by Savane 3.12.
    Corresponding source code