Currently, on soft-reboot, /run/credentials/@system is unmounted
because it has DefaultDependencies=yes and as such will have
Conflicts=umount.target and Before=umount.target. Let's make sure
credential mounts survive soft-reboot by implying DefaultDependencies=no
for credential mounts.
after = SPECIAL_LOCAL_FS_PRE_TARGET;
before = SPECIAL_INITRD_USR_FS_TARGET;
- } else if (mount_is_credentials(m))
- after = before = NULL;
-
- else if (mount_is_network(p)) {
+ } else if (mount_is_network(p)) {
after = SPECIAL_REMOTE_FS_PRE_TARGET;
before = SPECIAL_REMOTE_FS_TARGET;
return r;
}
+ if (mount_is_credentials(m))
+ u->default_dependencies = false;
+
r = unit_patch_contexts(u);
if (r < 0)
return r;
IMAGE_NAME="softreboot"
TEST_NO_NSPAWN=1
TEST_INSTALL_VERITY_MINIMAL=1
+KERNEL_APPEND="${KERNEL_APPEND:-} systemd.set_credential=kernelcmdlinecred:uff"
# shellcheck source=test/test-functions
. "$TEST_BASE_DIR/test-functions"
cat /run/testsuite82.signal
test "$(jq -r '.payload.data[1].type.data' </run/testsuite82.signal)" = "soft-reboot"
+ # Check that the system credentials survived the soft reboot.
+ test "$(systemd-creds cat --system kernelcmdlinecred)" = "uff"
+
# Upload another entry
T="/dev/shm/fdstore.$RANDOM"
echo "miaumiau" >"$T"