Last active
October 25, 2022 22:27
-
-
Save UnconventionalMindset/9c9daa66727e7f45a85bad30a7844caa to your computer and use it in GitHub Desktop.
Embed Core OS installation to iPXE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
download_folder="ipxe" | |
install_script_url="https://gist.githubusercontent.com/UnconventionalMindset/f4ca2d66b943f916b5fecfad698b47ea/raw" | |
full_path="$HOME/${download_folder}" | |
[ -z $full_path ] && { echo "Error: download path is empty"; exit 1; } || echo "Download path set to: ${full_path}, continuing..." | |
apt -y install gcc binutils make perl liblzma-dev mtools genisoimage syslinux isolinux | |
rm -f $HOME/coreos-install.ipxe | |
rm -rf ${full_path}/ | |
rm -f /var/lib/vz/template/iso/coreos-ipxe.iso | |
git clone https://git.ipxe.org/ipxe.git $full_path | |
cd ${full_path}/src | |
curl $install_script_url -o $HOME/coreos-install.ipxe | |
sed -i 's/#undef[[:space:]]*\(DOWNLOAD_PROTO_HTTPS\)/#define \1/' config/general.h | |
make bin/ipxe.iso EMBED=$HOME/coreos-install.ipxe | |
mv bin/ipxe.iso /var/lib/vz/template/iso/coreos-ipxe.iso | |
rm -f $HOME/coreos-install.ipxe | |
rm -rf ${full_path}/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Running this script (almost) automatically provision my Fedora Core OS VM in proxmox: