Skip to content
Snippets Groups Projects
Commit 5211a9b1 authored by Gatis Paeglis's avatar Gatis Paeglis
Browse files

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: default avatarTeemu Holappa <teemu.holappa@theqtcompany.com>
parent 0765ab46
No related branches found
No related tags found
No related merge requests found
......@@ -42,11 +42,10 @@ SRC_URI = " \
file://Support-for-booting-without-initramfs.patch \
file://Allow-updating-files-in-the-boot-directory.patch \
file://u-boot-add-bootdir-to-the-generated-uEnv.txt.patch \
file://u-boot-Merge-ostree-s-and-systems-uEnv.txt.patch \
file://Create-firmware-convenience-symlinks.patch \
"
SRCREV = "77af6844d8330b31d58080076afb31e08974ce09"
SRCREV = "8ece4d6d51bdbe3e41ab318259276bb83e553aa0"
S = "${WORKDIR}/git"
......
From 4d8648d35ba7fe60f428aab2240aa6044fb51c50 Mon Sep 17 00:00:00 2001
From: Gatis Paeglis <gatis.paeglis@qt.io>
Date: Tue, 23 Aug 2016 14:32:35 +0200
Subject: [PATCH 1/2] u-boot: Merge ostree's and systems uEnv.txt
This is a proper fix for:
https://bugzilla.gnome.org/show_bug.cgi?id=755787
With this patch, an admin (system builder) can now:
1) Edit /usr/lib/ostree-boot/uEnv.txt
2) Deploy the new tree. OSTree will append system's uEnv.txt
to the OSTree's managed uEnv.txt (loader/uEnv.txt).
It is common for u-boot systems to read in an extra env
from external /uEnv.txt. The same file OSTree uses to pass
in its env. With this patch /uEnv.txt now contains OSTree's
env + custom env added by system builders.
---
src/libostree/ostree-bootloader-uboot.c | 40 ++++++++++++++++++++++++++++++++-
1 file changed, 39 insertions(+), 1 deletion(-)
diff --git a/src/libostree/ostree-bootloader-uboot.c b/src/libostree/ostree-bootloader-uboot.c
index f95ea84..5172477 100644
--- a/src/libostree/ostree-bootloader-uboot.c
+++ b/src/libostree/ostree-bootloader-uboot.c
@@ -95,7 +95,45 @@ create_config_from_boot_loader_entries (OstreeBootloaderUboot *self,
val = ostree_bootconfig_parser_get (config, "options");
if (val)
- g_ptr_array_add (new_lines, g_strdup_printf ("bootargs=%s", val));
+ {
+ glnx_fd_close int uenv_fd = -1;
+ g_autofree char* kargs = g_strdup (val);
+ const char *uenv_path = NULL;
+ const char *ostree_arg = NULL;
+
+ g_ptr_array_add (new_lines, g_strdup_printf ("bootargs=%s", val));
+
+ /* Append system's uEnv.txt, if it exists in $deployment/usr/lib/ostree-boot/ */
+ ostree_arg = strtok (kargs, " ");
+ while (ostree_arg != NULL && !g_str_has_prefix (ostree_arg, "ostree="))
+ ostree_arg = strtok (NULL, " ");
+ if (!ostree_arg)
+ {
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "No ostree= kernel argument found in boot loader configuration file");
+ return FALSE;
+ }
+ uenv_path = glnx_strjoina (ostree_arg + strlen ("ostree=/"), "/usr/lib/ostree-boot/uEnv.txt");
+ uenv_fd = openat (self->sysroot->sysroot_fd, uenv_path, O_CLOEXEC | O_RDONLY);
+ if (uenv_fd != -1)
+ {
+ char *uenv = glnx_fd_readall_utf8 (uenv_fd, NULL, cancellable, error);
+ if (!uenv)
+ {
+ glnx_set_prefix_error_from_errno (error, "%s", uenv_path);
+ return FALSE;
+ }
+ g_ptr_array_add (new_lines, uenv);
+ }
+ else
+ {
+ if (errno != ENOENT)
+ {
+ glnx_set_prefix_error_from_errno (error, "%s", uenv_path);
+ return FALSE;
+ }
+ }
+ }
return TRUE;
}
--
2.7.4
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment