Cherry pick https://github.com/coreos/rpm-ostree/pull/4166
This commit is contained in:
parent
8f463db78c
commit
c65b72f7b1
42
0001-composepost-Handle-existing-absolute-symlinks.patch
Normal file
42
0001-composepost-Handle-existing-absolute-symlinks.patch
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
From 37ae5546dad6df1897cc3d903add5cecd09bc47f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Colin Walters <walters@verbum.org>
|
||||||
|
Date: Thu, 24 Nov 2022 12:56:37 -0500
|
||||||
|
Subject: [PATCH] composepost: Handle existing absolute symlinks
|
||||||
|
|
||||||
|
Regression from cap-std porting around absolute symlinks *again*.
|
||||||
|
The `try_exists()` API will follow symlinks, which is not what
|
||||||
|
we want here.
|
||||||
|
|
||||||
|
This was hit in the fedora-iot builds.
|
||||||
|
---
|
||||||
|
rust/src/composepost.rs | 9 +++++++--
|
||||||
|
1 file changed, 7 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/rust/src/composepost.rs b/rust/src/composepost.rs
|
||||||
|
index bbe49a2e..77dfcc07 100644
|
||||||
|
--- a/rust/src/composepost.rs
|
||||||
|
+++ b/rust/src/composepost.rs
|
||||||
|
@@ -344,13 +344,18 @@ fn compose_postprocess_units(rootfs_dfd: &Dir, treefile: &mut Treefile) -> Resul
|
||||||
|
|
||||||
|
for unit in units {
|
||||||
|
let dest = multiuser_wants.join(unit);
|
||||||
|
- if rootfs_dfd.try_exists(&dest)? {
|
||||||
|
+ if rootfs_dfd
|
||||||
|
+ .symlink_metadata_optional(&dest)
|
||||||
|
+ .with_context(|| format!("Querying {unit}"))?
|
||||||
|
+ .is_some()
|
||||||
|
+ {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
println!("Adding {} to multi-user.target.wants", unit);
|
||||||
|
let target = format!("/usr/lib/systemd/system/{unit}");
|
||||||
|
- cap_primitives::fs::symlink_contents(target, &rootfs_dfd.as_filelike_view(), dest)?;
|
||||||
|
+ cap_primitives::fs::symlink_contents(target, &rootfs_dfd.as_filelike_view(), dest)
|
||||||
|
+ .with_context(|| format!("Linking {unit}"))?;
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.38.1
|
||||||
|
|
@ -4,13 +4,15 @@
|
|||||||
Summary: Hybrid image/package system
|
Summary: Hybrid image/package system
|
||||||
Name: rpm-ostree
|
Name: rpm-ostree
|
||||||
Version: 2022.16
|
Version: 2022.16
|
||||||
Release: 1%{?dist}
|
Release: 2%{?dist}
|
||||||
License: LGPLv2+
|
License: LGPLv2+
|
||||||
URL: https://github.com/coreos/rpm-ostree
|
URL: https://github.com/coreos/rpm-ostree
|
||||||
# This tarball is generated via "cd packaging && make -f Makefile.dist-packaging dist-snapshot"
|
# This tarball is generated via "cd packaging && make -f Makefile.dist-packaging dist-snapshot"
|
||||||
# in the upstream git. It also contains vendored Rust sources.
|
# in the upstream git. It also contains vendored Rust sources.
|
||||||
Source0: https://github.com/coreos/rpm-ostree/releases/download/v%{version}/rpm-ostree-%{version}.tar.xz
|
Source0: https://github.com/coreos/rpm-ostree/releases/download/v%{version}/rpm-ostree-%{version}.tar.xz
|
||||||
|
|
||||||
|
Patch0: 0001-composepost-Handle-existing-absolute-symlinks.patch
|
||||||
|
|
||||||
ExclusiveArch: %{rust_arches}
|
ExclusiveArch: %{rust_arches}
|
||||||
|
|
||||||
BuildRequires: make
|
BuildRequires: make
|
||||||
@ -247,6 +249,9 @@ $PYTHON autofiles.py > files.devel \
|
|||||||
%files devel -f files.devel
|
%files devel -f files.devel
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Nov 28 2022 Colin Walters <walters@verbum.org> - 2022.16-2
|
||||||
|
- Cherry pick https://github.com/coreos/rpm-ostree/pull/4166
|
||||||
|
|
||||||
* Fri Nov 18 2022 Jonathan Lebon <jonathan@jlebon.com> - 2022.16-1
|
* Fri Nov 18 2022 Jonathan Lebon <jonathan@jlebon.com> - 2022.16-1
|
||||||
- https://github.com/coreos/rpm-ostree/releases/tag/v2022.16
|
- https://github.com/coreos/rpm-ostree/releases/tag/v2022.16
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user