diff --git a/0001-libcontainer-Fall-back-to-noop-if-is-not-a-mountpoin.patch b/0001-libcontainer-Fall-back-to-noop-if-is-not-a-mountpoin.patch new file mode 100644 index 0000000..d7aa74e --- /dev/null +++ b/0001-libcontainer-Fall-back-to-noop-if-is-not-a-mountpoin.patch @@ -0,0 +1,46 @@ +From 58a9a5c50ebd8415162251ce9235835dca3f6a37 Mon Sep 17 00:00:00 2001 +From: Colin Walters +Date: Tue, 28 Jul 2015 16:40:29 -0400 +Subject: [PATCH] libcontainer: Fall back to noop if / is not a mountpoint + +Trying to change the mount namespace was breaking in mock, which just +uses plain chroot. +--- + glnx-libcontainer.c | 20 +++++++++++++++++--- + 1 file changed, 17 insertions(+), 3 deletions(-) + +diff --git a/glnx-libcontainer.c b/glnx-libcontainer.c +index 49fa095..3f50007 100644 +--- a/glnx-libcontainer.c ++++ b/glnx-libcontainer.c +@@ -212,10 +212,24 @@ glnx_libcontainer_run_in_root (const char *dest, + if (container_available) + { + if (mount (NULL, "/", "none", MS_PRIVATE | MS_REC, NULL) != 0) +- _perror_fatal ("mount: "); ++ { ++ if (errno == EINVAL) ++ { ++ /* Ok, we may be inside a mock chroot or the like. In ++ * that case, let's just fall back to not ++ * containerizing. ++ */ ++ container_available = FALSE; ++ } ++ else ++ _perror_fatal ("mount: "); ++ } + +- if (mount (NULL, "/", "none", MS_PRIVATE | MS_REMOUNT | MS_NOSUID, NULL) != 0) +- _perror_fatal ("mount (MS_NOSUID): "); ++ if (container_available) ++ { ++ if (mount (NULL, "/", "none", MS_PRIVATE | MS_REMOUNT | MS_NOSUID, NULL) != 0) ++ _perror_fatal ("mount (MS_NOSUID): "); ++ } + } + + if (chdir (dest) != 0) +-- +1.8.3.1 + diff --git a/rpm-ostree.spec b/rpm-ostree.spec index f1def92..ecefc40 100644 --- a/rpm-ostree.spec +++ b/rpm-ostree.spec @@ -1,11 +1,12 @@ Summary: Client side upgrade program and server side compose tool Name: rpm-ostree Version: 2015.7 -Release: 6%{?dist} +Release: 7%{?dist} #VCS: https://github.com/cgwalters/rpm-ostree # This tarball is generated via "make -f Makefile.dist-packaging dist-snapshot" Source0: rpm-ostree-%{version}.tar.xz Patch1: 0001-compose-Accept-old-cached-repos.patch +Source1: 0001-libcontainer-Fall-back-to-noop-if-is-not-a-mountpoin.patch License: LGPLv2+ URL: https://github.com/cgwalters/rpm-ostree # We always run autogen.sh @@ -40,6 +41,7 @@ The %{name}-devel package includes the header files for the %{name} library. %prep %autosetup -Sgit -n %{name}-%{version} +(cd libglnx; patch -p1 -i %{SOURCE1}) %build env NOCONFIGURE=1 ./autogen.sh @@ -67,6 +69,9 @@ find $RPM_BUILD_ROOT -name '*.la' -delete %{_datadir}/gir-1.0/*-1.0.gir %changelog +* Tue Jul 28 2015 Colin Walters - 2015.7-7 +- Add patch to fix being run inside mock + * Tue Jul 28 2015 Colin Walters - 2015.7-6 - Rebuild again now the hawkey override is expired