add support for ext2
authorDavid Zeuthen <davidz@redhat.com>
Wed, 29 Apr 2009 16:48:52 +0000 (12:48 -0400)
committerDavid Zeuthen <davidz@redhat.com>
Wed, 29 Apr 2009 16:48:52 +0000 (12:48 -0400)
This is sometimes wanted for filesystems on flash devices.

src/devkit-disks-daemon.c
src/job-change-filesystem-label.c
src/job-mkfs.c

index b3da462..b7935d5 100644 (file)
@@ -236,6 +236,22 @@ static const DevkitDisksFilesystem known_file_systems[] = {
                 FALSE,          /* supports_online_resize_shrink */
         },
         {
+                "ext2",         /* id */
+                "Linux Ext2",   /* name */
+                TRUE,           /* supports_unix_owners */
+                TRUE,           /* can_mount */
+                TRUE,           /* can_create */
+                16,             /* max_label_len */
+                TRUE,           /* supports_label_rename */
+                TRUE,           /* supports_online_label_rename*/
+                TRUE,           /* supports_fsck */
+                FALSE,          /* supports_online_fsck */
+                TRUE,           /* supports_resize_enlarge */
+                TRUE,           /* supports_online_resize_enlarge */
+                TRUE,           /* supports_resize_shrink */
+                TRUE,           /* supports_online_resize_shrink */
+        },
+        {
                 "ext3",         /* id */
                 "Linux Ext3",   /* name */
                 TRUE,           /* supports_unix_owners */
index 67f3b23..d464c2c 100644 (file)
@@ -64,7 +64,7 @@ main (int argc, char **argv)
         fstype = argv[2];
         new_label = g_strdup (argv[3]);
 
-        if (strcmp (fstype, "ext3") == 0 || strcmp (fstype, "ext4") == 0) {
+        if (strcmp (fstype, "ext2") == 0 || strcmp (fstype, "ext3") == 0 || strcmp (fstype, "ext4") == 0) {
                 if (!validate_and_escape_label (&new_label, 16))
                         goto out;
                 command_line = g_strdup_printf ("e2label %s \"%s\"", device, new_label);
index eb1d94b..9a4d428 100644 (file)
@@ -123,7 +123,7 @@ main (int argc, char **argv)
                 g_string_append_printf (s, " %s", device);
                 command_line = g_string_free (s, FALSE);
 
-        } else if (strcmp (fstype, "ext3") == 0 || strcmp (fstype, "ext4") == 0) {
+        } else if (strcmp (fstype, "ext2") == 0 || strcmp (fstype, "ext3") == 0 || strcmp (fstype, "ext4") == 0) {
 
                 s = g_string_new ("mkfs.");
                 g_string_append (s, fstype);