Files
RedBear-OS/recipes/core/bootloader/recipe.toml
T
vasilito f2f6030dab bootloader: update recipe.toml for latest upstream Makefile format
Upstream bootloader Makefile uses BUILD=$(CURDIR) and auto-detects SOURCE.
Override BUILD to relative path so targets resolve correctly.
2026-07-11 10:51:38 +03:00

41 lines
1.2 KiB
TOML

[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
"""