rpms/parted/devel parted-1.8.8-alpha.patch, NONE, 1.1 parted.spec, 1.120, 1.121
David Cantrell (dcantrel)
fedora-extras-commits at redhat.com
Thu Apr 10 20:37:53 UTC 2008
Author: dcantrel
Update of /cvs/pkgs/rpms/parted/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv9517
Modified Files:
parted.spec
Added Files:
parted-1.8.8-alpha.patch
Log Message:
* Thu Apr 10 2008 David Cantrell <dcantrell at redhat.com> - 1.8.8-5
- Allow RAID or LVM partition types on BSD disklabels.
(jay.estabrook AT hp.com, #427114)
parted-1.8.8-alpha.patch:
--- NEW FILE parted-1.8.8-alpha.patch ---
diff -up parted-1.8.8/libparted/labels/bsd.c.alpha parted-1.8.8/libparted/labels/bsd.c
--- parted-1.8.8/libparted/labels/bsd.c.alpha 2007-07-23 07:58:31.000000000 -1000
+++ parted-1.8.8/libparted/labels/bsd.c 2008-02-05 14:34:01.000000000 -1000
@@ -108,6 +108,9 @@ typedef struct {
typedef struct {
uint8_t type;
+ int boot;
+ int raid;
+ int lvm;
} BSDPartitionData;
static PedDiskType bsd_disk_type;
@@ -394,6 +397,9 @@ bsd_partition_new (const PedDisk* disk,
if (!bsd_data)
goto error_free_part;
bsd_data->type = 0;
+ bsd_data->boot = 0;
+ bsd_data->raid = 0;
+ bsd_data->lvm = 0;
} else {
part->disk_specific = NULL;
}
@@ -423,6 +429,9 @@ bsd_partition_duplicate (const PedPartit
old_bsd_data = (BSDPartitionData*) part->disk_specific;
new_bsd_data = (BSDPartitionData*) new_part->disk_specific;
new_bsd_data->type = old_bsd_data->type;
+ new_bsd_data->boot = old_bsd_data->boot;
+ new_bsd_data->raid = old_bsd_data->raid;
+ new_bsd_data->lvm = old_bsd_data->lvm;
return new_part;
}
@@ -456,14 +465,61 @@ bsd_partition_set_system (PedPartition*
static int
bsd_partition_set_flag (PedPartition* part, PedPartitionFlag flag, int state)
{
- /* no flags for bsd */
+ PedDisk* disk;
+// PedPartition* walk; // since -Werror, this unused variable would break build
+ BSDPartitionData* bsd_data;
+
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk_specific != NULL, return 0);
+ PED_ASSERT (part->disk != NULL, return 0);
+
+ bsd_data = part->disk_specific;
+ disk = part->disk;
+
+ switch (flag) {
+ case PED_PARTITION_BOOT:
+ bsd_data->boot = state;
+ return 1;
+ case PED_PARTITION_RAID:
+ if (state) {
+ bsd_data->lvm = 0;
+ }
+ bsd_data->raid = state;
+ return 1;
+ case PED_PARTITION_LVM:
+ if (state) {
+ bsd_data->raid = 0;
+ }
+ bsd_data->lvm = state;
+ return 1;
+ default:
+ ;
+ }
return 0;
}
static int
bsd_partition_get_flag (const PedPartition* part, PedPartitionFlag flag)
{
- /* no flags for bsd */
+ BSDPartitionData* bsd_data;
+
+ PED_ASSERT (part != NULL, return 0);
+ PED_ASSERT (part->disk_specific != NULL, return 0);
+
+ bsd_data = part->disk_specific;
+ switch (flag) {
+ case PED_PARTITION_BOOT:
+ return bsd_data->boot;
+
+ case PED_PARTITION_RAID:
+ return bsd_data->raid;
+
+ case PED_PARTITION_LVM:
+ return bsd_data->lvm;
+
+ default:
+ ;
+ }
return 0;
}
@@ -471,7 +527,14 @@ static int
bsd_partition_is_flag_available (const PedPartition* part,
PedPartitionFlag flag)
{
- /* no flags for bsd */
+ switch (flag) {
+ case PED_PARTITION_BOOT:
+ case PED_PARTITION_RAID:
+ case PED_PARTITION_LVM:
+ return 1;
+ default:
+ ;
+ }
return 0;
}
Index: parted.spec
===================================================================
RCS file: /cvs/pkgs/rpms/parted/devel/parted.spec,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -r1.120 -r1.121
--- parted.spec 10 Apr 2008 19:24:21 -0000 1.120
+++ parted.spec 10 Apr 2008 20:37:13 -0000 1.121
@@ -4,7 +4,7 @@
Summary: The GNU disk partition manipulation program
Name: parted
Version: 1.8.8
-Release: 4%{?dist}
+Release: 5%{?dist}
License: GPLv3+
Group: Applications/System
URL: http://www.gnu.org/software/parted
@@ -16,6 +16,7 @@
Patch3: %{name}-1.8.8-manpage.patch
Patch4: %{name}-1.8.8-gcc-4.3.patch
Patch5: %{name}-1.8.8-nofixgpt.patch
+Patch6: %{name}-1.8.8-alpha.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: e2fsprogs-devel
@@ -58,6 +59,7 @@
%patch3 -p1 -b .manpage
%patch4 -p1 -b .gcc43
%patch5 -p1 -b .nofixgpt
+%patch6 -p1 -b .alpha
%build
%configure --enable-device-mapper --enable-selinux --disable-static
@@ -115,6 +117,10 @@
%{_exec_prefix}/%{_lib}/pkgconfig/libparted.pc
%changelog
+* Thu Apr 10 2008 David Cantrell <dcantrell at redhat.com> - 1.8.8-5
+- Allow RAID or LVM partition types on BSD disklabels.
+ (jay.estabrook AT hp.com, #427114)
+
* Thu Apr 10 2008 Peter Jones <pjones at redhat.com> - 1.8.8-4
- Don't interactively ask to fix an AlternateGPT's location when not
at the end of the disk; this is so that disk images written to a
More information about the fedora-extras-commits
mailing list