From e15e1a5bef5707a9a1df13856a29b460d12cbe9a Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Wed, 29 Apr 2009 12:48:52 -0400 Subject: [PATCH] add support for ext2 This is sometimes wanted for filesystems on flash devices. --- src/devkit-disks-daemon.c | 16 ++++++++++++++++ src/job-change-filesystem-label.c | 2 +- src/job-mkfs.c | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/devkit-disks-daemon.c b/src/devkit-disks-daemon.c index b3da462..b7935d5 100644 --- a/src/devkit-disks-daemon.c +++ b/src/devkit-disks-daemon.c @@ -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 */ diff --git a/src/job-change-filesystem-label.c b/src/job-change-filesystem-label.c index 67f3b23..d464c2c 100644 --- a/src/job-change-filesystem-label.c +++ b/src/job-change-filesystem-label.c @@ -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); diff --git a/src/job-mkfs.c b/src/job-mkfs.c index eb1d94b..9a4d428 100644 --- a/src/job-mkfs.c +++ b/src/job-mkfs.c @@ -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); -- 2.7.4