Build a customized iPXE firmware and deploy a chain loading environment

As the number of devices in my network has increased, so has the workload of performing maintenance on these systems. From time to time I need to use some rescue systems, such as WinPE and Linux LiveCD. Mounting boot images for them often requires the use of a corresponding management tool or out-of-band management, such as IPMI or BMC manager. The physical machine even needs to burn a USB boot disk.

Preboot eXecution Environment, the abbreviation is PXE, provides a mechanism for booting a computer using the NIC. This mechanism allows the computer to boot without relying on a local data storage device (such as a hard disk) or a locally installed operating system.

So I noticed that there is an open-source PXE firmware called iPXE. Building a customized iPXE firmware is simple according to the wiki page of iPXE.

sudo apt update
sudo apt install git gcc binutils make perl liblzma-dev mtools
git clone git://
cd ipxe/src

I need the chain loading function, so I need to add some parameters during the building process like this.

make bin/nm-undionly-20211002-1a.kpxe EMBED=nmboot.ipxe
make bin-x86_64-efi/nm-ipxe-20211002-1a.efi EMBED=nmboot.ipxe

Now I get both legacy BIOS and UEFI PXE firmware embedded my own chain loading script nmboot.ipxe. The script is quiet simple, just chaining the entry point from my HTTP server.


The advantage of this is that it minimizes the size of iPXE firmware for the NIC PXE to be downloaded from the TFTP Server, i.e., the Next Server that has been given by DHCP server. Because of the slow loading speed over TFTP.

My home lab use pfSense as my gateway and DHCP server, the DHCP server config is quite simple.


The next step is just to prepare the file on the http server. Refer here.

It’s done!

继续阅读Build a customized iPXE firmware and deploy a chain loading environment


我的电脑是装了两个系统,一个是 win8.1,另一个是 ubuntu 14.04。默认情况下,每次开机时,电脑会显示grub菜单等待30秒,默认是选中ubuntu的,这个太浪费时间了。


  1. 首先在终端输入命令:sudo gedit /etc/default/grub
  2. 然后修改其内如下,我在下面贴出了文件中的前面几行,后面的都没动,其实后面也都是注释而已。
  3. 最后还要运行 sudo update-grub 命令,提交本次修改的设置。


# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'

GRUB_DEFAULT=saved  # 每次默认的系统是上次进入的系统
GRUB_SAVEDEFAULT=true # 上面设置了 saved 值,就要写上这句
GRUB_TIMEOUT=3 # 默认等待的时间设为 3 秒,可以根据自己的习惯调整
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`




sudo gedit /lib/plymouth/themes/ubuntu-logo/ubuntu-logo.grub
#if background_color 44,0,30; then
#  clear
if background_color 0,0,0; then
#/etc/alternatives/default.plymouth.grub /lib/plymouth/themes/ubuntu-logo/ubuntu-logo.grub
#/lib/plymouth/themes/default.grub /etc/alternatives/default.plymouth.grub