From cd687a4ea79dad24aa42aeacdaa0efe1414d1911 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Thu, 22 Oct 2009 09:39:53 +0200 Subject: [PATCH] support creating swap fs with labels mkswapfs supports labels just fine, add support for it to FilesystemCreate(). https://bugs.freedesktop.org/show_bug.cgi?id=24673 --- src/job-mkfs.c | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/job-mkfs.c b/src/job-mkfs.c index 9a4d428..50a13b4 100644 --- a/src/job-mkfs.c +++ b/src/job-mkfs.c @@ -218,8 +218,19 @@ main (int argc, char **argv) s = g_string_new ("mkswap"); for (n = 0; options[n] != NULL; n++) { - g_printerr ("option %s not supported\n", options[n]); - goto out; + if (g_str_has_prefix (options[n], "label=")) { + label = strdup (options[n] + sizeof ("label=") - 1); + if (!validate_and_escape_label (&label, 12)) { + g_string_free (s, TRUE); + goto out; + } + g_string_append_printf (s, " -L \"%s\"", label); + g_free (label); + label = NULL; + } else { + g_printerr ("option %s not supported\n", options[n]); + goto out; + } } g_string_append_printf (s, " %s", device); command_line = g_string_free (s, FALSE); -- 1.6.3.3