Package: ostree
Version: 2022.7-2

I followed the instructions here (
https://salsa.debian.org/debian/ostree/-/blob/debian/latest/debian/ostree-boot-examples/README.md)
to test ostree on a minimal sid VM with a separate boot partition. When I
tried rebooting into the new ostree image, the boot failed, and grub
reported an error about not being able to find vmlinuz-*.

I believe the underlying issue is that the grub cfg generated when I
deployed the ostree image was incorrectly trying to find the kernel under
/ostree/* instead of /boot/ostree/*. Applying the attached patch fixed the
problem, though I am unfamiliar with this code, so there may be a better
solution.
From: James Pace <jpace...@gmail.com>
Date: Mon, 26 Dec 2022 13:20:09 -0500
Subject: Boot config should be looking in /boot.

---
 src/libostree/ostree-sysroot-deploy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c
index 26b07080..8e86d296 100644
--- a/src/libostree/ostree-sysroot-deploy.c
+++ b/src/libostree/ostree-sysroot-deploy.c
@@ -2032,7 +2032,7 @@ install_deployment_kernel (OstreeSysroot   *sysroot,
 
   g_autofree char *version_key = g_strdup_printf ("%d", n_deployments - ostree_deployment_get_index (deployment));
   ostree_bootconfig_parser_set (bootconfig, OSTREE_COMMIT_META_KEY_VERSION, version_key);
-  g_autofree char * boot_relpath = g_strconcat ("/", bootcsumdir, "/", kernel_layout->kernel_namever, NULL);
+  g_autofree char * boot_relpath = g_strconcat ("/boot/", bootcsumdir, "/", kernel_layout->kernel_namever, NULL);
   ostree_bootconfig_parser_set (bootconfig, "linux", boot_relpath);
 
   val = ostree_bootconfig_parser_get (bootconfig, "options");
@@ -2041,7 +2041,7 @@ install_deployment_kernel (OstreeSysroot   *sysroot,
   if (kernel_layout->initramfs_namever)
     {
       g_autofree char * initrd_boot_relpath =
-        g_strconcat ("/", bootcsumdir, "/", kernel_layout->initramfs_namever, NULL);
+        g_strconcat ("/boot/", bootcsumdir, "/", kernel_layout->initramfs_namever, NULL);
       ostree_bootconfig_parser_set (bootconfig, "initrd", initrd_boot_relpath);
 
       if (overlay_initrds)
-- 
2.39.0

Reply via email to