RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1483740 - pxe booting with grubaa64.efi adds extra "-" to config filename
Summary: pxe booting with grubaa64.efi adds extra "-" to config filename
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: grub2
Version: 7.4
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: 7.5
Assignee: Peter Jones
QA Contact: Release Test Team
Petr Bokoc
URL:
Whiteboard:
: 1479496 1487107 (view as bug list)
Depends On:
Blocks: 1485496 1487106 1495216 1497323
TreeView+ depends on / blocked
 
Reported: 2017-08-21 20:23 UTC by Jeff Bastian
Modified: 2018-04-11 10:11 UTC (History)
13 users (show)

Fixed In Version: grub2-2.02-0.65.el7
Doc Type: Bug Fix
Doc Text:
A bug in the GRUB2 boot loader caused a trailing "-" character to be added to the client MAC address when attempting to load configuration files from a tftp server during PXE boot. This update fixes the bug, and clients can now load their GRUB2 configuration files from tftp servers successfully.
Clone Of:
: 1495216 1497323 (view as bug list)
Environment:
Last Closed: 2018-04-11 10:11:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1495216 1 None None None 2021-01-20 06:05:38 UTC

Internal Links: 1495216

Description Jeff Bastian 2017-08-21 20:23:24 UTC
Description of problem:
I configured a PXE server for 64-bit ARM clients, and the clients were failing to find their config files on the tftp server and just getting dropped to the "grub>" prompt.  I watched the network packets with Wireshark and noticed that there is an extra trailing "-" after the MAC address in the config filename:

Read Request, File: /pxegrub/grub.cfg-01-00-01-73-02-02-ea-
Read Request, File: /pxegrub/grub.cfg-0A0CD3F7
Read Request, File: /pxegrub/grub.cfg-0A0CD3F
Read Request, File: /pxegrub/grub.cfg-0A0CD3
Read Request, File: /pxegrub/grub.cfg-0A0CD
Read Request, File: /pxegrub/grub.cfg-0A0C
Read Request, File: /pxegrub/grub.cfg-0A0
Read Request, File: /pxegrub/grub.cfg-0A
Read Request, File: /pxegrub/grub.cfg-0
Read Request, File: /pxegrub/grub.cfg

Please remove the trailing "-" character from the first tftp request.


Version-Release number of selected component (if applicable):
grub2-efi-aa64-2.02-0.64.el7.aarch64.rpm

How reproducible:
always

Steps to Reproduce:
1. PXE boot a 64-bit ARM system
2. on the PXE server, watch the packets: 
     tshark -w tftp.pcap -i eth0 udp port 69

Actual results:
first tftp request appends a "-" char after the MAC address and the system fails to find its grub config file

Expected results:
no trailing "-"

Additional info:

Comment 1 Jeff Bastian 2017-08-21 20:51:26 UTC
I did some bisecting of grub versions and found the bug was introduced with grub2-efi-aa64-2.02-0.61.el7.aarch64.rpm

Comment 3 Mark Salter 2017-08-22 15:23:30 UTC
The problem was introduced in  0002-Add-support-for-non-Ethernet-network-cards.patch which added support for longer hw addresses.

This change:
+-#define GRUB_NET_MAX_STR_HWADDR_LEN (sizeof ("XX:XX:XX:XX:XX:XX"))
++#define GRUB_NET_MAX_STR_HWADDR_LEN (sizeof (\
++	"XX:XX:XX:XX:XX:XX:XX:XX:"\
++	"XX:XX:XX:XX:XX:XX:XX:XX:"\
++	"XX:XX:XX:XX:XX:XX:XX:XX:"\
++	"XX:XX:XX:XX:XX:XX:XX:XX"))

The way hwadd to str is done:

  for (ptr = str, i = 0; i < addr->len; i++)
    {
      ptr += grub_snprintf (ptr, GRUB_NET_MAX_STR_HWADDR_LEN - (ptr - str),
		     "%02x:", addr->mac[i] & 0xff);
    }

GRUB_NET_MAX_STR_HWADDR_LEN was preventing a ':' at the end of the string for ethernet. But now with bigger GRUB_NET_MAX_STR_HWADDR_LEN, ethernet addresses end up with the ':' at the end.

Then the ':'s in the string are converted to '-' for the net confile name and we end up with the extra '-'.

Comment 8 Jeff Bastian 2017-09-19 14:43:42 UTC
*** Bug 1479496 has been marked as a duplicate of this bug. ***

Comment 12 Lukas Zapletal 2017-10-26 11:52:18 UTC
*** Bug 1487107 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.