JavaScript must be enabled in order for you to see "WP Copy Data Protect" effect. However, it seems JavaScript is either disabled or not supported by your browser. To see full result of "WP Copy Data Protector", enable JavaScript by changing your browser options, then try again.

Analyze how to setup about the iPXE server under the RHEL 7.3


Hello everyone, it’s time to post a rubbish. I heard from my colleague about the iPXE, and what difference between the transdition PXE, gPXE and iPXE? You can refer the article from here or Fog’s wiki for understanding these knowledge.In fact, iPXE is a enhanced PXE service inclueded the customized scripts, and how to setup it for integration installed site about Linux/VMware/Windows’s iPXE Server?Let’s keep reading:

1) Install the OS w/ all packages except the part of virtualization
#cat /etc/os-release
NAME="Red Hat Enterprise Linux Server"
VERSION="7.3 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="7.3"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.3 (Maipo)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.3:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.3
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.3"
#rpm -qa | wc -l

2) Disable the service of NetworkManager, firewalld and SELinux(Need to reboot the system for applying)
#service NetworkManager stop
#chkconfig NetworkManager off
#service firewalld stop
#chkconfig firewalld off
#cat /etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disbled
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted

3) Change the setting of timezone w/ UTC, modify the datetime and sync w/ hwclock
#timedateset set-local-rtc 1
#date 040322312017
#hwclock -w

4) Check the packages iPXE needed under the iPXE server(xs-devel can resolve the issue about lzma.h can’t be found and can ref here)
#rpm -qa | grep -i syslinux
#rpm -qa | grep -i nfs
#rpm -qa | grep -i http
#rpm -qa | grep -i vsftp
#rpm -qa | grep -i xinetd
#rpm -qa | grep -i tftp
#rpm -qa | grep -i tftp-server
#rpm -qa | grep -i dhcpd
#rpm -qa | grep -i git
#rpm -qa | grep -i gcc
#rpm -qa | grep -i gcc-c++
#rpm -qa | grep -i make
#rpm -qa | grep -i zlib-devel
#rpm -qa | grep -i binutils-devel
#rpm -qa | grep -i xz-devel

5) Copy the related configuration and boot files for the services of dhcpd/httpd/vsftpd/tftpd/NFS
#ls -al /var/lib/tftpboot -> Default path for the service of tftp
#ls -al /var/ftp/ -> Default path for the service of httpd/vsftpd/NFS
#cat /etc/dhcp/dhcpd.conf
#cat /etc/httpd/conf/httpd.conf
#cat /etc/xinetd.d/tftp
#cat /etc/exports

6) Start above services and setup these for the startup after finishing the part of conf
#service xinetd start
#chkconfig xinetd on
#service httpd start
#chkconfig httpd on
#service vsftpd start
#chkconfig vsftpd on
#service dhcpd start
#chkconfig dhcpd on
#service nfs start
#chkconfig nfs-server on

7) Download the requirement sources for building the boot files about iPXE(Can refer here for the defail)
#mkdir ~/projects/ipxe
#git clone git://git.ipxe.org/ipxe.git ipxe-bios
#cd ipxe-bios/src/config
#rm console.h general.h settings.h
#wget -O console.h "http://sourceforge.net/p/freeghost/code/HEAD/tree/trunk/src/ipxe/src/config/console.h?format=raw"
#wget -O general.h "http://sourceforge.net/p/freeghost/code/HEAD/tree/trunk/src/ipxe/src/config/general.h?format=raw"
#wget -O settings.h "http://sourceforge.net/p/freeghost/code/HEAD/tree/trunk/src/ipxe/src/config/settings.h?format=raw"
#cd ..
#wget -O ipxescript "http://sourceforge.net/p/freeghost/code/HEAD/tree/trunk/src/ipxe/src/ipxescript?format=raw" -> Can omit it due to the sample
#cd ~/projects/ipxe
#git clone git://git.ipxe.org/ipxe.git ipxe-efi
#cd ipxe-efi/src/config
#rm console.h general.h settings.h
#wget -O console.h "https://sourceforge.net/p/freeghost/code/HEAD/tree/trunk/src/ipxe/src-efi/config/console.h" -> Diff w/ the ori link
#wget -O console.h "https://sourceforge.net/p/freeghost/code/HEAD/tree/trunk/src/ipxe/src-efi/config/general.h" -> Diff w/ the ori link
#wget -O console.h "https://sourceforge.net/p/freeghost/code/HEAD/tree/trunk/src/ipxe/src-efi/config/settings.h" -> Diff w/ the ori link
#cd ..
#wget -O console.h "https://sourceforge.net/p/freeghost/code/HEAD/tree/trunk/src/ipxe/src-efi/ipxescript" -> Diff w/ the ori link and can omit it due to the sample

8) Bake and setup the cake through the customize ipxescript for the func of legacy iPXE(Can refer here for making the ipxescript)
#cat ~/projects/ipxe/ipxe-bios/src/ipxescript
#!ipxe
dhcp
:start
menu Please choose an operating system to install
item --gap openSUSE
item 42.1 openSUSE Leap
item tumbleweed.20151022 tumbleweed.20151022
item 13.2-64-bit openSUSE 13.2 64-bit
item --gap SLES 12 SP2
item sles12sp2-ga SLES 12 GA 64-bit
item --gap RHEL 6.9
item as69-64 RHEL 6.9 GA 64-bit
item --gap WinPE -> Can ref http://ipxe.org/howto/winpe
item winpe WinPE Boot ISO
item --gap VMware 6.5
item esxi65 VMware ESXi 6.5 GA
item --gap ipxe shell
item shell Drop to iPXE shell
choose target && goto ${target}
:failed
echo Booting failed, dropping to shell
goto shell
:shell
echo Type 'exit' to get the back to the menu
shell
set menu-timeout 0
set submenu-timeout 0
goto start
:42.1
kernel http://192.168.254.1/42.1/boot/x86_64/loader/linux initrd=initrd install=http://192.168.254.1/42.1/
initrd http://192.168.254.1/42.1/boot/x86_64/loader/initrd
boot || goto failed
:tumbleweed.20151022
kernel http://192.168.254.1/tumbleweed.20151022/boot/x86_64/loader/linux initrd=initrd install=http://192.168.254.1/tumbleweed.20151022/
initrd http://192.168.254.1/tumbleweed.20151022/boot/x86_64/loader/initrd
boot || goto failed
:13.2-64-bit
kernel http://192.168.254.1/13.2/x86_64/boot/x86_64/loader/linux initrd=initrd install=http://192.168.254.1/13.2/x86_64/
initrd http://192.168.254.1/13.2/x86_64/boot/x86_64/loader/initrd
boot || goto failed
:sles12sp2-ga
kernel http://192.168.254.1/sles12sp2-64/x86_64/boot/x86_64/loader/linux initrd=initrd install=http://192.168.254.1/sles12sp2-64/x86_64/
initrd http://192.168.254.1/sles12sp2-64/x86_64/boot/x86_64/loader/initrd
boot || goto failed
:as69-64
kernel tftp://192.168.254.1/as69-64/vmlinuz initrd=initrd
initrd tftp://192.168.254.1/as69-64/initrd.img
boot || goto failed
:winpe
cpuid --ext 29 && set arch amd64 || set arch x86
kernel http://192.168.254.1/wimboot
initrd http://192.168.254.1/${arch}/ISO/boot/bcd -> BCD
initrd http://192.168.254.1/${arch}/ISO/boot/boot.sdi -> boot.sdi
initrd -n http://192.168.254.1/boot.wim ${arch}/winpe.wim -> boot.wim
boot
:esxi65
chain tftp://192.168.254.1/esxi65/mboot.c32 -c tftp://192.168.254.1/esxi65/boot.cfg
#cat boot.cfg
bootstate=0
title=Loading ESXi installer
prefix=tftp://192.168.254.1/esxi65/
timeout=5
kernel=tboot.b00
kernelopt=runweasel
modules=b.b00 --- jumpstrt.gz --- useropts.gz --- features.gz --- k.b00 --- chardevs.b00 --- a.b00 --- user.b00 --- uc_intel.b00 --- uc_amd.b00 --- sb.v00 --- s.v00 --- ata_liba.v00 --- ata_pata.v00 --- ata_pata.v01 --- ata_pata.v02 --- ata_pata.v03 --- ata_pata.v04 --- ata_pata.v05 --- ata_pata.v06 --- ata_pata.v07 --- block_cc.v00 --- char_ran.v00 --- ehci_ehc.v00 --- elxnet.v00 --- hid_hid.v00 --- i40en.v00 --- igbn.v00 --- ima_qla4.v00 --- ipmi_ipm.v00 --- ipmi_ipm.v01 --- ipmi_ipm.v02 --- ixgben.v00 --- lpfc.v00 --- lsi_mr3.v00 --- lsi_msgp.v00 --- lsi_msgp.v01 --- misc_cni.v00 --- misc_dri.v00 --- mtip32xx.v00 --- ne1000.v00 --- nenic.v00 --- net_bnx2.v00 --- net_bnx2.v01 --- net_cdc_.v00 --- net_cnic.v00 --- net_e100.v00 --- net_e100.v01 --- net_enic.v00 --- net_fcoe.v00 --- net_forc.v00 --- net_igb.v00 --- net_ixgb.v00 --- net_libf.v00 --- net_mlx4.v00 --- net_mlx4.v01 --- net_nx_n.v00 --- net_tg3.v00 --- net_usbn.v00 --- net_vmxn.v00 --- nhpsa.v00 --- nmlx4_co.v00 --- nmlx4_en.v00 --- nmlx4_rd.v00 --- nmlx5_co.v00 --- ntg3.v00 --- nvme.v00 --- nvmxnet3.v00 --- ohci_usb.v00 --- pvscsi.v00 --- qedentv.v00 --- qfle3.v00 --- qflge.v00 --- qlnative.v00 --- sata_ahc.v00 --- sata_ata.v00 --- sata_sat.v00 --- sata_sat.v01 --- sata_sat.v02 --- sata_sat.v03 --- sata_sat.v04 --- scsi_aac.v00 --- scsi_adp.v00 --- scsi_aic.v00 --- scsi_bnx.v00 --- scsi_bnx.v01 --- scsi_fni.v00 --- scsi_hps.v00 --- scsi_ips.v00 --- scsi_isc.v00 --- scsi_lib.v00 --- scsi_meg.v00 --- scsi_meg.v01 --- scsi_meg.v02 --- scsi_mpt.v00 --- scsi_mpt.v01 --- scsi_mpt.v02 --- scsi_qla.v00 --- shim_isc.v00 --- shim_isc.v01 --- shim_lib.v00 --- shim_lib.v01 --- shim_lib.v02 --- shim_lib.v03 --- shim_lib.v04 --- shim_lib.v05 --- shim_vmk.v00 --- shim_vmk.v01 --- shim_vmk.v02 --- uhci_usb.v00 --- usb_stor.v00 --- usbcore_.v00 --- vmkata.v00 --- vmkplexe.v00 --- vmkusb.v00 --- vmw_ahci.v00 --- xhci_xhc.v00 --- emulex_e.v00 --- weaselin.t00 --- esx_dvfi.v00 --- esx_ui.v00 --- lsu_hp_h.v00 --- lsu_lsi_.v00 --- lsu_lsi_.v01 --- lsu_lsi_.v02 --- lsu_lsi_.v03 --- native_m.v00 --- rste.v00 --- vmware_e.v00 --- vsan.v00 --- vsanheal.v00 --- vsanmgmt.v00 --- tools.t00 --- xorg.v00 --- imgdb.tgz --- imgpayld.tgz
build=
updated=0
#make bin/ipxe.iso EMBED=ipxescript
#cp -rf bin/ipxe.iso /var/lib/tftpboot/
#chmod 777 -R /var/lib/tftpboot/ipxe.iso
#cat /var/lib/tftpboot/pxelinux.cfg/default -> Boot the ipxe.iso through boot file from syslinux w/ default
label ipxe
kernel memdisk
append initrd=ipxe.iso iso raw

9) Bake and setup the cake through the customize ipxescript for the func of uEFI iPXE(Can refer here for the part of VMware)
#cat ~/projects/ipxe/ipxe-efi/src/ipxescript
#!ipxe
dhcp
:start
menu Please choose an operating system to install
item --gap openSUSE
item 42.1 openSUSE Leap
item tumbleweed.20151022 tumbleweed.20151022
item 13.2-64-bit openSUSE 13.2 64-bit
item --gap SLES 12 SP2
item sles12sp2-ga SLES 12 GA 64-bit
item --gap RHEL 6.9
item as69-64 RHEL 6.9 GA 64-bit
item --gap WinPE -> Can ref http://ipxe.org/howto/winpe
item winpe WinPE Boot ISO
item --gap VMware 6.5
item esxi65 VMware ESXi 6.5 GA
item --gap ipxe shell
item shell Drop to iPXE shell
choose target && goto ${target}
:failed
echo Booting failed, dropping to shell
goto shell
:shell
echo Type 'exit' to get the back to the menu
shell
set menu-timeout 0
set submenu-timeout 0
goto start
:42.1
kernel http://192.168.254.1/42.1/boot/x86_64/loader/linux initrd=initrd install=http://192.168.254.1/42.1/
initrd http://192.168.254.1/42.1/boot/x86_64/loader/initrd
boot || goto failed
:tumbleweed.20151022
kernel http://192.168.254.1/tumbleweed.20151022/boot/x86_64/loader/linux initrd=initrd install=http://192.168.254.1/tumbleweed.20151022/
initrd http://192.168.254.1/tumbleweed.20151022/boot/x86_64/loader/initrd
boot || goto failed
:13.2-64-bit
kernel http://192.168.254.1/13.2/x86_64/boot/x86_64/loader/linux initrd=initrd install=http://192.168.254.1/13.2/x86_64/
initrd http://192.168.254.1/13.2/x86_64/boot/x86_64/loader/initrd
boot || goto failed
:sles12sp2-ga
kernel http://192.168.254.1/sles12sp2-64/x86_64/boot/x86_64/loader/linux initrd=initrd install=http://192.168.254.1/sles12sp2-64/x86_64/
initrd http://192.168.254.1/sles12sp2-64/x86_64/boot/x86_64/loader/initrd
boot || goto failed
:as69-64
kernel tftp://192.168.254.1/as69-64/vmlinuz initrd=initrd
initrd tftp://192.168.254.1/as69-64/initrd.img
boot || goto failed
:winpe
cpuid --ext 29 && set arch amd64 || set arch x86
kernel http://192.168.254.1/wimboot
initrd http://192.168.254.1/${arch}/ISO/boot/bcd -> BCD
initrd http://192.168.254.1/${arch}/ISO/boot/boot.sdi -> boot.sdi
initrd -n http://192.168.254.1/boot.wim ${arch}/winpe.wim -> boot.wim
boot
:esxi65
chain tftp://192.168.254.1/esxi65/efi/boot/bootx64.efi -c tftp://192.168.254.1/esxi65/boot.cfg
#make bin/ipxe.efi EMBED=ipxescript
#cp -rf bin/ipxe.efi /var/lib/tftpboot/
#chmod 777 -R /var/lib/tftpboot/ipxe.efi
#cat /etc/dhcp/dhcpd.conf
.....
option client-architecture code 93 = unsigned integer 16;
# 00:06 For UEFI 32 bits
if option client-architecture = 00:07 {
# For Common UEFI Client w/ unsigned
#filename "/BOOTX64.efi";
filename "/ipxe.efi";
.....
#service dhcpd restart

◎、Above context is about the simple setup procedure for the iPXE server that’s be integrated the installed sources w/ Linux/VMware/Windows, and you can use this site to create the boot files for the legacy/uEFI iPXE services if lazy to prepare the compiled environment. BTW, you can find more detail skills from the official website from here or this site. That’s all for today, and hope this article is helpful for you. See you next time!

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 
This site is protected by WP-CopyRightPro