summaryrefslogtreecommitdiffstats
path: root/recipes/ostree
diff options
context:
space:
mode:
authorGatis Paeglis <gatis.paeglis@qt.io>2016-08-29 12:43:10 +0200
committerGatis Paeglis <gatis.paeglis@qt.io>2016-08-29 11:38:06 +0000
commit5211a9b15e2f98d876f6e451102696e0339df04d (patch)
tree30ded98295ab8700e04149dd3646983389aa5146 /recipes/ostree
parent0765ab46150bfa6a930487e25ecb0eed365d90f1 (diff)
downloadmeta-boot2qt-5211a9b15e2f98d876f6e451102696e0339df04d.tar.gz
ostree: Update revison
One of the local patches has been merged in the upstream project and is fixed to add thread safety. Change-Id: Ib3cf12ab759226aefbd4c0af5b0ac5100b3490cc Reviewed-by: Teemu Holappa <teemu.holappa@theqtcompany.com>
Diffstat (limited to 'recipes/ostree')
-rw-r--r--recipes/ostree/ostree.bb3
-rw-r--r--recipes/ostree/ostree/u-boot-Merge-ostree-s-and-systems-uEnv.txt.patch76
2 files changed, 1 insertions, 78 deletions
diff --git a/recipes/ostree/ostree.bb b/recipes/ostree/ostree.bb
index 0fcb810..f38088c 100644
--- a/recipes/ostree/ostree.bb
+++ b/recipes/ostree/ostree.bb
@@ -42,11 +42,10 @@ SRC_URI = " \
42 file://Support-for-booting-without-initramfs.patch \ 42 file://Support-for-booting-without-initramfs.patch \
43 file://Allow-updating-files-in-the-boot-directory.patch \ 43 file://Allow-updating-files-in-the-boot-directory.patch \
44 file://u-boot-add-bootdir-to-the-generated-uEnv.txt.patch \ 44 file://u-boot-add-bootdir-to-the-generated-uEnv.txt.patch \
45 file://u-boot-Merge-ostree-s-and-systems-uEnv.txt.patch \
46 file://Create-firmware-convenience-symlinks.patch \ 45 file://Create-firmware-convenience-symlinks.patch \
47 " 46 "
48 47
49SRCREV = "77af6844d8330b31d58080076afb31e08974ce09" 48SRCREV = "8ece4d6d51bdbe3e41ab318259276bb83e553aa0"
50 49
51S = "${WORKDIR}/git" 50S = "${WORKDIR}/git"
52 51
diff --git a/recipes/ostree/ostree/u-boot-Merge-ostree-s-and-systems-uEnv.txt.patch b/recipes/ostree/ostree/u-boot-Merge-ostree-s-and-systems-uEnv.txt.patch
deleted file mode 100644
index 80677c7..0000000
--- a/recipes/ostree/ostree/u-boot-Merge-ostree-s-and-systems-uEnv.txt.patch
+++ /dev/null
@@ -1,76 +0,0 @@
1From 4d8648d35ba7fe60f428aab2240aa6044fb51c50 Mon Sep 17 00:00:00 2001
2From: Gatis Paeglis <gatis.paeglis@qt.io>
3Date: Tue, 23 Aug 2016 14:32:35 +0200
4Subject: [PATCH 1/2] u-boot: Merge ostree's and systems uEnv.txt
5
6This is a proper fix for:
7https://bugzilla.gnome.org/show_bug.cgi?id=755787
8
9With this patch, an admin (system builder) can now:
10
111) Edit /usr/lib/ostree-boot/uEnv.txt
122) Deploy the new tree. OSTree will append system's uEnv.txt
13 to the OSTree's managed uEnv.txt (loader/uEnv.txt).
14
15It is common for u-boot systems to read in an extra env
16from external /uEnv.txt. The same file OSTree uses to pass
17in its env. With this patch /uEnv.txt now contains OSTree's
18env + custom env added by system builders.
19---
20 src/libostree/ostree-bootloader-uboot.c | 40 ++++++++++++++++++++++++++++++++-
21 1 file changed, 39 insertions(+), 1 deletion(-)
22
23diff --git a/src/libostree/ostree-bootloader-uboot.c b/src/libostree/ostree-bootloader-uboot.c
24index f95ea84..5172477 100644
25--- a/src/libostree/ostree-bootloader-uboot.c
26+++ b/src/libostree/ostree-bootloader-uboot.c
27@@ -95,7 +95,45 @@ create_config_from_boot_loader_entries (OstreeBootloaderUboot *self,
28
29 val = ostree_bootconfig_parser_get (config, "options");
30 if (val)
31- g_ptr_array_add (new_lines, g_strdup_printf ("bootargs=%s", val));
32+ {
33+ glnx_fd_close int uenv_fd = -1;
34+ g_autofree char* kargs = g_strdup (val);
35+ const char *uenv_path = NULL;
36+ const char *ostree_arg = NULL;
37+
38+ g_ptr_array_add (new_lines, g_strdup_printf ("bootargs=%s", val));
39+
40+ /* Append system's uEnv.txt, if it exists in $deployment/usr/lib/ostree-boot/ */
41+ ostree_arg = strtok (kargs, " ");
42+ while (ostree_arg != NULL && !g_str_has_prefix (ostree_arg, "ostree="))
43+ ostree_arg = strtok (NULL, " ");
44+ if (!ostree_arg)
45+ {
46+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
47+ "No ostree= kernel argument found in boot loader configuration file");
48+ return FALSE;
49+ }
50+ uenv_path = glnx_strjoina (ostree_arg + strlen ("ostree=/"), "/usr/lib/ostree-boot/uEnv.txt");
51+ uenv_fd = openat (self->sysroot->sysroot_fd, uenv_path, O_CLOEXEC | O_RDONLY);
52+ if (uenv_fd != -1)
53+ {
54+ char *uenv = glnx_fd_readall_utf8 (uenv_fd, NULL, cancellable, error);
55+ if (!uenv)
56+ {
57+ glnx_set_prefix_error_from_errno (error, "%s", uenv_path);
58+ return FALSE;
59+ }
60+ g_ptr_array_add (new_lines, uenv);
61+ }
62+ else
63+ {
64+ if (errno != ENOENT)
65+ {
66+ glnx_set_prefix_error_from_errno (error, "%s", uenv_path);
67+ return FALSE;
68+ }
69+ }
70+ }
71
72 return TRUE;
73 }
74--
752.7.4
76