From 91b76a3addfd33df204ae4fabbe694a775e9c56c Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Wed, 24 Feb 2016 18:45:35 +0100 Subject: 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 --- recipes/ostree/ostree.bb | 1 + .../ostree/0005-Do-not-use-grub2-mkconfig.patch | 60 ++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 recipes/ostree/ostree/0005-Do-not-use-grub2-mkconfig.patch (limited to 'recipes') diff --git a/recipes/ostree/ostree.bb b/recipes/ostree/ostree.bb index a0a1b8a..4dbafd5 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 0000000..1414ff7 --- /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 +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 + -- cgit v1.2.3-54-g00ecf