Show Table of Contents
30.2.2. 為 EFI 配置 PXE Boot
- 如果您尚未安裝 tftp-server,請執行
yum install tftp-server。 - 在
/etc/xinet.d/tftp裡的 tftp-server 配置檔案中,請將disabled參數從yes改為no。 - 請為 EFI 開機映像檔在
tftpboot中建立目錄路徑,並將映像檔複製到開機目錄中:mkdir /var/lib/tftpboot/pxelinuxcp /boot/efi/EFI/redhat/grub.efi /var/lib/tftpboot/pxelinux/bootx64.efi - 配置 DHCP 伺服器使用 EFI 開機映像檔(包含 GRUB)。(如果您沒有 DHCP 伺服器,請參閱《Red Hat Enterprise Linux 建置指南‧DHCP 伺服器》。
/etc/dhcp/dhcpd.conf的範例配置看起來像:option space PXE; option PXE.mtftp-ip code 1 = ip-address; option PXE.mtftp-cport code 2 = unsigned integer 16; option PXE.mtftp-sport code 3 = unsigned integer 16; option PXE.mtftp-tmout code 4 = unsigned integer 8; option PXE.mtftp-delay code 5 = unsigned integer 8; option arch code 93 = unsigned integer 16; # RFC4578 subnet 10.0.0.0 netmask 255.255.255.0 { option routers 10.0.0.254; range 10.0.0.2 10.0.0.253; class "pxeclients" { match if substring (option vendor-class-identifier, 0, 9) = "PXEClient"; next-server 10.0.0.1; if option arch = 00:06 { filename "pxelinux/bootia32.efi"; } else if option arch = 00:07 { filename "pxelinux/bootx64.efi"; } else { filename "pxelinux/pxelinux.0"; } } host example-ia32 { hardware ethernet XX:YY:ZZ:11:22:33; fixed-address 10.0.0.2; } } - 在
pxelinux中建立pxelinux.cfg目錄:mkdir /var/lib/tftpboot/pxelinux/pxelinux.cfg - 在這目錄中建立配置檔案。這檔案應該名為
efidefault或根據 IP 位址命名。舉例來說,如果您的電腦 IP 位址為 10.0.0.1,那麼檔名應該為0A000001./var/lib/tftpboot/pxelinux/pxelinux.cfg/efidefault的範例配置看起來像:default=0 timeout=1 splashimage=(nd)/splash.xpm.gz hiddenmenu title RHEL root (nd) kernel /rawhide-x86_64/vmlinuz initrd /rawhide-x86_64/initrd.img欲知指定安裝來源的指示,請參閱〈節 7.1.3, “額外開機選項”〉。 - 將 splash 映像檔複製到
tftp根目錄:cp /boot/grub/splash.xpm.gz /var/lib/tftpboot/pxelinux/splash.xpm.gz - 將開機映像檔複製到
tftp根目錄:cp /path/to/x86_64/os/images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/pxelinux/rhel6/ - 重新開機,並在系統提示時,選擇網路裝置作為開機裝置。

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.