diff options
author | Gatis Paeglis <gatis.paeglis@theqtcompany.com> | 2016-02-24 18:45:35 +0100 |
---|---|---|
committer | Gatis Paeglis <gatis.paeglis@theqtcompany.com> | 2016-03-08 09:55:23 +0000 |
commit | 91b76a3addfd33df204ae4fabbe694a775e9c56c (patch) | |
tree | 4425053d6638f26ec3dee08219eb2b6c67d2fec8 /recipes | |
parent | 6136e6009970859fc02477cdd37fb29a2031566f (diff) | |
download | meta-boot2qt-91b76a3addfd33df204ae4fabbe694a775e9c56c.tar.gz |
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>
Diffstat (limited to 'recipes')
-rw-r--r-- | recipes/ostree/ostree.bb | 1 | ||||
-rw-r--r-- | recipes/ostree/ostree/0005-Do-not-use-grub2-mkconfig.patch | 60 |
2 files changed, 61 insertions, 0 deletions
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 = " \ | |||
32 | file://0002-u-boot-Merge-ostree-s-and-systems-uEnv.txt.patch \ | 32 | file://0002-u-boot-Merge-ostree-s-and-systems-uEnv.txt.patch \ |
33 | file://0003-Allow-updating-files-in-root-of-boot.patch \ | 33 | file://0003-Allow-updating-files-in-root-of-boot.patch \ |
34 | file://0004-Mount-boot-partition.patch \ | 34 | file://0004-Mount-boot-partition.patch \ |
35 | file://0005-Do-not-use-grub2-mkconfig.patch \ | ||
35 | " | 36 | " |
36 | 37 | ||
37 | SRCREV = "efdb4d8f443768e59529c299290bee8b1f8f93c3" | 38 | 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 @@ | |||
1 | From b613d60319beffc861f5b1faa906d2ee0c685f52 Mon Sep 17 00:00:00 2001 | ||
2 | From: Gatis Paeglis <gatis.paeglis@theqtcompany.com> | ||
3 | Date: Wed, 24 Feb 2016 18:12:27 +0100 | ||
4 | Subject: [PATCH] Do not use grub2-mkconfig. | ||
5 | |||
6 | For details see: https://bugzilla.gnome.org/show_bug.cgi?id=762220 | ||
7 | --- | ||
8 | src/libostree/ostree-bootloader-grub2.c | 12 +++++++++++- | ||
9 | 1 file changed, 11 insertions(+), 1 deletion(-) | ||
10 | |||
11 | diff --git a/src/libostree/ostree-bootloader-grub2.c b/src/libostree/ostree-bootloader-grub2.c | ||
12 | index 1f89914..7cfb0dc 100644 | ||
13 | --- a/src/libostree/ostree-bootloader-grub2.c | ||
14 | +++ b/src/libostree/ostree-bootloader-grub2.c | ||
15 | @@ -282,6 +282,8 @@ grub2_child_setup (gpointer user_data) | ||
16 | } | ||
17 | } | ||
18 | |||
19 | +#define OSTREE_NO_GRUB2_MKCONFIG | ||
20 | + | ||
21 | static gboolean | ||
22 | _ostree_bootloader_grub2_write_config (OstreeBootloader *bootloader, | ||
23 | int bootversion, | ||
24 | @@ -300,6 +302,7 @@ _ostree_bootloader_grub2_write_config (OstreeBootloader *bootloader, | ||
25 | g_autoptr(GFile) config_path_efi_dir = NULL; | ||
26 | g_autofree char *grub2_mkconfig_chroot = NULL; | ||
27 | |||
28 | +#ifndef OSTREE_NO_GRUB2_MKCONFIG | ||
29 | if (ostree_sysroot_get_booted_deployment (self->sysroot) == NULL | ||
30 | && g_file_has_parent (self->sysroot->path, NULL)) | ||
31 | { | ||
32 | @@ -322,7 +325,7 @@ _ostree_bootloader_grub2_write_config (OstreeBootloader *bootloader, | ||
33 | tool_deployment_root = ostree_sysroot_get_deployment_directory (self->sysroot, tool_deployment); | ||
34 | grub2_mkconfig_chroot = g_file_get_path (tool_deployment_root); | ||
35 | } | ||
36 | - | ||
37 | +#endif | ||
38 | if (self->is_efi) | ||
39 | { | ||
40 | config_path_efi_dir = g_file_get_parent (self->config_path_efi); | ||
41 | @@ -337,9 +340,16 @@ _ostree_bootloader_grub2_write_config (OstreeBootloader *bootloader, | ||
42 | bootversion); | ||
43 | } | ||
44 | |||
45 | +#ifdef OSTREE_NO_GRUB2_MKCONFIG | ||
46 | + procctx = gs_subprocess_context_newv ("ostree-grub-generator", "-o", | ||
47 | + gs_file_get_path_cached (new_config_path), | ||
48 | + NULL); | ||
49 | +#else | ||
50 | procctx = gs_subprocess_context_newv ("grub2-mkconfig", "-o", | ||
51 | gs_file_get_path_cached (new_config_path), | ||
52 | NULL); | ||
53 | +#endif | ||
54 | + | ||
55 | child_env = g_environ_setenv (child_env, "_OSTREE_GRUB2_BOOTVERSION", bootversion_str, TRUE); | ||
56 | /* We have to pass our state to the child */ | ||
57 | if (self->is_efi) | ||
58 | -- | ||
59 | 2.7.0 | ||
60 | |||