Thursday, May 9, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 2545  / 1 Year ago, mon, december 26, 2022, 12:22:15

In summary, my issue specifically is when I PXE boot a UEFI system, I get stuck at a grub> prompt. It appears that the UEFI systems aren't loading the grub.cfg file and I'll be damned if I can figure out why.


Since 22.04 is no longer providing us a mini.iso or netboot.iso option, I've been building (in our lab) a POC of the 'new' way to automate deployment of systems. For the most part I've been following the instructions from these two URLs:



For now my PoC is all sitting in a small Hyper-V lab. The network config is pretty simple in that I have a pfSense FW giving my lab network access to the internet and everything behind my FW is on a closed (private) network. This allows me full control over things like DHCP and such.


On what I'm calling my PXE sever, I have installed:



  • apache2

  • isc-dhcp-server

  • tftpd-hpa


TFTP Directory structure:


├── boot
│   ├── bootx64.efi
│   ├── grub
│   │   ├── font.pf2
│   │   ├── grub.cfg
│   │   ├── unicode.pf2
│   │   └── x86_64-efi
│   │   ├── command.lst
│   │   ├── crypto.lst
│   │   ├── fs.lst
│   │   └── terminal.lst
│   ├── grubx64.efi
│   ├── jammy
│   │   ├── initrd
│   │   └── vmlinuz
│   ├── ldlinux.c32 -> ./syslinux/bios/ldlinux.c32
│   ├── libutil.c32 -> ./syslinux/bios/libutil.c32
│   ├── menu.c32 -> ./syslinux/bios/menu.c32
│   ├── pxelinux.0
│   ├── pxelinux.cfg
│   │   └── default
│   └── syslinux
│   └── bios
│   ├── ldlinux.c32
│   ├── libutil.c32
│   └── menu.c32
└── grub -> ./boot/grub/

/etc/dhcp/dhcpd.conf


allow booting;
allow bootp;
option arch code 93 = unsigned integer 16;

subnet 172.16.1.0 netmask 255.255.255.0 {
range 172.16.1.100 172.16.1.110;
}

host test1 {
hardware ethernet 00:15:5d:01:21:07;
if option arch = 00:07 {
filename "boot/bootx64.efi";
} else {
filename "boot/pxelinux.0";
}
next-server 172.16.1.50;
fixed-address 172.16.1.60;
}

host test2 {
hardware ethernet 00:15:5d:01:21:08;
if option arch = 00:07 {
filename "boot/bootx64.efi";
} else {
filename "boot/pxelinux.0";
}
next-server 172.16.1.50;
fixed-address 172.16.1.61;
}

NOTE: I want DHCP to be issued by my pfSense server but I discovered the only way to get isc-dhcp-server to start was to specify some sort or range. I need to resolve this but for now it does seem that since everything is on the same subnet things are working well enough with this config.


/etc/default/tftpd-hpa


# /etc/default/tftpd-hpa

TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/tftp"
TFTP_ADDRESS=":69"
TFTP_OPTIONS="--secure

/etc/default/isc-dhcp-server


# Defaults for isc-dhcp-server (sourced by /etc/init.d/isc-dhcp-server)

# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).
#DHCPDv4_CONF=/etc/dhcp/dhcpd.conf
#DHCPDv6_CONF=/etc/dhcp/dhcpd6.conf

# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
#DHCPDv4_PID=/var/run/dhcpd.pid
#DHCPDv6_PID=/var/run/dhcpd6.pid

# Additional options to start dhcpd with.
# Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
#OPTIONS=""

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACESv4="eth0"
INTERFACESv6="eth0"


/tftp/boot/grub/grub.cfg


set timeout=30

loadfont unicode

set menu_color_normal=white/black
set menu_color_highlight=black/light-gray

menuentry "Install Ubuntu Jammy (22.04)" {
set gfxpayload=keep
linux /boot/jammy/vmlinuz ip=dhcp cloud-config-url=/dev/null url=http://172.16.1.50/isos/jammy/ubuntu-22.04-live-server-amd64.iso autoinstall ds="nocloud-net;s=http://172.16.1.50/cloud-init/jammy/" --- # Don't forget the slash at the end.
initrd /boot/jammy/initrd
}

tcpdump -n -i eth0 port 69


tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
01:26:56.188414 IP 172.16.1.60.1332 > 172.16.1.50.69: TFTP, length 59, RRQ "boot/bootx64.efi" octet tsize 0 blksize 1482 windowsize 4
01:26:56.189458 IP 172.16.1.60.1333 > 172.16.1.50.69: TFTP, length 51, RRQ "boot/bootx64.efi" octet blksize 1482 windowsize 4
01:26:56.225401 IP 172.16.1.60.1334 > 172.16.1.50.69: TFTP, length 50, RRQ "boot/grubx64.efi" octet blksize 512 windowsize 4


grub> echo $prefix


(tftp,172.16.1.50)/boot/grub

Screenshot of Grub> Info


For what it's worth, I have validated that the Apache2 directories are being served correctly and in fact, with the above config I am able to PXE boot BIOS based systems using the pxelinux.0.


For whatever reason UEFI systems (or in my case Hyper-V Gen2) get 'stuck' at the grub> menu.


Any help or advice would be appreciated. I know I'm close.


Cheers!


More From » boot

 Answers
2

We faced the problem as well. Please download the grubnetx64.efi file from http://archive.ubuntu.com/ubuntu/dists/jammy/main/uefi/grub2-amd64/current/ and replace the existing grubx64.efi file. It should work.


[#550] Tuesday, December 27, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
odyroc

Total Points: 324
Total Questions: 109
Total Answers: 103

Location: Belize
Member since Mon, Apr 17, 2023
1 Year ago
;