X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fubox.git;a=blobdiff_plain;f=block.c;h=c9285d642ad8346bbb10dede5c9df2af99828ded;hp=723c0f0456413c353c32358706e01050ef6b28a9;hb=16f0ad316f01520fe318e0855c0873a3915c3640;hpb=9284b0ea87db88ecb6de01669efbba852be8f966 diff --git a/block.c b/block.c index 723c0f0..c9285d6 100644 --- a/block.c +++ b/block.c @@ -302,7 +302,13 @@ static int swap_add(struct uci_section *s) /* store complete swap path */ if (tb[SWAP_DEVICE]) m->target = blobmsg_get_strdup(tb[SWAP_DEVICE]); - vlist_add(&mounts, &m->node, (m->uuid) ? (m->uuid) : (m->device)); + + if (m->uuid) + vlist_add(&mounts, &m->node, m->uuid); + else if (m->label) + vlist_add(&mounts, &m->node, m->label); + else if (m->device) + vlist_add(&mounts, &m->node, m->device); } return 0; @@ -957,6 +963,8 @@ static int main_mount(int argc, char **argv) list_for_each_entry(pr, &devices, list) mount_device(pr, 0); + handle_swapfiles(true); + return 0; }