To use iPXE to setup my own development machine
This repo is used for creating osinstaller.iso
without deploying extra DHCP server/tFTP server.
Promptly start as long as there is docker
(curl -fsSL https://get.docker.com | sh) and make
on your host and get help running make
in the root path of this repo.
- Generate chainload.ipxe and put it on http server using
make http_server
- Download official ipxe.iso and follow the steps on Quick Start into PXE cli
- Run the following cmd
iPXE> dhcp
iPXE> chain http://<server ip>/chainload.ipxe
There are limitations to this way:
- Not able to chain https url
- Inconvenience to debug without ping/nslookup
# SERVER_ADDR used to find chainload.ipxe, answerfiles which are created in output dir.
# Specified a IP for fetching chainload.ipxe over HTTP. If bypass this variable, it will use default IP
make iso SERVER_ADDR=http://<server ip>
# Start local http server with sudo priviledge.
make http_server
There are some artifacts,
osinstaller.iso chainload.ipxe <some answerfile>
and it will launch a http server against output/ dir Then, burn osinstaller.iso onto a blank CD-ROM or DVD-ROM or put it into the ISO library for the VM installation on XenServer/Vmware/KVM
For more details usage, just run make
to get help.
netboot configuration for various linux distro can be found in netboot.json
- Add new section as below for new distro support
"New Distro Name": {
"description": "The description of the distro",
"kernel_location": "Location of Kernel/Initrd images, script will further find KERNEL_LOC without this key",
"kernel_args": "Kernel parameters",
"answerfile": "[Option] Location to answerfile",
"kernel": "[Option] kernel image name",
"initrd": "[Option] Initrd image name",
},
- Put new distro iso into output dir which created by
make output
- Restart http server
make http_server
- If wanted to tweak the kernel args, we only need to change it in
output/chainload.ipxe
instead of buildingosinstaller.iso
again because of chain loading feature.
There are something specials in answerfile
- Use /dev/xvda which is simply the Xen disk storage devices as disk partition , you need to update it if you use other Hypervisor
- Use Text mode instead of desktop environment
- Create an encrypted password for the user configuration in answerfile
python3 -c 'import crypt,getpass;pw=getpass.getpass();print(crypt.crypt(pw) if (pw==getpass.getpass("Confirm: ")) else exit())'