Bug 1857410

Summary: [RFE] grub2 support for vlans on x86_64
Product: Red Hat Enterprise Linux 8 Reporter: Dusty Mabe <dustymabe>
Component: grub2Assignee: Bootloader engineering team <bootloader-eng-team>
Status: CLOSED MIGRATED QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.2CC: cbesson, dornelas, fgiloux, guido.aulisi, mlewando, negativo17, pbunev, raravind, rmetrich, sfroemer
Target Milestone: rcKeywords: FutureFeature, MigratedToJIRA, Triaged
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2150901 (view as bug list) Environment:
Last Closed: 2023-09-16 14:03:09 UTC Type: Story
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2150901    

Description Dusty Mabe 2020-07-15 19:42:05 UTC
Description of problem:

We have customers that are trying to use PXE in a UEFI environment (i,e. grub) on vlan tagged networks. They are able to configure (via their UEFI interactive menu) the hardware to use vlan tags for PXE requests, but grub is not adding a vlan tag to the request for the grub.cfg.

After talking with several grub maintainers this feature only currently exists in grub2 for the ppc64le platform (with OpenFirmware). This is a request for this feature on x86_64 platform (and perhaps other platforms if it makes sense and is possible).

I just recently learned that you can test this in libvirt (virt-install --boot uefi) by navigating in the menu to:

   Device Manager
     Network Device List
       MAC:...
         VLAN Configuration
           Enter Configuration Menu

In my experience this requires Fedora 32 or newer.


Version-Release number of selected component (if applicable):

grub2-efi-x64-2.02-81.el8.x86_64

Comment 2 Dusty Mabe 2020-07-15 19:43:22 UTC
Link to the BZ where this missing feature was reported as a bug: https://bugzilla.redhat.com/show_bug.cgi?id=1842887

Comment 4 Frederic Giloux 2020-07-16 06:12:44 UTC
When implemented this will need to be validated with RHCOS as well so that it can be leveraged for OpenShift installations.

Comment 12 Guido Aulisi 2022-11-21 10:30:40 UTC
Hi,

recent GRUB from git://git.savannah.gnu.org/grub.git contains patches to read and use VLAN tag automatically.
I was able to boot in a tagged VLAN using this recent version of grub.
If needed I will post all steps needed to boot anaconda installer.

Comment 13 Marta Lewandowska 2022-11-21 13:06:06 UTC
Hi Guido,
yes, please do post all the steps here. That should accelerate (!) things.

Comment 14 Guido Aulisi 2022-11-21 13:33:20 UTC
First of all some configurations are hard coded to simplify and speed up things.
All was done on a Fedora 36 laptopo with gcc, make installed. Sorry I cannot
list all packages required to build grub, because everything was already installed.

This is what I did:

Clone from git://git.savannah.gnu.org/grub.git
Bootstrap grub: ./bootstrap
Configure grub: ./configure --prefix=/usr --sysconfdir=/etc --with-platform=efi --target=x86_64
Build: make -j2
Install in some temporary directory: export DESTDIR=/tmp/grub && make install

Now we should have a working grub installed in /tmp/grub

Build a grub image: this step has some configuration hard coded, sorry:
cd /tmp/grub
usr/bin/grub-mkimage --compress xz --disable-shim-lock -d /tmp/grub/usr/lib64/grub/x86_64-efi -o grubx64.efi -O x86_64-efi -p '(tftp)/grub' efinet serial tftp part_gpt configfile normal

This step hardcodes the prefix, that is the path grub uses to get grub.cfg

Now we have to copy things to our tftp server:
copy grubx64.efi to the root of tftp server
copy all grub modules from /tmp/grub/usr/lib64/grub/x86_64-efi to
<tftproot>/grub/x86_64-efi
I think only .mod files are really needed, but I copied all files.

Put grub.cfg in <tftproot>/grub

This was my grub.cfg:

insmod efi_gop
insmod efi_uga
insmod linux
insmod reboot

serial --speed=115200
terminal_input serial
terminal_output serial

set root=(tftp,172.22.129.141)

echo 'Loading kernel...'
linux rhel8.7/vmlinuz console=ttyS0,115200n8 vlan=vlan3457:eno1 ip=eno1:dhcp rd.luks=0 rd.md=0 rd.dm=0 rd.multipath=0 inst.repo=http://172.22.129.141/rhel8.7/ inst.ks=http://172.22.129.141/rhel8.7/ks.cfg inst.headless quiet
echo 'Loading ramdisk...'
initrd rhel8.7/initrd.img

I'm using a serial console here.

At the grub prompt run boot (this can be done from grub.cfg, but I want to launch manually)

That's all, I hope it works for you.

My machine was a dell R740xd

P.S. I did not sign the boorloader, so this does not work with secureboot, you have to disable it

Comment 16 Renaud Métrich 2023-08-09 08:37:18 UTC
There is a patchset Upstream:

https://lists.gnu.org/archive/html/grub-devel/2022-03/msg00193.html

Comment 17 Simone Caronni 2023-08-10 12:09:21 UTC
Grub 2.12-rc1 has been released with VLAN support (commands, network and reading the VLAN from the UEFI path).

Comment 18 RHEL Program Management 2023-09-16 13:23:31 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 19 RHEL Program Management 2023-09-16 14:03:09 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.