From 12284f70640de1eebdab79500127ad048f874ee8 Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Wed, 2 Nov 2016 14:53:17 +0100 Subject: fixup: build_ostree.sh: use the same SHA as yocto recipe Change-Id: I42f959480db20eaf9547c67693439ada23f44e47 Reviewed-by: Gatis Paeglis --- ...-boot-Merge-ostree-s-and-systems-uEnv.txt.patch | 76 ---------------------- 1 file changed, 76 deletions(-) delete mode 100644 qt-ostree/patches/u-boot-Merge-ostree-s-and-systems-uEnv.txt.patch diff --git a/qt-ostree/patches/u-boot-Merge-ostree-s-and-systems-uEnv.txt.patch b/qt-ostree/patches/u-boot-Merge-ostree-s-and-systems-uEnv.txt.patch deleted file mode 100644 index 80677c7..0000000 --- a/qt-ostree/patches/u-boot-Merge-ostree-s-and-systems-uEnv.txt.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 4d8648d35ba7fe60f428aab2240aa6044fb51c50 Mon Sep 17 00:00:00 2001 -From: Gatis Paeglis -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 - -- cgit v1.2.3