aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGatis Paeglis <gatis.paeglis@theqtcompany.com>2016-02-24 18:45:35 +0100
committerGatis Paeglis <gatis.paeglis@theqtcompany.com>2016-03-08 09:55:23 +0000
commit91b76a3addfd33df204ae4fabbe694a775e9c56c (patch)
tree4425053d6638f26ec3dee08219eb2b6c67d2fec8
parent6136e6009970859fc02477cdd37fb29a2031566f (diff)
ostree: Do not use grub2-mkconfig.
For more details see: https://bugzilla.gnome.org/show_bug.cgi?id=762220 To summarize: 1) The current approach is less flexible than using a custom 'ostree-grub-generator' script. Each device can adjust this script for its needs, instead of hardcoding some values in ostree-bootloader-grub2.c. 2) Too much overhead on embedded to generate grub.cfg via /etc/grub.d/ configuration files. It is still possible to do so, even with this patch applied. 3) The grub2-mkconfig code path has other issues: https://bugzilla.gnome.org/show_bug.cgi?id=761180 Change-Id: I077838fdf16fbbb42f98df6fa6720bfbaf7c6f8b Reviewed-by: Samuli Piippo <samuli.piippo@theqtcompany.com>
-rw-r--r--recipes/ostree/ostree.bb1
-rw-r--r--recipes/ostree/ostree/0005-Do-not-use-grub2-mkconfig.patch60
2 files changed, 61 insertions, 0 deletions
diff --git a/recipes/ostree/ostree.bb b/recipes/ostree/ostree.bb
index a0a1b8a5..4dbafd53 100644
--- a/recipes/ostree/ostree.bb
+++ b/recipes/ostree/ostree.bb
@@ -32,6 +32,7 @@ SRC_URI = " \
file://0002-u-boot-Merge-ostree-s-and-systems-uEnv.txt.patch \
file://0003-Allow-updating-files-in-root-of-boot.patch \
file://0004-Mount-boot-partition.patch \
+ file://0005-Do-not-use-grub2-mkconfig.patch \
"
SRCREV = "efdb4d8f443768e59529c299290bee8b1f8f93c3"
diff --git a/recipes/ostree/ostree/0005-Do-not-use-grub2-mkconfig.patch b/recipes/ostree/ostree/0005-Do-not-use-grub2-mkconfig.patch
new file mode 100644
index 00000000..1414ff76
--- /dev/null
+++ b/recipes/ostree/ostree/0005-Do-not-use-grub2-mkconfig.patch
@@ -0,0 +1,60 @@
+From b613d60319beffc861f5b1faa906d2ee0c685f52 Mon Sep 17 00:00:00 2001
+From: Gatis Paeglis <gatis.paeglis@theqtcompany.com>
+Date: Wed, 24 Feb 2016 18:12:27 +0100
+Subject: [PATCH] Do not use grub2-mkconfig.
+
+For details see: https://bugzilla.gnome.org/show_bug.cgi?id=762220
+---
+ src/libostree/ostree-bootloader-grub2.c | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/src/libostree/ostree-bootloader-grub2.c b/src/libostree/ostree-bootloader-grub2.c
+index 1f89914..7cfb0dc 100644
+--- a/src/libostree/ostree-bootloader-grub2.c
++++ b/src/libostree/ostree-bootloader-grub2.c
+@@ -282,6 +282,8 @@ grub2_child_setup (gpointer user_data)
+ }
+ }
+
++#define OSTREE_NO_GRUB2_MKCONFIG
++
+ static gboolean
+ _ostree_bootloader_grub2_write_config (OstreeBootloader *bootloader,
+ int bootversion,
+@@ -300,6 +302,7 @@ _ostree_bootloader_grub2_write_config (OstreeBootloader *bootloader,
+ g_autoptr(GFile) config_path_efi_dir = NULL;
+ g_autofree char *grub2_mkconfig_chroot = NULL;
+
++#ifndef OSTREE_NO_GRUB2_MKCONFIG
+ if (ostree_sysroot_get_booted_deployment (self->sysroot) == NULL
+ && g_file_has_parent (self->sysroot->path, NULL))
+ {
+@@ -322,7 +325,7 @@ _ostree_bootloader_grub2_write_config (OstreeBootloader *bootloader,
+ tool_deployment_root = ostree_sysroot_get_deployment_directory (self->sysroot, tool_deployment);
+ grub2_mkconfig_chroot = g_file_get_path (tool_deployment_root);
+ }
+-
++#endif
+ if (self->is_efi)
+ {
+ config_path_efi_dir = g_file_get_parent (self->config_path_efi);
+@@ -337,9 +340,16 @@ _ostree_bootloader_grub2_write_config (OstreeBootloader *bootloader,
+ bootversion);
+ }
+
++#ifdef OSTREE_NO_GRUB2_MKCONFIG
++ procctx = gs_subprocess_context_newv ("ostree-grub-generator", "-o",
++ gs_file_get_path_cached (new_config_path),
++ NULL);
++#else
+ procctx = gs_subprocess_context_newv ("grub2-mkconfig", "-o",
+ gs_file_get_path_cached (new_config_path),
+ NULL);
++#endif
++
+ child_env = g_environ_setenv (child_env, "_OSTREE_GRUB2_BOOTVERSION", bootversion_str, TRUE);
+ /* We have to pass our state to the child */
+ if (self->is_efi)
+--
+2.7.0
+