Bug 1857410 - [RFE] grub2 support for vlans on x86_64
Summary: [RFE] grub2 support for vlans on x86_64
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: grub2
Version: 8.2
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: 8.0
Assignee: Bootloader engineering team
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks: 2150901
TreeView+ depends on / blocked
 
Reported: 2020-07-15 19:42 UTC by Dusty Mabe
Modified: 2023-08-10 12:09 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2150901 (view as bug list)
Environment:
Last Closed:
Type: Feature Request
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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


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