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

 
 

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

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

Submitted by:  Curtis Larsen <fractal13>
Submitted on:  Fri 27 Jun 2014 03:54:37 AM UTC  
 
Category: NetworkSeverity: Major
Priority: 5 - NormalItem Group: None
Status: NonePrivacy: Public
Assigned to: NoneOriginator Name: fractal13
Open/Closed: OpenRelease: 
Release: Git masterReproducibility: Intermittent
Planned Release: None

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>
Project 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.

Changes:
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>

 

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 28 Jun 2014 11:24:18 PM UTCfractal13Attached File-=>Added grub-git-diff-netboot-efi-mac.diff, #31629

    Back to the top


    Powered by Savane 3.1-cleanup