[Parted-maintainers] Bug#363253: Please enable support for RAID partitions on sparc

Jurij Smakov jurij at wooyd.org
Tue Apr 18 07:40:34 BST 2006


Package: parted
Severity: wishlist
Tags: patch

Hi,

Attached patch for libparted, courtesy of Fabio Massimo Di Nitto, 
enables the support for RAID volumes on sparc. I'd appreciate if it would 
find its way into the libparted, as it would make it possible to install 
to RAID volumes on sparc.

Best regards,

Jurij Smakov                                        jurij at wooyd.org
Key: http://www.wooyd.org/pgpkey/                   KeyID: C99E03CC
-------------- next part --------------
#! /bin/sh /usr/share/dpatch/dpatch-run
## sparc-fix-raid.dpatch by  <fabbione at sunfire.int.fabbione.net>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.

@DPATCH@
diff -urNad parted-1.6.25.1~/libparted/disk_sun.c parted-1.6.25.1/libparted/disk_sun.c
--- parted-1.6.25.1~/libparted/disk_sun.c	2006-04-16 07:18:49.000000000 +0200
+++ parted-1.6.25.1/libparted/disk_sun.c	2006-04-16 07:19:22.000000000 +0200
@@ -82,6 +82,7 @@
 	int			is_boot;
 	int			is_root;
 	int			is_lvm;
+	int			is_raid;
 } SunPartitionData;
 
 typedef struct {
@@ -342,6 +343,7 @@
 		sun_data->is_boot = sun_data->type == 0x1;
 		sun_data->is_root = sun_data->type == 0x2;
 		sun_data->is_lvm = sun_data->type == 0x8e;
+		sun_data->is_raid = sun_data->type == 0xfd;
 
 		part->num = i + 1;
 		part->fs_type = ped_file_system_probe (&part->geom);
@@ -477,6 +479,7 @@
 		sun_data->is_boot = 0;
 		sun_data->is_root = 0;
 		sun_data->is_lvm = 0;
+		sun_data->is_raid = 0;
 	} else {
 		part->disk_specific = NULL;
 	}
@@ -511,6 +514,7 @@
 	new_sun_data->is_boot = old_sun_data->is_boot;
 	new_sun_data->is_root = old_sun_data->is_root;
 	new_sun_data->is_lvm = old_sun_data->is_lvm;
+	new_sun_data->is_raid = old_sun_data->is_raid;
 	return new_part;
 }
 
@@ -543,6 +547,10 @@
 		sun_data->type = 0x8e;
 		return 1;
 	}
+	if (sun_data->is_raid) {
+		sun_data->type = 0xfd;
+		return 1;
+	}
 
 	sun_data->type = 0x83;
 	if (fs_type) {
@@ -570,19 +578,25 @@
 		case PED_PARTITION_BOOT:
 			sun_data->is_boot = state;
 			if (state)
-				sun_data->is_root = sun_data->is_lvm = 0;
+				sun_data->is_root = sun_data->is_lvm = sun_data->is_raid = 0;
 			return ped_partition_set_system (part, part->fs_type);
 
 		case PED_PARTITION_ROOT:
 			sun_data->is_root = state;
 			if (state)
-				sun_data->is_boot = sun_data->is_lvm = 0;
+				sun_data->is_boot = sun_data->is_lvm = sun_data->is_raid = 0;
 			return ped_partition_set_system (part, part->fs_type);
 
 		case PED_PARTITION_LVM:
 			sun_data->is_lvm = state;
 			if (state)
-				sun_data->is_root = sun_data->is_boot = 0;
+				sun_data->is_root = sun_data->is_boot = sun_data->is_raid = 0;
+			return ped_partition_set_system (part, part->fs_type);
+
+		case PED_PARTITION_RAID:
+			sun_data->is_raid = state;
+			if (state)
+				sun_data->is_root = sun_data->is_boot = sun_data->is_lvm = 0;
 			return ped_partition_set_system (part, part->fs_type);
 
 		default:
@@ -608,6 +622,8 @@
 			return sun_data->is_root;
 		case PED_PARTITION_LVM:
 			return sun_data->is_lvm;
+		case PED_PARTITION_RAID:
+			return sun_data->is_raid;
 
 		default:
 			return 0;
@@ -623,6 +639,7 @@
 		case PED_PARTITION_BOOT:
 		case PED_PARTITION_ROOT:
 		case PED_PARTITION_LVM:
+		case PED_PARTITION_RAID:
 			return 1;
 
 		default:


More information about the Parted-maintainers mailing list