diff --git a/local/recipes/core/grub/recipe.toml b/local/recipes/core/grub/recipe.toml index 1fca80ad..41c5f36c 100644 --- a/local/recipes/core/grub/recipe.toml +++ b/local/recipes/core/grub/recipe.toml @@ -118,7 +118,9 @@ if [ -f "${COOKBOOK_RECIPE}/grub.cfg" ]; then cp "${COOKBOOK_RECIPE}/grub.cfg" "${COOKBOOK_STAGE}/usr/lib/boot/grub.cfg" echo "Installed grub.cfg" else - echo "WARNING: grub.cfg not found in ${COOKBOOK_RECIPE}" >&2 + echo "ERROR: grub.cfg not found in ${COOKBOOK_RECIPE}" >&2 + echo "The grub.cfg file must exist alongside recipe.toml." >&2 + exit 1 fi echo "GRUB recipe complete." diff --git a/local/scripts/apply-patches.sh b/local/scripts/apply-patches.sh index 4de7069d..b9bfef53 100755 --- a/local/scripts/apply-patches.sh +++ b/local/scripts/apply-patches.sh @@ -131,9 +131,13 @@ symlink "../../local/recipes/core/ext4d" "recipes/core/ext4d" symlink "../../local/recipes/core/grub" "recipes/core/grub" # Resolve WIP conflict: recipes/wip/services/grub also exists, -# so redirect its recipe.toml to our local overlay -if [ -d "recipes/wip/services/grub" ]; then - symlink "../../../../local/recipes/core/grub/recipe.toml" "recipes/wip/services/grub/recipe.toml" +# so redirect the entire directory to our local overlay to ensure +# COOKBOOK_RECIPE resolves to a directory that contains grub.cfg +if [ -d "recipes/wip/services/grub" ] && [ ! -L "recipes/wip/services/grub" ]; then + rm -rf "recipes/wip/services/grub" +fi +if [ ! -e "recipes/wip/services/grub" ]; then + symlink "../../../../local/recipes/core/grub" "recipes/wip/services/grub" fi # Wayland additions diff --git a/local/scripts/install-grub.sh b/local/scripts/install-grub.sh index c3382841..82852eb6 100755 --- a/local/scripts/install-grub.sh +++ b/local/scripts/install-grub.sh @@ -92,14 +92,20 @@ python3 "${FAT_TOOL}" ls "${IMAGE}" "${ESP_OFFSET}" / echo "" REDBEAR_EFI="" -for f in $(find "${REPO_ROOT}/local/recipes/core/bootloader/target" -path "*/stage/usr/lib/boot/bootloader.efi" 2>/dev/null); do - REDBEAR_EFI="${f}" - break -done -for f in $(find "${REPO_ROOT}/repo" -path "*/bootloader/*/usr/lib/boot/bootloader.efi" 2>/dev/null); do - REDBEAR_EFI="${f}" - break +for search_path in \ + "${REPO_ROOT}/recipes/core/bootloader/target" \ + "${REPO_ROOT}/local/recipes/core/bootloader/target"; do + for f in $(find "${search_path}" -path "*/stage/usr/lib/boot/bootloader.efi" 2>/dev/null); do + REDBEAR_EFI="${f}" + break 2 + done done +if [ -z "${REDBEAR_EFI}" ]; then + for f in $(find "${REPO_ROOT}/repo" -path "*/bootloader/*/usr/lib/boot/bootloader.efi" 2>/dev/null); do + REDBEAR_EFI="${f}" + break + done +fi if [ -z "${REDBEAR_EFI}" ]; then echo "ERROR: Cannot find Redox bootloader (bootloader.efi) in cookbook output." >&2 diff --git a/recipes/wip/services/grub b/recipes/wip/services/grub new file mode 120000 index 00000000..ec3b2ed8 --- /dev/null +++ b/recipes/wip/services/grub @@ -0,0 +1 @@ +../../../../local/recipes/core/grub \ No newline at end of file diff --git a/recipes/wip/services/grub/recipe.toml b/recipes/wip/services/grub/recipe.toml deleted file mode 120000 index a7765fc6..00000000 --- a/recipes/wip/services/grub/recipe.toml +++ /dev/null @@ -1 +0,0 @@ -../../../../local/recipes/core/grub/recipe.toml \ No newline at end of file