[gnome-disk-utility/new-ui] Default to "Linux Swap Partition" GPT partition type for swap



commit 6cc7d8a9d095a2c40341c05ce3f88464c4729d78
Author: David Zeuthen <davidz redhat com>
Date:   Tue Oct 27 11:29:02 2009 -0400

    Default to "Linux Swap Partition" GPT partition type for swap

 src/gdu/gdu-util.c |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/src/gdu/gdu-util.c b/src/gdu/gdu-util.c
index e9c8d40..5f646e7 100644
--- a/src/gdu/gdu-util.c
+++ b/src/gdu/gdu-util.c
@@ -624,21 +624,26 @@ gdu_util_get_default_part_type_for_scheme_and_fstype (const char *scheme, const
 
         /* TODO: this function needs work: handle swap partitions, msdos extended, raid, LVM, EFI GPT etc. */
 
-        if (strcmp (scheme, "mbr") == 0) {
-                if (strcmp (fstype, "vfat") == 0) {
+        if (g_strcmp0 (scheme, "mbr") == 0) {
+                if (g_strcmp0 (fstype, "vfat") == 0) {
                         /* TODO: maybe consider size */
                         type = "0x0c";
-                } else if (strcmp (fstype, "swap") == 0) {
+                } else if (g_strcmp0 (fstype, "swap") == 0) {
                         type = "0x82";
-                } else if (strcmp (fstype, "ntfs") == 0) {
+                } else if (g_strcmp0 (fstype, "ntfs") == 0) {
                         type = "0x07";
                 } else {
                         type = "0x83";
                 }
-        } else if (strcmp (scheme, "gpt") == 0) {
-                /* default to Basic Data Partition for now */
-                type = "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7";
-        } else if (strcmp (scheme, "apm") == 0) {
+        } else if (g_strcmp0 (scheme, "gpt") == 0) {
+                if (g_strcmp0 (fstype, "swap") == 0) {
+                        /* Linux Swap Partition */
+                        type = "0657FD6D-A4AB-43C4-84E5-0933C84B4F4F";
+                } else {
+                        /* Linux/Microsoft Basic Data Partition */
+                        type = "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7";
+                }
+        } else if (g_strcmp0 (scheme, "apm") == 0) {
                 type = "Windows_FAT_32";
         }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]