From 546134337bd9f91330f2676d276009417e6dfd81 Mon Sep 17 00:00:00 2001
From: Jeremy Soller <jackpot51@gmail.com>
Date: Wed, 17 Aug 2022 08:10:43 -0600
Subject: [PATCH] Install boot files to /boot

---
 recipes/bootloader/recipe.toml | 4 +++-
 recipes/bootstrap/recipe.toml  | 3 ++-
 recipes/initfs/recipe.toml     | 3 ++-
 recipes/kernel/recipe.toml     | 3 ++-
 4 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/recipes/bootloader/recipe.toml b/recipes/bootloader/recipe.toml
index 0e7079f99..1f4e6eab0 100644
--- a/recipes/bootloader/recipe.toml
+++ b/recipes/bootloader/recipe.toml
@@ -6,12 +6,14 @@ template = "custom"
 script = """
 rsync -av --delete "${COOKBOOK_SOURCE}/" ./
 
+mkdir -v "${COOKBOOK_STAGE}/boot"
+
 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}"
+    cp -v "build/${TARGET}/${src}" "${COOKBOOK_STAGE}/boot/${dst}"
 }
 
 ARCH="$(echo "${TARGET}" | cut -d - -f1)"
diff --git a/recipes/bootstrap/recipe.toml b/recipes/bootstrap/recipe.toml
index 9efa810c6..824e691be 100644
--- a/recipes/bootstrap/recipe.toml
+++ b/recipes/bootstrap/recipe.toml
@@ -26,8 +26,9 @@ cargo \
     --target-dir "${COOKBOOK_BUILD}" \
     -- \
     --emit link="${COOKBOOK_BUILD}/${TARGET}/release/libbootstrap.a"
+mkdir -v "${COOKBOOK_STAGE}/boot"
 "${TARGET}-ld" \
-    -o "${COOKBOOK_STAGE}/bootstrap" \
+    -o "${COOKBOOK_STAGE}/boot/bootstrap" \
     --gc-sections \
     -T "${COOKBOOK_SOURCE}/src/${ARCH}.ld" \
     "${COOKBOOK_BUILD}/asm.o" \
diff --git a/recipes/initfs/recipe.toml b/recipes/initfs/recipe.toml
index 689a0c967..4f721c8ef 100644
--- a/recipes/initfs/recipe.toml
+++ b/recipes/initfs/recipe.toml
@@ -29,5 +29,6 @@ done
 
 env -u CARGO cargo run --manifest-path "${COOKBOOK_SOURCE}/tools/Cargo.toml" --bin redox-initfs-ar -- "${COOKBOOK_BUILD}/initfs" -o "${COOKBOOK_BUILD}/initfs.img"
 
-cp "${COOKBOOK_BUILD}/initfs.img" "${COOKBOOK_STAGE}/initfs"
+mkdir -v "${COOKBOOK_STAGE}/boot"
+cp "${COOKBOOK_BUILD}/initfs.img" "${COOKBOOK_STAGE}/boot/initfs"
 """
diff --git a/recipes/kernel/recipe.toml b/recipes/kernel/recipe.toml
index 330cd1154..03d037bd3 100644
--- a/recipes/kernel/recipe.toml
+++ b/recipes/kernel/recipe.toml
@@ -31,5 +31,6 @@ cargo rustc \
 	--strip-debug \
 	kernel.all \
 	kernel
-cp -v kernel "${COOKBOOK_STAGE}"
+mkdir -v "${COOKBOOK_STAGE}/boot"
+cp -v kernel "${COOKBOOK_STAGE}/boot"
 """
-- 
GitLab