import ostree-2020.5-4.el8

This commit is contained in:
CentOS Sources 2020-11-03 07:00:46 -05:00 committed by Andrew Lukoshko
parent 20b62da6df
commit da143f9f18
6 changed files with 128 additions and 4 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/libostree-2019.6.tar.xz
SOURCES/libostree-2020.5.tar.xz

View File

@ -1 +1 @@
afdb1c1aa53a466962fb24f106c6560604c2c5be SOURCES/libostree-2019.6.tar.xz
5c0218b91e9ca858acb6a28c297e87fb031c39a7 SOURCES/libostree-2020.5.tar.xz

View File

@ -0,0 +1,27 @@
From 06ed04a816141914adb9bd3e32392801fce5bc8e Mon Sep 17 00:00:00 2001
From: Colin Walters <walters@verbum.org>
Date: Fri, 21 Aug 2020 17:40:41 +0000
Subject: [PATCH] linuxfsutil: Pass int to ioctl, not long
Otherwise it will fail on big-endian architectures like s390x.
Ref https://bugzilla.redhat.com/show_bug.cgi?id=1867601
---
src/libostree/ostree-linuxfsutil.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libostree/ostree-linuxfsutil.c b/src/libostree/ostree-linuxfsutil.c
index 231ecf76..cb778def 100644
--- a/src/libostree/ostree-linuxfsutil.c
+++ b/src/libostree/ostree-linuxfsutil.c
@@ -55,7 +55,7 @@ _ostree_linuxfs_fd_alter_immutable_flag (int fd,
if (g_atomic_int_get (&no_alter_immutable))
return TRUE;
- unsigned long flags;
+ int flags = 0;
int r = ioctl (fd, EXT2_IOC_GETFLAGS, &flags);
if (r == -1)
{
--
2.26.2

View File

@ -0,0 +1,28 @@
From b3c7b059eaee3123d5b2523065726e866c533fe9 Mon Sep 17 00:00:00 2001
From: Jonathan Lebon <jonathan@jlebon.com>
Date: Fri, 28 Aug 2020 12:35:28 -0400
Subject: [PATCH] ostree-prepare-root: Fix /etc bind mount
We were bind-mounting the initramfs' `/etc` (to itself) instead of the
target deployment `/etc` (to itself). Since we're already `chdir`'ed
into it, we can just drop the leading slash.
---
src/switchroot/ostree-prepare-root.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/switchroot/ostree-prepare-root.c b/src/switchroot/ostree-prepare-root.c
index f7e4fe47..6351babb 100644
--- a/src/switchroot/ostree-prepare-root.c
+++ b/src/switchroot/ostree-prepare-root.c
@@ -251,7 +251,7 @@ main(int argc, char *argv[])
* sysroot, we still need a writable /etc. And to avoid race conditions
* we ensure it's writable in the initramfs, before we switchroot at all.
*/
- if (mount ("/etc", "/etc", NULL, MS_BIND, NULL) < 0)
+ if (mount ("etc", "etc", NULL, MS_BIND, NULL) < 0)
err (EXIT_FAILURE, "failed to make /etc a bind mount");
/* Pass on the fact that we discovered a readonly sysroot to ostree-remount.service */
int fd = open (_OSTREE_SYSROOT_READONLY_STAMP, O_WRONLY | O_CREAT | O_CLOEXEC, 0644);
--
2.26.2

View File

@ -0,0 +1,39 @@
From a7a751b69f2315635d6ae38a0b1344287b67079a Mon Sep 17 00:00:00 2001
From: Jonathan Lebon <jonathan@jlebon.com>
Date: Fri, 28 Aug 2020 12:35:29 -0400
Subject: [PATCH] ostree-remount: Remount /etc rw if needed
When we remount `/sysroot` as read-only, we also make `/etc` read-only.
This is usually OK because we then remount `/var` read-write, which also
flips `/etc` back to read-write... unless `/var` is a separate
filesystem and not a bind-mount to the stateroot `/var`.
Fix this by just remounting `/etc` read-write in the read-only sysroot
case.
Eventually, I think we should rework this to set everything up the way
we want from the initramfs (#2115). This would also eliminate the window
during which `/etc` is read-only while `ostree-remount` runs.
---
src/switchroot/ostree-remount.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/switchroot/ostree-remount.c b/src/switchroot/ostree-remount.c
index cfd270bb..3981682a 100644
--- a/src/switchroot/ostree-remount.c
+++ b/src/switchroot/ostree-remount.c
@@ -112,6 +112,11 @@ main(int argc, char *argv[])
bool sysroot_configured_readonly = unlink (_OSTREE_SYSROOT_READONLY_STAMP) == 0;
do_remount ("/sysroot", !sysroot_configured_readonly);
+ /* And also make sure to make /etc rw again. We make this conditional on
+ * sysroot_configured_readonly because only in that case is it a bind-mount. */
+ if (sysroot_configured_readonly)
+ do_remount ("/etc", true);
+
/* If /var was created as as an OSTree default bind mount (instead of being a separate filesystem)
* then remounting the root mount read-only also remounted it.
* So just like /etc, we need to make it read-write by default.
--
2.26.2

View File

@ -7,12 +7,16 @@
Summary: Tool for managing bootable, immutable filesystem trees
Name: ostree
Version: 2019.6
Release: 2%{?dist}
Version: 2020.5
Release: 4%{?dist}
Source0: https://github.com/ostreedev/%{name}/releases/download/v%{version}/libostree-%{version}.tar.xz
License: LGPLv2+
URL: https://ostree.readthedocs.io/en/latest/
Patch0: 0001-linuxfsutil-Pass-int-to-ioctl-not-long.patch
Patch1: 0001-ostree-prepare-root-Fix-etc-bind-mount.patch
Patch2: 0001-ostree-remount-Remount-etc-rw-if-needed.patch
BuildRequires: git
# We always run autogen.sh
BuildRequires: autoconf automake libtool
@ -162,6 +166,32 @@ find %{buildroot} -name '*.la' -delete
%endif
%changelog
* Wed Sep 09 2020 Colin Walters <walters@verbum.org> - 2020.5-4
- Backport patches for https://bugzilla.redhat.com/show_bug.cgi?id=1875567
* Mon Aug 24 2020 Colin Walters <walters@verbum.org> - 2020.5-3
- Backport
https://github.com/ostreedev/ostree/pull/2179/commits/06ed04a816141914adb9bd3e32392801fce5bc8e
Resolves: #1867601
* Tue Aug 18 2020 Colin Walters <walters@verbum.org> - 2020.5-2
- Update to https://github.com/ostreedev/ostree/releases/tag/v2020.5
Specifically to fix readonly-sysroot for e.g. RHEL Edge and
older RHCOS versions
- Related: #1861507
* Tue Jul 28 2020 Colin Walters <walters@verbum.org> - 2020.4-1
- https://github.com/ostreedev/ostree/releases/tag/v2020.4
- We plan to use per-object-fsync for etcd in OpenShift 4
- Resolves: #1861507
* Thu May 21 2020 Colin Walters <walters@verbum.org> - 2020.3-3
- Backport https://github.com/ostreedev/ostree/pull/2108
* Fri May 15 2020 Colin Walters <walters@verbum.org> - 2020.3-2
- https://github.com/ostreedev/ostree/releases/tag/v2020.3
Resolves: #1836306
* Tue Dec 10 2019 Colin Walters <walters@verbum.org> - 2019.6-2
- https://github.com/ostreedev/ostree/releases/tag/v2019.6