diff --git a/recipes/bootloader/recipe.toml b/recipes/bootloader/recipe.toml index 2ee85966f6d1a7bae2c54823c5ed255e7ca4d755..0e7079f9944f07a4dcad037a7fe5c31b1fe8a6a3 100644 --- a/recipes/bootloader/recipe.toml +++ b/recipes/bootloader/recipe.toml @@ -6,15 +6,27 @@ template = "custom" script = """ rsync -av --delete "${COOKBOOK_SOURCE}/" ./ +function bootloader { + export TARGET="$1" + src="$2" + dst="$3" + "${COOKBOOK_MAKE}" -j "${COOKBOOK_MAKE_JOBS}" "build/${TARGET}/${src}" + cp -v "build/${TARGET}/${src}" "${COOKBOOK_STAGE}/${dst}" +} + ARCH="$(echo "${TARGET}" | cut -d - -f1)" -if [ "${ARCH}" == "x86_64" ] + +# Build BIOS bootloader for supported architectures +if [ "${ARCH}" == "i686" -o "${ARCH}" == "x86_64" ] then - export TARGET="x86-unknown-none" - "${COOKBOOK_MAKE}" -j "${COOKBOOK_MAKE_JOBS}" - cp "build/${TARGET}/bootloader.bin" "${COOKBOOK_STAGE}/bootloader.bios" + bootloader "x86-unknown-none" bootloader.bin bootloader.bios + bootloader "x86-unknown-none" bootloader-live.bin bootloader-live.bios fi -export TARGET="${ARCH}-unknown-uefi" -"${COOKBOOK_MAKE}" -j "${COOKBOOK_MAKE_JOBS}" -cp "build/${TARGET}/bootloader.efi" "${COOKBOOK_STAGE}/bootloader.efi" +# Build UEFI bootloader for supported architectures +if [ "${ARCH}" == "aarch64" -o "${ARCH}" == "x86_64" ] +then + bootloader "${ARCH}-unknown-uefi" bootloader.efi bootloader.efi + bootloader "${ARCH}-unknown-uefi" bootloader-live.efi bootloader-live.efi +fi """