Enable UEFI / PXE boot on Mellanox ConnectX NIC

Boot GRML iso
https://grml.org/download/

Enable SSH daemon

service ssh start
passwd
ip a
 
# ssh root@GRML_IP

Install Mellanox CLI tools (MFT)
http://www.mellanox.com/page/management_tools

apt update
apt install -y gcc make dkms linux-headers-$(uname -r)
 
URL=http://www.mellanox.com/downloads/MFT/mft-4.12.0-105-x86_64-deb.tgz
wget -O- ${URL} | tar xvz -C /tmp
/tmp/mft-*-deb/install.sh
mst start

Show device state

mst status
flint -d /dev/mst/mt4119_pciconf0 q

Enable UEFI and PXE boot

for MST in $(ls /dev/mst/* | egrep -v '\.1'); do
    echo ${MST}
    mlxconfig -d ${MST} -y set EXP_ROM_UEFI_x86_ENABLE=1
    mlxconfig -d ${MST} -y set EXP_ROM_PXE_ENABLE=1
    mlxconfig -d ${MST} q | egrep "EXP_ROM"
done