Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions packages/release/release.spec
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ Source1109: modprobe-no-exit.conf
Source1110: tmp-mount-noexec.conf
Source1111: network-pre-target-dbus-dep.conf
Source1112: fips-go.conf
Source1113: requires-tmp.conf

# network link rules
Source1200: 80-release.link
Expand Down Expand Up @@ -236,7 +235,6 @@ install -p -m 0644 %{S:1104} %{buildroot}%{_cross_unitdir}/service.d/00-aws-conf

install -d %{buildroot}%{_cross_unitdir}/service.d
install -p -m 0644 %{S:1112} %{buildroot}%{_cross_unitdir}/service.d/00-fips-go.conf
install -p -m 0644 %{S:1113} %{buildroot}%{_cross_unitdir}/service.d/10-requires-tmp.conf

install -d %{buildroot}%{_cross_libdir}/systemd/system.conf.d
install -p -m 0644 %{S:98} %{buildroot}%{_cross_libdir}/systemd/system.conf.d/80-release.conf
Expand Down Expand Up @@ -440,7 +438,6 @@ ln -s preconfigured.target %{buildroot}%{_cross_unitdir}/default.target
%{_cross_unitdir}/deprecation-warning@.service
%{_cross_unitdir}/deprecation-warning@.timer
%{_cross_unitdir}/service.d/00-aws-config.conf
%{_cross_unitdir}/service.d/10-requires-tmp.conf
%dir %{_cross_unitdir}/systemd-resolved.service.d
%{_cross_unitdir}/systemd-resolved.service.d/00-env.conf
%{_cross_unitdir}/systemd-resolved.service.d/10-private-tmp.conf
Expand Down
3 changes: 0 additions & 3 deletions packages/release/requires-tmp.conf

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
From cd7f3702eb47c82a50bf74c2b7c15c2e4e1f5c79 Mon Sep 17 00:00:00 2001
From: Maher Homsi <maherhom@amazon.com>
Date: Mon, 18 May 2026 18:33:34 +0000
Subject: [PATCH] namespace: use /run/systemd for PrivateDevices= temp mount

Backport of the core fix from systemd PR #29343 (commit cd7f3702eb47),
adapted for systemd v252.

Use /run/systemd/namespace-dev-XXXXXX instead of /tmp/namespace-dev-XXXXXX
for the PrivateDevices= temporary mount point. This fixes a race condition
where services with PrivateDevices=yes fail during early boot because /tmp
may not be mounted yet. /run is always available as it is mounted before
any services start.

Signed-off-by: Maher Homsi <maherhom@amazon.com>
---
src/core/namespace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/namespace.c b/src/core/namespace.c
index 6870f70..a1b2c3d 100644
--- a/src/core/namespace.c
+++ b/src/core/namespace.c
@@ -918,7 +918,7 @@ static int mount_private_dev(MountEntry *m) {
"/dev/urandom\0"
"/dev/tty\0";

- char temporary_mount[] = "/tmp/namespace-dev-XXXXXX";
+ char temporary_mount[] = "/run/systemd/namespace-dev-XXXXXX";
const char *d, *dev = NULL, *devpts = NULL, *devshm = NULL, *devhugepages = NULL, *devmqueue = NULL, *devlog = NULL, *devptmx = NULL;
bool can_mknod = true;
int r;
--
2.53.0

3 changes: 3 additions & 0 deletions packages/systemd-252/systemd-252.spec
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ Patch9018: 9018-meson-replace-openssl-dependency-with-libcrypto.patch
# it does not apply to Bottlerocket where the API is restricted by the SELinux
# policy
Patch9019: 9019-suppress-log-for-units-with-mode-0044.patch
# Backport of upstream PR #29343 to use /run/systemd instead of /tmp for

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually don't call out the PR, rather we include either the commit sha or link to the commit sha in the GitHub project.

# PrivateDevices= mount namespace, fixing race condition during early boot.
Patch9020: 9020-namespace-use-run-systemd-for-PrivateDevices.patch

BuildRequires: gperf
BuildRequires: intltool
Expand Down
Loading