Some checks failed
Run Check Script / check (pull_request) Failing after 30s
53 lines
1.9 KiB
Django/Jinja
53 lines
1.9 KiB
Django/Jinja
#!ipxe
|
|
|
|
# ==================================================================
|
|
# MAC-Specific Boot Script for CoreOS/FCOS Installation
|
|
# ==================================================================
|
|
|
|
# --- Configuration ---
|
|
set http_ip {{ http_ip }}
|
|
set scos_path {{ scos_path }}
|
|
set inst_dev {{ installation_device }}
|
|
set ign_path {{ ignition_http_path }}
|
|
set ign_file bootstrap.ign
|
|
|
|
# --- Derived Variables ---
|
|
set base-url http://${http_ip}:8080
|
|
set scos-base-url ${base-url}/${scos_path}
|
|
set ignition-url ${base-url}/${ign_path}/${ign_file}
|
|
|
|
# --- Pre-boot Logging & Verification ---
|
|
echo
|
|
echo "Starting MAC-specific installation..."
|
|
echo "--------------------------------------------------"
|
|
echo " Installation Device: ${inst_dev}"
|
|
echo " CoreOS Kernel URL: ${scos-base-url}/scos-live-kernel.x86_64"
|
|
echo " Ignition URL: ${ignition-url}"
|
|
echo "--------------------------------------------------"
|
|
echo "Waiting for 3 seconds before loading boot assets..."
|
|
sleep 3
|
|
|
|
# --- Load Boot Assets with Failure Checks ---
|
|
# The '|| goto failure' pattern provides a clean exit if any asset fails to load.
|
|
echo "Loading kernel..."
|
|
kernel ${scos-base-url}/scos-live-kernel.x86_64 initrd=main coreos.live.rootfs_url=${scos-base-url}/scos-live-rootfs.x86_64.img coreos.inst.install_dev=${inst_dev} coreos.inst.ignition_url=${ignition-url} || goto failure
|
|
|
|
echo "Loading initramfs..."
|
|
initrd --name main ${scos-base-url}/scos-live-initramfs.x86_64.img || goto failure
|
|
|
|
# --- Boot ---
|
|
echo "All assets loaded successfully. Starting boot process..."
|
|
boot || goto failure
|
|
|
|
# This part is never reached on successful boot.
|
|
|
|
# --- Failure Handling ---
|
|
:failure
|
|
echo
|
|
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
|
echo " ERROR: A boot component failed to load."
|
|
echo " Dropping to iPXE shell for manual debugging."
|
|
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
|
sleep 10
|
|
shell
|