我正在尝试使用 dnsmasq 在 proyxDHCP 模式下安装 PXE 安装服务器。到目前为止,旧版 BIOS 安装正在运行。当我尝试使用 EFI 时,它会失败。
使用 dhcpd,EFI 启动可以正常工作。因此垫片文件应该没问题。
Unable to fetch TFTP image: Invalid Parameter
start_image() returned Invalid Parameter
[root@pxetestsrv tftpboot]# ll
total 2448
-rw-r--r-- 1 root root 20832 Apr 6 13:43 chain.c32
-rw-r--r-- 1 root root 175 Apr 10 09:47 grub.cfg
-rwxr-xr-x 1 root root 1024464 Apr 6 15:48 grubx64.efi
drwxr-xr-x 2 root root 39 Apr 9 09:48 images
-rw-r--r-- 1 root root 33756 Apr 6 13:43 mboot.c32
-rw-r--r-- 1 root root 26268 Apr 6 13:43 memdisk
-rw-r--r-- 1 root root 55140 Apr 6 13:43 menu.c32
-rw-r--r-- 1 root root 26826 Apr 6 13:43 pxelinux.0
drwxr-xr-x 2 root root 21 Apr 6 14:51 pxelinux.cfg
-rw-r--r-- 1 root root 1295704 Apr 6 15:48 shim.efi
proxydhcp.conf:
# Don't function as a DNS server:
port=0
# Log lots of extra information about DHCP transactions.
log-dhcp
# Set the root directory for files available via FTP.
enable-tftp
tftp-root=/var/lib/tftpboot
# PXE menu. The first part is the text displayed to the user. The second is the timeout, in seconds.
pxe-prompt="Booting PXE Client", 1
# The known types are x86PC, PC98, IA64_EFI, Alpha, Arc_x86,
# Intel_Lean_Client, IA32_EFI, BC_EFI, Xscale_EFI, ARM_EFI and X86-64_EFI
# This option is first and will be the default if there is no input from the user.
# PXEClient:Arch:00000
pxe-service=X86PC, "Boot BIOS PXE", pxelinux
# PXEClient:Arch:00007
pxe-service=BC_EFI, "Boot UEFI PXE-BC", shim.efi
# PXEClient:Arch:00009
pxe-service=X86-64_EFI, "Boot UEFI PXE-64", shim.efi
dhcp-range=172.27.224.95,proxy
在日志中:
dnsmasq[30104]: started, version 2.76 DNS disabled
dnsmasq[30104]: compile time options: IPv6 GNU-getopt DBus no-i18n IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset auth no-DNSSEC loop-detect inotify
dnsmasq-dhcp[30104]: DHCP, proxy on subnet 172.27.224.95
dnsmasq-tftp[30104]: TFTP root is /var/lib/tftpboot
dnsmasq-dhcp[30104]: 2149063664 available DHCP subnet: 172.27.224.95/255.255.255.0
dnsmasq-dhcp[30104]: 2149063664 vendor class: PXEClient:Arch:00009:????:??????
dnsmasq-dhcp[30104]: 2149063664 PXE(eth0) 00:50:56:b7:54:68 proxy
dnsmasq-dhcp[30104]: 2149063664 tags: eth0
dnsmasq-dhcp[30104]: 2149063664 next server: 172.27.224.95
dnsmasq-dhcp[30104]: 2149063664 broadcast response
dnsmasq-dhcp[30104]: 2149063664 sent size: 1 option: 53 message-type 2
dnsmasq-dhcp[30104]: 2149063664 sent size: 4 option: 54 server-identifier 172.27.224.95
dnsmasq-dhcp[30104]: 2149063664 sent size: 9 option: 60 vendor-class 00:ab:dc:33:23:23:23:23:23
dnsmasq-dhcp[30104]: 2149063664 sent size: 17 option: 97 client-machine-id 00:23:23:23:23:23:23:23:23:23:23:23:23:23...
dnsmasq-dhcp[30104]: 2149063664 available DHCP subnet: 172.27.224.95/255.255.255.0
dnsmasq-dhcp[30104]: 2149063664 vendor class: PXEClient:Arch:00009:????:??????
dnsmasq-dhcp[30104]: 180220542 available DHCP subnet: 172.27.224.95/255.255.255.0
dnsmasq-dhcp[30104]: 180220542 vendor class: PXEClient:Arch:00009:????:??????
dnsmasq-dhcp[30104]: 180220542 PXE(eth0) 00:50:56:b7:54:68 proxy
dnsmasq-dhcp[30104]: 180220542 tags: eth0
dnsmasq-dhcp[30104]: 180220542 bootfile name: shim.efi
dnsmasq-dhcp[30104]: 180220542 server name: 172.27.224.95
dnsmasq-dhcp[30104]: 180220542 next server: 172.27.224.95
dnsmasq-dhcp[30104]: 180220542 sent size: 1 option: 53 message-type 5
dnsmasq-dhcp[30104]: 180220542 sent size: 4 option: 54 server-identifier 172.27.224.95
dnsmasq-dhcp[30104]: 180220542 sent size: 9 option: 60 vendor-class 00:ab:dc:33:23:23:23:23:23
dnsmasq-dhcp[30104]: 180220542 sent size: 17 option: 97 client-machine-id 00:23:23:23:23:23:23:23:23:23:23:23:23:23...
dnsmasq-tftp[30104]: error 8 User aborted the transfer received from 172.27.224.251
dnsmasq-tftp[30104]: failed sending /var/lib/tftpboot/shim.efi to 172.27.224.251
dnsmasq-tftp[30104]: sent /var/lib/tftpboot/shim.efi to 172.27.224.251
答案1
我遇到了同样的问题,花了一段时间进行故障排除。shim 和 grub2 的工作方式很奇怪。您必须将主 DHCP 的“next-server”设置为您的代理 DHCP 服务器。iPXE 和 BIOS 启动不会在意您是否有未设置 next-server 的代理 dhcp 服务器,如果没有它,grub 和 shims 似乎会失败。