Merge pull request #27942 from DaanDeMeyer/root-ephemeral

core: Add RootEphemeral= setting
This commit is contained in:
Daan De Meyer
2023-06-21 17:24:39 +02:00
committed by GitHub
21 changed files with 313 additions and 144 deletions
+1
View File
@@ -24,6 +24,7 @@ test_append_files() {
if command -v openssl >/dev/null 2>&1; then
inst_binary openssl
fi
inst_binary unsquashfs
install_verity_minimal
}
@@ -222,6 +222,7 @@ RootImage=
RootHash=
RootHashSignature=
RootVerity=
RootEphemeral=
ExtensionDirectories=
ExtensionImages=
RuntimeMaxSec=
+1
View File
@@ -691,6 +691,7 @@ install_verity_minimal() {
grep
mount
sleep
touch
)
oldinitdir="$initdir"
rm -rfv "$TESTDIR/minimal"
+12
View File
@@ -528,6 +528,18 @@ systemd-confext status
systemd-confext unmerge
rm -rf /run/confexts/
unsquashfs -no-xattrs -d /tmp/img "${image}.raw"
systemd-run --unit=test-root-ephemeral \
-p RootDirectory=/tmp/img \
-p RootEphemeral=yes \
-p Type=exec \
bash -c "touch /abc && sleep infinity"
test -n "$(ls -A /var/lib/systemd/ephemeral-trees)"
systemctl stop test-root-ephemeral
# shellcheck disable=SC2016
timeout 10 bash -c 'while ! test -z "$(ls -A /var/lib/systemd/ephemeral-trees)"; do sleep .5; done'
test ! -f /tmp/img/abc
echo OK >/testok
exit 0