summaryrefslogtreecommitdiff
path: root/src/swap.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-11-22 21:06:38 +0100
committerLennart Poettering <lennart@poettering.net>2010-11-22 21:06:56 +0100
commitcfcfd4aefe2141d324f51033057674d9f1171ef3 (patch)
tree1b71a9d134ac8b60359d718424084ef60833b841 /src/swap.c
parent16f6682d0b74f3f1f29ef71aa10d20b36e10b48c (diff)
swap: order file-based swap devices after remount-rootfs
Diffstat (limited to 'src/swap.c')
-rw-r--r--src/swap.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/swap.c b/src/swap.c
index ec9f157b15..0d3cb2f406 100644
--- a/src/swap.c
+++ b/src/swap.c
@@ -199,9 +199,15 @@ static int swap_add_device_links(Swap *s) {
else
return 0;
- return unit_add_node_link(UNIT(s), s->what,
- !p->noauto && p->nofail &&
- s->meta.manager->running_as == MANAGER_SYSTEM);
+ if (is_device_path(s->what))
+ return unit_add_node_link(UNIT(s), s->what,
+ !p->noauto && p->nofail &&
+ s->meta.manager->running_as == MANAGER_SYSTEM);
+ else
+ /* File based swap devices need to be ordered after
+ * remount-rootfs.service, since they might need a
+ * writable file system. */
+ return unit_add_dependency_by_name(UNIT(s), UNIT_AFTER, SPECIAL_REMOUNT_ROOTFS_SERVICE, NULL, true);
}
static int swap_add_default_dependencies(Swap *s) {