From 1b408109166b983428b37b87d902c64f76febdcb Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 20 Oct 2020 18:58:49 +0000 Subject: [PATCH] Make /run a directory in scripts It's part of the expected standard environment, and its omission ended up breaking some bootupd work. See https://github.com/coreos/bootupd/pull/84#issuecomment-709414840 --- scripts/bwrap-script-shell.sh | 2 +- src/libpriv/rpmostree-bwrap.c | 1 + tests/compose/test-misc-tweaks.sh | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/bwrap-script-shell.sh b/scripts/bwrap-script-shell.sh index 1f6ac28b..4fe81018 100755 --- a/scripts/bwrap-script-shell.sh +++ b/scripts/bwrap-script-shell.sh @@ -5,7 +5,7 @@ rootfs=$1 shift cd ${rootfs} # ⚠⚠⚠ If you change this, also update src/libpriv/rpmostree-scripts.c ⚠⚠⚠ -BWRAP_ARGV="--dev /dev --proc /proc --dir /tmp --chdir / \ +BWRAP_ARGV="--dev /dev --proc /proc --dir /tmp --dir /run --chdir / \ --unshare-pid --unshare-uts \ --unshare-ipc --unshare-cgroup-try \ " diff --git a/src/libpriv/rpmostree-bwrap.c b/src/libpriv/rpmostree-bwrap.c index c5f334cf..44960753 100644 --- a/src/libpriv/rpmostree-bwrap.c +++ b/src/libpriv/rpmostree-bwrap.c @@ -283,6 +283,7 @@ rpmostree_bwrap_new_base (int rootfs_fd, GError **error) WITH_BUBBLEWRAP_PATH, "--dev", "/dev", "--proc", "/proc", + "--dir", "/run", "--dir", "/tmp", "--chdir", "/", "--ro-bind", "/sys/block", "/sys/block", diff --git a/tests/compose/test-misc-tweaks.sh b/tests/compose/test-misc-tweaks.sh index 8c5e3773..e08fdfac 100755 --- a/tests/compose/test-misc-tweaks.sh +++ b/tests/compose/test-misc-tweaks.sh @@ -62,6 +62,7 @@ treefile_set "postprocess" '["""#!/bin/bash touch /usr/share/postprocess-testing""", """#!/bin/bash set -xeuo pipefail +mkdir /run/somedir touch /usr/share/included-postprocess-test rm /usr/share/postprocess-testing touch /usr/share/postprocess-testing-done"""]'