From de381b7777e8aeedd2d964405543d76aa813e5b8 Mon Sep 17 00:00:00 2001 From: Duncaen Date: Mon, 19 Dec 2022 17:31:52 +0100 Subject: [PATCH] libostree: update to 2022.7. --- .../patches/fix-compat-glibc-2.36.patch | 143 ------------------ srcpkgs/libostree/patches/musl-fixes.patch | 13 ++ srcpkgs/libostree/template | 4 +- 3 files changed, 15 insertions(+), 145 deletions(-) delete mode 100644 srcpkgs/libostree/patches/fix-compat-glibc-2.36.patch diff --git a/srcpkgs/libostree/patches/fix-compat-glibc-2.36.patch b/srcpkgs/libostree/patches/fix-compat-glibc-2.36.patch deleted file mode 100644 index c1664018cca..00000000000 --- a/srcpkgs/libostree/patches/fix-compat-glibc-2.36.patch +++ /dev/null @@ -1,143 +0,0 @@ -From edba4b33be10c05253bfa94895dfbc8477e44d76 Mon Sep 17 00:00:00 2001 -From: Colin Walters -Date: Wed, 3 Aug 2022 10:37:40 -0400 -Subject: [PATCH 1/2] Remove unused `linux/fs.h` includes - -Prep for fixing conflicts introduced by newer glibc. -cc https://github.com/ostreedev/ostree/issues/2685 ---- - src/libostree/ostree-repo-commit.c | 1 - - src/ostree/ot-main.c | 1 - - 2 files changed, 2 deletions(-) - -diff --git a/src/libostree/ostree-repo-commit.c b/src/libostree/ostree-repo-commit.c -index afab3fdf85..35b16c713b 100644 ---- a/src/libostree/ostree-repo-commit.c -+++ b/src/libostree/ostree-repo-commit.c -@@ -30,7 +30,6 @@ - #include - #include - #include --#include - #include - - #include "otutil.h" -diff --git a/src/ostree/ot-main.c b/src/ostree/ot-main.c -index b7b50d67e3..7a4405a50d 100644 ---- a/src/ostree/ot-main.c -+++ b/src/ostree/ot-main.c -@@ -28,7 +28,6 @@ - #include - #include - #include --#include - - #include "ot-main.h" - #include "ostree.h" - -From 0a908a180fcce98c2565b9fb34470e5953918260 Mon Sep 17 00:00:00 2001 -From: Colin Walters -Date: Wed, 3 Aug 2022 10:43:43 -0400 -Subject: [PATCH 2/2] Move FIFREEZE/FITHAW ioctl invocations into linuxfsutil.c - -Should help avoid conflicts between glibc and linux headers. - -Closes: https://github.com/ostreedev/ostree/issues/2685 ---- - src/libostree/ostree-linuxfsutil.c | 24 ++++++++++++++++++++++-- - src/libostree/ostree-linuxfsutil.h | 3 +++ - src/libostree/ostree-sysroot-deploy.c | 7 +++---- - 3 files changed, 28 insertions(+), 6 deletions(-) - -diff --git a/src/libostree/ostree-linuxfsutil.c b/src/libostree/ostree-linuxfsutil.c -index 97f936048a..aa389aaa80 100644 ---- a/src/libostree/ostree-linuxfsutil.c -+++ b/src/libostree/ostree-linuxfsutil.c -@@ -24,10 +24,12 @@ - - #include - #include -+// This should be the only file including linux/fs.h; see -+// https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E -+// https://github.com/ostreedev/ostree/issues/2685 -+#include - #include - --#include "otutil.h" -- - /** - * _ostree_linuxfs_fd_alter_immutable_flag: - * @fd: A file descriptor -@@ -88,3 +90,21 @@ _ostree_linuxfs_fd_alter_immutable_flag (int fd, - - return TRUE; - } -+ -+/* Wrapper for FIFREEZE ioctl. -+ * This is split into a separate wrapped API for -+ * reasons around conflicts between glibc and linux/fs.h -+ * includes; see above. -+ */ -+int -+_ostree_linuxfs_filesystem_freeze (int fd) -+{ -+ return TEMP_FAILURE_RETRY (ioctl (fd, FIFREEZE, 0)); -+} -+ -+/* Wrapper for FITHAW ioctl. See above. */ -+int -+_ostree_linuxfs_filesystem_thaw (int fd) -+{ -+ return TEMP_FAILURE_RETRY (ioctl (fd, FITHAW, 0)); -+} -diff --git a/src/libostree/ostree-linuxfsutil.h b/src/libostree/ostree-linuxfsutil.h -index 0654b6fc7c..9011c9d869 100644 ---- a/src/libostree/ostree-linuxfsutil.h -+++ b/src/libostree/ostree-linuxfsutil.h -@@ -29,4 +29,7 @@ _ostree_linuxfs_fd_alter_immutable_flag (int fd, - GCancellable *cancellable, - GError **error); - -+int _ostree_linuxfs_filesystem_freeze (int fd); -+int _ostree_linuxfs_filesystem_thaw (int fd); -+ - G_END_DECLS -diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c -index 2dc9f58b16..d86de7dc7b 100644 ---- a/src/libostree/ostree-sysroot-deploy.c -+++ b/src/libostree/ostree-sysroot-deploy.c -@@ -29,7 +29,6 @@ - #include - #include - #include --#include - #include - - #ifdef HAVE_LIBMOUNT -@@ -1476,7 +1475,7 @@ fsfreeze_thaw_cycle (OstreeSysroot *self, - * EOPNOTSUPP: If the filesystem doesn't support it - */ - int saved_errno = errno; -- (void) TEMP_FAILURE_RETRY (ioctl (rootfs_dfd, FITHAW, 0)); -+ _ostree_linuxfs_filesystem_thaw (rootfs_dfd); - errno = saved_errno; - /* But if we got an error from poll, let's log it */ - if (r < 0) -@@ -1517,7 +1516,7 @@ fsfreeze_thaw_cycle (OstreeSysroot *self, - return glnx_throw (error, "aborting due to test-fifreeze"); - } - /* Do a freeze/thaw cycle; TODO add a FIFREEZETHAW ioctl */ -- if (ioctl (rootfs_dfd, FIFREEZE, 0) != 0) -+ if (_ostree_linuxfs_filesystem_freeze (rootfs_dfd) != 0) - { - /* Not supported, we're running in the unit tests (as non-root), or - * the filesystem is already frozen (EBUSY). -@@ -1539,7 +1538,7 @@ fsfreeze_thaw_cycle (OstreeSysroot *self, - return glnx_throw_errno_prefix (error, "ioctl(FIFREEZE)"); - } - /* And finally thaw, then signal our completion to the watchdog */ -- if (TEMP_FAILURE_RETRY (ioctl (rootfs_dfd, FITHAW, 0)) != 0) -+ if (_ostree_linuxfs_filesystem_thaw (rootfs_dfd) != 0) - { - /* Warn but don't error if the filesystem was already thawed */ - if (errno == EINVAL) diff --git a/srcpkgs/libostree/patches/musl-fixes.patch b/srcpkgs/libostree/patches/musl-fixes.patch index 956ab625e04..e9a578a3e66 100644 --- a/srcpkgs/libostree/patches/musl-fixes.patch +++ b/srcpkgs/libostree/patches/musl-fixes.patch @@ -16,3 +16,16 @@ /* Define if we are building with asan and ubsan */ #undef BUILDOPT_ASAN +--- a/src/libostree/ostree-repo-checkout.c ++++ b/src/libostree/ostree-repo-checkout.c +@@ -37,6 +37,10 @@ + + #define OVERLAYFS_WHITEOUT_PREFIX ".ostree-wh." + ++#ifndef ALLPERMS ++#define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)/* 07777 */ ++#endif ++ + /* Per-checkout call state/caching */ + typedef struct { + GString *path_buf; /* buffer for real path if filtering enabled */ diff --git a/srcpkgs/libostree/template b/srcpkgs/libostree/template index 643e6fae25d..ee694029ad3 100644 --- a/srcpkgs/libostree/template +++ b/srcpkgs/libostree/template @@ -1,6 +1,6 @@ # Template file for 'libostree' pkgname=libostree -version=2022.5 +version=2022.7 revision=1 build_style=gnu-configure build_helper="gir" @@ -19,7 +19,7 @@ license="LGPL-2.0-or-later" homepage="https://ostree.readthedocs.io/en/latest/" changelog="https://github.com/ostreedev/ostree/releases" distfiles="https://github.com/ostreedev/ostree/releases/download/v${version}/libostree-${version}.tar.xz" -checksum=914c4d993bc111d7dd30ae9721b6ffe8ab56eb1fd6e81b097b09f400cc1b053f +checksum=8be2a9261c94e8b9ec4113380ffc480f8598245fb321a009bad4fae4b822411f build_options="gir" build_options_default="gir"