From 4ceea1de5b5272e8921a4adfc5ca78aea13b6998 Mon Sep 17 00:00:00 2001 From: Karanbir Singh Date: Jun 17 2015 11:31:22 +0000 Subject: roll in patches for ostree upstream fix --- diff --git a/SOURCES/0001-sysroot-Close-sysroot-fd-in-finalize.patch b/SOURCES/0001-sysroot-Close-sysroot-fd-in-finalize.patch new file mode 100644 index 0000000..0905db9 --- /dev/null +++ b/SOURCES/0001-sysroot-Close-sysroot-fd-in-finalize.patch @@ -0,0 +1,27 @@ +From f08cb802ea1b02c874fd71a0672c28b49e890d49 Mon Sep 17 00:00:00 2001 +From: Colin Walters +Date: Sun, 19 Apr 2015 15:25:05 -0400 +Subject: [PATCH] sysroot: Close sysroot fd in finalize + +Just noticed this while I was going to add another one there. +--- + src/libostree/ostree-sysroot.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/libostree/ostree-sysroot.c b/src/libostree/ostree-sysroot.c +index b18c6b7..6255803 100644 +--- a/src/libostree/ostree-sysroot.c ++++ b/src/libostree/ostree-sysroot.c +@@ -66,6 +66,9 @@ ostree_sysroot_finalize (GObject *object) + g_clear_object (&self->sepolicy); + g_clear_object (&self->repo); + ++ if (self->sysroot_fd != -1) ++ (void) close (self->sysroot_fd); ++ + G_OBJECT_CLASS (ostree_sysroot_parent_class)->finalize (object); + } + +-- +1.8.3.1 + diff --git a/SOURCES/sysroot-sort-returned-bootloader-configs.patch b/SOURCES/sysroot-sort-returned-bootloader-configs.patch new file mode 100644 index 0000000..57fa308 --- /dev/null +++ b/SOURCES/sysroot-sort-returned-bootloader-configs.patch @@ -0,0 +1,89 @@ +From 3300ee6259d191199f96b5f4e04ccfded3d11b86 Mon Sep 17 00:00:00 2001 +From: Colin Walters +Date: Tue, 26 May 2015 18:46:47 -0400 +Subject: sysroot: Sort returned boot loader configs + +I haven't done a full dig through the history, but it seems quite +possible right now we've been relying on inode enumeration +order for generating bootloader configuration. + +Most of the time, newer inodes (i.e. later written files) will win. +But that's obviously not reliable. + +Fix this by sorting the returned configuration internally. + +diff --git a/src/libostree/ostree-sysroot.c b/src/libostree/ostree-sysroot.c +index ebcb632..f12ebc5 100644 +--- a/src/libostree/ostree-sysroot.c ++++ b/src/libostree/ostree-sysroot.c +@@ -361,6 +361,35 @@ _ostree_sysroot_read_current_subbootversion (OstreeSysroot *self, + return ret; + } + ++static gint ++compare_boot_loader_configs (OstreeBootconfigParser *a, ++ OstreeBootconfigParser *b) ++{ ++ const char *a_version = ostree_bootconfig_parser_get (a, "version"); ++ const char *b_version = ostree_bootconfig_parser_get (b, "version"); ++ ++ if (a_version && b_version) ++ { ++ int r = strverscmp (a_version, b_version); ++ /* Reverse */ ++ return -r; ++ } ++ else if (a_version) ++ return -1; ++ else ++ return 1; ++} ++ ++static int ++compare_loader_configs_for_sorting (gconstpointer a_pp, ++ gconstpointer b_pp) ++{ ++ OstreeBootconfigParser *a = *((OstreeBootconfigParser**)a_pp); ++ OstreeBootconfigParser *b = *((OstreeBootconfigParser**)b_pp); ++ ++ return compare_boot_loader_configs (a, b); ++} ++ + gboolean + _ostree_sysroot_read_boot_loader_configs (OstreeSysroot *self, + int bootversion, +@@ -427,6 +456,9 @@ _ostree_sysroot_read_boot_loader_configs (OstreeSysroot *self, + } + } + ++ /* Callers expect us to give them a sorted array */ ++ g_ptr_array_sort (ret_loader_configs, compare_loader_configs_for_sorting); ++ + done: + gs_transfer_out_value (out_loader_configs, &ret_loader_configs); + ret = TRUE; +@@ -706,19 +738,8 @@ compare_deployments_by_boot_loader_version_reversed (gconstpointer a_pp, + OstreeDeployment *b = *((OstreeDeployment**)b_pp); + OstreeBootconfigParser *a_bootconfig = ostree_deployment_get_bootconfig (a); + OstreeBootconfigParser *b_bootconfig = ostree_deployment_get_bootconfig (b); +- const char *a_version = ostree_bootconfig_parser_get (a_bootconfig, "version"); +- const char *b_version = ostree_bootconfig_parser_get (b_bootconfig, "version"); +- +- if (a_version && b_version) +- { +- int r = strverscmp (a_version, b_version); +- /* Reverse */ +- return -r; +- } +- else if (a_version) +- return -1; +- else +- return 1; ++ ++ return compare_boot_loader_configs (a_bootconfig, b_bootconfig); + } + + /** +-- +cgit v0.10.2 + diff --git a/SPECS/ostree.spec b/SPECS/ostree.spec index 1294365..caf3f79 100644 --- a/SPECS/ostree.spec +++ b/SPECS/ostree.spec @@ -1,10 +1,18 @@ Summary: Tool for managing bootable, immutable filesystem trees Name: ostree Version: 2015.6 -Release: 2.atomic%{?dist} +Release: 2.atomic%{?dist}.2 #VCS: git:git://git.gnome.org/ostree Source0: http://ftp.gnome.org/pub/GNOME/sources/ostree/%{version}/ostree-%{version}.tar.xz Source1: 91-ostree.preset +### CentOS specific patches +# We carry this one as it's a critical bug in upstream +Patch0: sysroot-sort-returned-bootloader-configs.patch +# This one is necessary - also a bug in upstream that +# we hit but upstream didn't because they haven't rebuilt anaconda +# with a newer ostree +Patch1: 0001-sysroot-Close-sysroot-fd-in-finalize.patch +### License: LGPLv2+ URL: http://live.gnome.org/OSTree @@ -114,6 +122,9 @@ rm -rf $RPM_BUILD_ROOT %{_libexecdir}/ostree/grub2* %changelog +* Wed Jun 17 2015 Karanbir Singh - 2015.6-2.atomic.centos.2 +- Roll in upstream fix patches and ostree backport + * Fri Apr 17 2015 Colin Walters - 2015.6-2.atomic - New upstream release