From: David Zeuthen Date: Thu, 5 Jun 2008 21:38:18 +0000 (-0400) Subject: use mlabel rather than dosfslabel X-Git-Tag: upstream/2.1.2~992 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a28f0b6afba339fd9254952394cbff509e3dfff5;p=platform%2Fupstream%2Fudisks2.git use mlabel rather than dosfslabel Because compared to dosfslabel - mlabel actually works - mlabel supports long labels (254 characters) - mlabel is also available in e.g. SUSE; dosfslabel seem to be a RH hack --- diff --git a/src/devkit-disks-daemon.c b/src/devkit-disks-daemon.c index 114423c..fcd777d 100644 --- a/src/devkit-disks-daemon.c +++ b/src/devkit-disks-daemon.c @@ -314,7 +314,7 @@ static const DevkitDisksFilesystem known_file_systems[] = { FALSE, /* supports_unix_owners */ TRUE, /* can_mount */ TRUE, /* can_create */ - 11, /* max_label_len */ + 254, /* max_label_len */ TRUE, /* supports_label_rename */ FALSE, /* supports_online_label_rename*/ TRUE, /* supports_fsck */ diff --git a/src/job-change-filesystem-label.c b/src/job-change-filesystem-label.c index e83775d..9edaad9 100644 --- a/src/job-change-filesystem-label.c +++ b/src/job-change-filesystem-label.c @@ -77,9 +77,12 @@ main (int argc, char **argv) command_line = g_strdup_printf ("xfs_admin -L \"%s\" %s", new_label, device); } else if (strcmp (fstype, "vfat") == 0) { - if (!validate_and_escape_label (&new_label, 11)) + if (!validate_and_escape_label (&new_label, 254)) goto out; - command_line = g_strdup_printf ("dosfslabel %s \"%s\"", device, new_label); + if (strlen (new_label) == 0) + command_line = g_strdup_printf ("mlabel -c -i %s ::", device); + else + command_line = g_strdup_printf ("mlabel -i %s \"::%s\"", device, new_label); } else { g_printerr ("fstype %s not supported\n", fstype);