New upstream version

This commit is contained in:
Colin Walters 2015-06-09 10:17:32 -04:00
parent 50b0658653
commit 7d53a829df
5 changed files with 7 additions and 320 deletions

1
.gitignore vendored
View File

@ -21,3 +21,4 @@
/rpm-ostree-2015.3.tar.xz
/rpm-ostree-2015.4.tar.xz
/rpm-ostree-2015.5.tar.xz
/rpm-ostree-2015.6.tar.xz

View File

@ -1,156 +0,0 @@
From 1c3a549ef9ebaecf9a0eab7515adddc594c78779 Mon Sep 17 00:00:00 2001
From: Colin Walters <walters@verbum.org>
Date: Tue, 12 May 2015 12:26:38 -0400
Subject: [PATCH] postprocess: Handle Fedora rawhide kernel installation
The vmlinuz binary has moved to /usr/lib/modules, which is a change
mostly for the better, but we need to adapt.
Closes: https://github.com/projectatomic/rpm-ostree/pull/143
---
src/libpriv/rpmostree-postprocess.c | 98 +++++++++++++++++++++++++++++++------
1 file changed, 84 insertions(+), 14 deletions(-)
diff --git a/src/libpriv/rpmostree-postprocess.c b/src/libpriv/rpmostree-postprocess.c
index c690fe2..7b390f9 100644
--- a/src/libpriv/rpmostree-postprocess.c
+++ b/src/libpriv/rpmostree-postprocess.c
@@ -168,7 +168,8 @@ find_kernel_and_initramfs_in_bootdir (GFile *bootdir,
name = g_file_info_get_name (file_info);
- if (g_str_has_prefix (name, "vmlinuz-"))
+ /* Current Fedora 23 kernel.spec installs as just vmlinuz */
+ if (strcmp (name, "vmlinuz") == 0 || g_str_has_prefix (name, "vmlinuz-"))
{
if (ret_kernel)
{
@@ -192,17 +193,57 @@ find_kernel_and_initramfs_in_bootdir (GFile *bootdir,
}
}
- if (!ret_kernel)
+ ret = TRUE;
+ gs_transfer_out_value (out_kernel, &ret_kernel);
+ gs_transfer_out_value (out_initramfs, &ret_initramfs);
+ out:
+ return ret;
+}
+
+/* Given a directory @d, find the first child that is a directory,
+ * returning it in @out_subdir. If there are multiple directories,
+ * return an error.
+ */
+static gboolean
+find_ensure_one_subdirectory (GFile *d,
+ GFile **out_subdir,
+ GCancellable *cancellable,
+ GError **error)
+{
+ gboolean ret = FALSE;
+ gs_unref_object GFileEnumerator *direnum = NULL;
+ gs_unref_object GFile *ret_subdir = NULL;
+
+ direnum = g_file_enumerate_children (d, "standard::name,standard::type", 0,
+ cancellable, error);
+ if (!direnum)
+ goto out;
+
+ while (TRUE)
{
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "Unable to find vmlinuz- in %s",
- gs_file_get_path_cached (bootdir));
- goto out;
+ GFileInfo *file_info;
+ GFile *child;
+
+ if (!gs_file_enumerator_iterate (direnum, &file_info, &child,
+ cancellable, error))
+ goto out;
+ if (!file_info)
+ break;
+
+ if (g_file_info_get_file_type (file_info) == G_FILE_TYPE_DIRECTORY)
+ {
+ if (ret_subdir)
+ {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "Multiple subdirectories found in: %s", gs_file_get_path_cached (d));
+ goto out;
+ }
+ ret_subdir = g_object_ref (child);
+ }
}
ret = TRUE;
- gs_transfer_out_value (out_kernel, &ret_kernel);
- gs_transfer_out_value (out_initramfs, &ret_initramfs);
+ gs_transfer_out_value (out_subdir, &ret_subdir);
out:
return ret;
}
@@ -220,14 +261,38 @@ do_kernel_prep (GFile *yumroot,
gs_unref_object GFile *initramfs_path = NULL;
const char *boot_checksum_str = NULL;
GChecksum *boot_checksum = NULL;
- const char *kname;
- const char *kver;
+ g_autofree char *kver = NULL;
if (!find_kernel_and_initramfs_in_bootdir (bootdir, &kernel_path,
&initramfs_path,
cancellable, error))
goto out;
+ if (kernel_path == NULL)
+ {
+ gs_unref_object GFile *mod_dir = g_file_resolve_relative_path (yumroot, "usr/lib/modules");
+ gs_unref_object GFile *modversion_dir = NULL;
+
+ if (!find_ensure_one_subdirectory (mod_dir, &modversion_dir, cancellable, error))
+ goto out;
+
+ if (modversion_dir)
+ {
+ kver = g_file_get_basename (modversion_dir);
+ if (!find_kernel_and_initramfs_in_bootdir (modversion_dir, &kernel_path,
+ &initramfs_path,
+ cancellable, error))
+ goto out;
+ }
+ }
+
+ if (kernel_path == NULL)
+ {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "Unable to find kernel (vmlinuz) in /boot or /usr/lib/modules");
+ goto out;
+ }
+
if (initramfs_path)
{
g_print ("Removing RPM-generated '%s'\n",
@@ -236,10 +301,15 @@ do_kernel_prep (GFile *yumroot,
goto out;
}
- kname = gs_file_get_basename_cached (kernel_path);
- kver = strchr (kname, '-');
- g_assert (kver);
- kver += 1;
+ if (!kver)
+ {
+ const char *kname = gs_file_get_basename_cached (kernel_path);
+ const char *kver_p;
+
+ kver_p = strchr (kname, '-');
+ g_assert (kver_p);
+ kver = g_strdup (kver_p + 1);
+ }
/* OSTree needs to own this */
{
--
1.8.3.1

View File

@ -1,160 +0,0 @@
From 3d214c4a4f42d48ae3752f50d3a3aa92264b821e Mon Sep 17 00:00:00 2001
From: Colin Walters <walters@verbum.org>
Date: Thu, 5 Feb 2015 09:21:07 -0500
Subject: [PATCH 1/3] treepkgdiff: Adapt to Hawkey 0.5.3 API break
We will work on both old and new versions.
See https://github.com/rpm-software-management/hawkey/commit/8ce3ce754f50b4284587ceaa2eb4c0acf328912a
Conflicts:
configure.ac
---
configure.ac | 2 ++
src/rpmostree-treepkgdiff.c | 11 ++++++++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index dcb75a1..6240c88 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,6 +45,8 @@ PKG_CHECK_MODULES(PKGDEP_GIO_UNIX, [gio-unix-2.0])
PKG_CHECK_MODULES(PKGDEP_RPMOSTREE, [gio-unix-2.0 json-glib-1.0
ostree-1 >= 2015.1 libgsystem >= 2015.1
rpm hawkey])
+AS_IF([pkg-config --atleast-version=0.5.3 hawkey],
+ [AC_DEFINE([BUILDOPT_HAWKEY_SACK_CREATE2], 1, [Hawkey ABI change in 0.5.3])])
AC_PATH_PROG([XSLTPROC], [xsltproc])
GLIB_TESTS
diff --git a/src/rpmostree-treepkgdiff.c b/src/rpmostree-treepkgdiff.c
index f722e7e..b09c72e 100644
--- a/src/rpmostree-treepkgdiff.c
+++ b/src/rpmostree-treepkgdiff.c
@@ -38,7 +38,16 @@ rpmostree_get_pkglist_for_root (GFile *root,
_cleanup_hyquery_ HyQuery query = NULL;
_cleanup_hypackagelist_ HyPackageList pkglist = NULL;
- sack = hy_sack_create (NULL, NULL, gs_file_get_path_cached (root), 0);
+#ifdef BUILDOPT_HAWKEY_SACK_CREATE2
+ sack = hy_sack_create (NULL, NULL,
+ gs_file_get_path_cached (root),
+ NULL,
+ HY_MAKE_CACHE_DIR);
+#else
+ sack = hy_sack_create (NULL, NULL,
+ gs_file_get_path_cached (root),
+ HY_MAKE_CACHE_DIR);
+#endif
if (sack == NULL)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
--
1.8.3.1
From 99765147e70ea140549841a8dcec52ff6a7f580f Mon Sep 17 00:00:00 2001
From: Colin Walters <walters@verbum.org>
Date: Wed, 8 Apr 2015 09:01:00 -0400
Subject: [PATCH 2/3] build: Add --with-yum-binary, use yum-deprecated
Related: https://github.com/projectatomic/rpm-ostree/issues/121
---
configure.ac | 5 +++++
packaging/rpm-ostree.spec.in | 4 ++--
src/rpmostree-compose-builtin-tree.c | 4 ++--
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/configure.ac b/configure.ac
index 6240c88..a231e2b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -53,6 +53,11 @@ GLIB_TESTS
GOBJECT_INTROSPECTION_REQUIRE([1.34.0])
+AC_ARG_WITH(yum-binary,
+ AS_HELP_STRING([--with-yum-binary], [Use this yum binary @<:@default=yum@:>@]),
+ [], [with_yum_binary=yum])
+AC_DEFINE_UNQUOTED(YUM_BINARY, ["$with_yum_binary"], [Define to name or path of yum binary])
+
AC_ARG_ENABLE(installed_tests,
AS_HELP_STRING([--enable-installed-tests],
[Install test programs (default: no)]),,
diff --git a/packaging/rpm-ostree.spec.in b/packaging/rpm-ostree.spec.in
index f94f66e..48f9c65 100644
--- a/packaging/rpm-ostree.spec.in
+++ b/packaging/rpm-ostree.spec.in
@@ -19,7 +19,7 @@ BuildRequires: pkgconfig(rpm)
BuildRequires: pkgconfig(hawkey)
BuildRequires: libcap-devel
-Requires: /usr/bin/yum
+Requires: /usr/bin/yum-deprecated
%description
This tool takes a set of packages, and commits them to an OSTree
@@ -30,7 +30,7 @@ repository. At the moment, it is intended for use on build servers.
%build
env NOCONFIGURE=1 ./autogen.sh
-%configure --disable-silent-rules --enable-patched-hawkey-and-libsolv --enable-usrbinatomic
+%configure --disable-silent-rules --enable-patched-hawkey-and-libsolv --enable-usrbinatomic --with-yum-binary=/usr/bin/yum-deprecated
make %{?_smp_mflags}
%install
diff --git a/src/rpmostree-compose-builtin-tree.c b/src/rpmostree-compose-builtin-tree.c
index fc1220f..00f8ed6 100644
--- a/src/rpmostree-compose-builtin-tree.c
+++ b/src/rpmostree-compose-builtin-tree.c
@@ -286,7 +286,7 @@ yum_context_new (RpmOstreeTreeComposeContext *self,
int clone_flags = SIGCHLD | CLONE_NEWNS | CLONE_NEWPID;
int pipefds[2];
- g_ptr_array_add (yum_argv, g_strdup ("yum"));
+ g_ptr_array_add (yum_argv, g_strdup (YUM_BINARY));
g_ptr_array_add (yum_argv, g_strdup ("-y"));
if (!append_repo_and_cache_opts (self, treedata, yum_argv,
@@ -364,7 +364,7 @@ yum_context_new (RpmOstreeTreeComposeContext *self,
_rpmostree_perror_fatal ("mount(/, MS_PRIVATE | MS_NOSUID)");
}
- if (execvp ("yum", (char**)yum_argv->pdata) < 0)
+ if (execvp (YUM_BINARY, (char**)yum_argv->pdata) < 0)
_rpmostree_perror_fatal ("execvp");
}
--
1.8.3.1
From e6a8deb6934475d18fcb0ad1ae231fdfd6d23ae3 Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Thu, 19 Mar 2015 09:51:41 -0400
Subject: [PATCH 3/3] compose: Disable /etc RO bind mount - breaks in Docker
containers
For reasons I haven't yet debugged - it makes the Docker bind mount of
/etc/resolv.conf go away.
---
src/rpmostree-compose-builtin-tree.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/rpmostree-compose-builtin-tree.c b/src/rpmostree-compose-builtin-tree.c
index 00f8ed6..99ee65f 100644
--- a/src/rpmostree-compose-builtin-tree.c
+++ b/src/rpmostree-compose-builtin-tree.c
@@ -853,9 +853,6 @@ rpmostree_compose_builtin_tree (int argc,
goto out;
}
- /* Protect the system's /etc and /usr */
- if (!_rpmostree_libcontainer_bind_mount_readonly ("/etc", error))
- goto out;
if (!_rpmostree_libcontainer_bind_mount_readonly ("/usr", error))
goto out;
}
--
1.8.3.1

View File

@ -1,11 +1,10 @@
Summary: Client side upgrade program and server side compose tool
Name: rpm-ostree
Version: 2015.5
Release: 3%{?dist}
Version: 2015.6
Release: 2%{?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
Patch0: 0001-postprocess-Handle-Fedora-rawhide-kernel-installatio.patch
License: LGPLv2+
URL: https://github.com/cgwalters/rpm-ostree
# We always run autogen.sh
@ -67,6 +66,9 @@ find $RPM_BUILD_ROOT -name '*.la' -delete
%{_datadir}/gir-1.0/*-1.0.gir
%changelog
* Tue Jun 09 2015 Colin Walters <walters@redhat.com> - 2015.6-2
- New upstream version
* Tue May 12 2015 Colin Walters <walters@redhat.com> - 2015.5-3
- Add patch to fix rawhide composes

View File

@ -1 +1 @@
63048fe64469bd3aa8b6ac04655c0e9e rpm-ostree-2015.5.tar.xz
cfad08269c86c0b285dc4ead15e4333d rpm-ostree-2015.6.tar.xz