Merge remote-tracking branch 'up/f37' into f37-riscv64

Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
This commit is contained in:
David Abdurachmanov 2022-11-21 10:08:41 +02:00
commit e52ade0484
Signed by: davidlt
GPG Key ID: 8B7F1DA0E2C9FDBB
3 changed files with 13 additions and 74 deletions

View File

@ -1,64 +0,0 @@
From b13268dc09eed68426c2e68a402c96b93f8b0fff Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Mon, 12 Sep 2022 04:57:17 +0900
Subject: [PATCH] test-mountpoint-util: support running on a mount namespace
with another mount on /proc
Fixes #11505.
---
src/test/test-mountpoint-util.c | 30 +++++++++++++++++++++---------
1 file changed, 21 insertions(+), 9 deletions(-)
diff --git a/src/test/test-mountpoint-util.c b/src/test/test-mountpoint-util.c
index 92eed0be62..391e1c97ba 100644
--- a/src/test/test-mountpoint-util.c
+++ b/src/test/test-mountpoint-util.c
@@ -83,24 +83,36 @@ TEST(mnt_id) {
HASHMAP_FOREACH_KEY(p, k, h) {
int mnt_id = PTR_TO_INT(k), mnt_id2;
+ const char *q;
r = path_get_mnt_id(p, &mnt_id2);
if (r < 0) {
- log_debug_errno(r, "Failed to get the mnt id of %s: %m\n", p);
+ log_debug_errno(r, "Failed to get the mnt id of %s: %m", p);
continue;
}
if (mnt_id == mnt_id2) {
- log_debug("mnt ids of %s is %i\n", p, mnt_id);
+ log_debug("mnt ids of %s is %i.", p, mnt_id);
continue;
} else
- log_debug("mnt ids of %s are %i, %i\n", p, mnt_id, mnt_id2);
-
- /* The ids don't match? If so, then there are two mounts on the same path, let's check if
- * that's really the case */
- char *t = hashmap_get(h, INT_TO_PTR(mnt_id2));
- log_debug("the other path for mnt id %i is %s\n", mnt_id2, t);
- assert_se(path_equal(p, t));
+ log_debug("mnt ids of %s are %i (from /proc/self/mountinfo), %i (from path_get_mnt_id()).", p, mnt_id, mnt_id2);
+
+ /* The ids don't match? This can easily happen e.g. running with "unshare --mount-proc".
+ * See #11505. */
+ assert_se(q = hashmap_get(h, INT_TO_PTR(mnt_id2)));
+
+ assert_se((r = path_is_mount_point(p, NULL, 0)) >= 0);
+ if (r == 0) {
+ /* If the path is not a mount point anymore, then it must be a sub directory of
+ * the path corresponds to mnt_id2. */
+ log_debug("The path %s for mnt id %i is not a mount point.", p, mnt_id2);
+ assert_se(!isempty(path_startswith(p, q)));
+ } else {
+ /* If the path is still a mount point, then it must be equivalent to the path
+ * corresponds to mnt_id2 */
+ log_debug("There are multiple mounts on the same path %s.", p);
+ assert_se(path_equal(p, q));
+ }
}
}
--
2.37.2

View File

@ -1 +1 @@
SHA512 (systemd-251.6.tar.gz) = 2da41ac7e939a893ada3ce682a6fe7dd326e8e0132221589da3d2b1d994e1a879118e0c6025f03351dac6567d754223a5f5401d64a5ca9256ab95512800370f8
SHA512 (systemd-251.8.tar.gz) = c337fad3cf2beef11401850ddd6418efef035d4ec6405049084302738042f77ac1f8bfd7eb3611668a13038878389c9617e63278ec0b37782b3e0242e69c4843

View File

@ -30,12 +30,12 @@
Name: systemd
Url: https://www.freedesktop.org/wiki/Software/systemd
%if %{without inplace}
Version: 251.6
Version: 251.8
%else
# determine the build information from local checkout
Version: %(tools/meson-vcs-tag.sh . error | sed -r 's/-([0-9])/.^\1/; s/-g/_g/')
%endif
Release: %autorelease -b 28 -e 4.riscv64
Release: %autorelease -e 0.riscv64
# For a breakdown of the licensing, see README
License: LGPLv2+ and MIT and GPLv2+
@ -89,8 +89,6 @@ GIT_DIR=../../src/systemd/.git git diffab -M v233..master@{2017-06-15} -- hwdb/[
# than in the next section. Packit CI will drop any patches in this range before
# applying upstream pull requests.
# PR https://github.com/systemd/systemd/pull/24639
Patch0002: 0002-test-mountpoint-util-support-running-on-a-mount-name.patch
# Those are downstream-only patches, but we don't want them in packit builds:
# https://bugzilla.redhat.com/show_bug.cgi?id=1738828
@ -910,6 +908,8 @@ fi
[ $1 -eq 1 ] || exit 0
# Initial installation
touch %{_localstatedir}/lib/rpm-state/systemd-resolved.initial-installation
# Related to https://bugzilla.redhat.com/show_bug.cgi?id=1943263
if ls /usr/lib/systemd/libsystemd-shared-24[0-8].so &>/dev/null; then
echo "Skipping presets for systemd-resolved.service, seems we are upgrading from old systemd."
@ -919,14 +919,17 @@ fi
%systemd_post systemd-resolved.service
%posttrans resolved
[ $1 -eq 1 ] || exit 0
[ -e %{_localstatedir}/lib/rpm-state/systemd-resolved.initial-installation ] || exit 0
rm %{_localstatedir}/lib/rpm-state/systemd-resolved.initial-installation
# Initial installation
# Create /etc/resolv.conf symlink.
# We would also create it using tmpfiles, but let's do this here
# too before NetworkManager gets a chance. (systemd-tmpfiles invocation above
# does not do this, because it's marked with ! and we don't specify --boot.)
# https://bugzilla.redhat.com/show_bug.cgi?id=1873856
# (https://bugzilla.redhat.com/show_bug.cgi?id=1873856)
#
# We would also create it using tmpfiles, but let's do this here too
# before NetworkManager gets a chance. (systemd-tmpfiles invocation
# above does not do this, because the line is marked with ! and
# tmpfiles is invoked without --boot in the scriptlet.)
#
# *Create* the symlink if nothing is present yet.
# (https://bugzilla.redhat.com/show_bug.cgi?id=2032085)