[package] name = "bootloader" version = "0.1.0" [source] path = "../../../local/sources/bootloader" [build] template = "custom" script = """ mkdir -pv "${COOKBOOK_STAGE}/usr/lib/boot" function bootloader { target="$1" src="$2" dst="$3" builddir="build/${target}" "${COOKBOOK_MAKE}" -j "${COOKBOOK_MAKE_JOBS}" \ -C "${COOKBOOK_SOURCE}" \ TARGET="${target}" \ BUILD="${builddir}" \ "${builddir}/${src}" cp -v "${COOKBOOK_SOURCE}/${builddir}/${src}" "${COOKBOOK_STAGE}/usr/lib/boot/${dst}" } ARCH="$(echo "${TARGET}" | cut -d - -f1)" # Build BIOS bootloader for supported architectures if [ "${ARCH}" == "i586" -o "${ARCH}" == "i686" -o "${ARCH}" == "x86_64" ] then bootloader "x86-unknown-none" bootloader.bin bootloader.bios bootloader "x86-unknown-none" bootloader-live.bin bootloader-live.bios fi # Build UEFI bootloader for supported architectures # (non-fatal — UEFI deps may need updating) if [ "${ARCH}" == "aarch64" -o "${ARCH}" == "x86_64" -o "${ARCH}" == "riscv64gc" ] then set +e bootloader "${ARCH}-unknown-uefi" bootloader.efi bootloader.efi bootloader "${ARCH}-unknown-uefi" bootloader-live.efi bootloader-live.efi set -e fi """