[Infra] PXE server setup -- part 2

 Now, we'll take a look for PXE installation setup under UEFI mode.

Setup for /etc/dhcpd.conf

In part-I, we've seen below configuration:


#Add Para. for UEFI boot
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; #RFC4570
...
class   "pxeclients"    {
        match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
        next-server     192.168.100.1;

        if option arch = 00:07 {
                filename "shimx64.efi";  ## This is for UEFI PXE boot file
                } else {
                filename "pxelinux.0";
        }
}
And, we'll add grub.cfg file in the /var/lib/tftpboot:


default=1
timeout=60
menu background bglinux1.jpg

menuentry 'Boot to local' {
        exit}

menuentry 'Ubuntu setup1' {
        linuxefi images/ubefi/linux ip=dhcp inst.repo=http://192.168.100.1/ub1804srv/ ks=http://192.168.100.1/cfgfiles/ubks18.cfg preseed/url=http://192.168.100.1/seedfiles/ubsrvmh.seed  
#linuxefi images/ubefi/linux ip=dhcp inst.repo=http://192.168.100.1/ub1804srv/   
        initrdefi images/ubefi/initrd.gz
}

menuentry 'Ubuntu setup2' {
        linuxefi images/ubefi/linux ip=dhcp inst.repo=http://192.168.100.1/ub1804srv/ ks=http://192.168.100.1/cfgfiles/ubks18.cfg preseed/url=http://192.168.100.1/seedfiles/ubsrvtf.seed  
#linuxefi images/ubefi/linux ip=dhcp inst.repo=http://192.168.100.1/ub1804srv/   
        initrdefi images/ubefi/initrd.gz
}

menuentry 'CentOS 8' {
        linuxefi images/c8srv/vmlinuz ip=dhcp inst.repo=http://192.168.100.1/c8srv ks=http://192.168.100.1/cfgfiles/c8lite.cfg  
        initrdefi images/c8srv/initrd.img
}

You'll find that the setup is similar with legacy mode but with different folder.
    And we could see there's a file called "shim.efi", which belongs to a RPM file called "syslinux-[version]-[arch].rpm" so that we need to copy the file from the installation source ISO :

  > mount -t iso9660 /path_to_image/name_of_image.iso /mount_point -o loop,ro
  > cp -pr /mount_point/Packages/shim-[version]-[arch].rpm /tmp
  

  Then extract the package...in /tmp folder...
  

  > rpm2cpio shim-[version]-[arch].rpm | cpio -dimv  
  

Then in the folder, you'd see a file called "shim.efi", please copy the file to the dedicated folder (/var/lib/tftpboot/shim.efi)
     Also, find out the grub.efi and copy to the folder "/var/lib/tftpboot".
    After configuring EFI boot Env. and boot menu for UEFI Env., all setup is done. Now Users could test the installation under UEFI host Env.
Reference: https://access.redhat.com/documentation/zh-tw/red_hat_enterprise_linux/7/html/installation_guide/chap-installation-server-setup

這個網誌中的熱門文章

浪淘沙--不僅是獨立生命的故事

一些回憶的隨筆~

[舊文]飛彈防禦:射落飛彈,強化盟邦