bug-parted
[Top][All Lists]
Advanced

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

[PATCH parted 1/2] msdos: recognize id 27 as a diagnostics (recovery) pa


From: Hans de Goede
Subject: [PATCH parted 1/2] msdos: recognize id 27 as a diagnostics (recovery) partition
Date: Thu, 6 May 2010 10:25:35 +0200

msdos partitiontable partition id 27 is recommended by microsoft for
use as id for recovery partitions, see:
http://technet.microsoft.com/en-us/library/dd744364%28WS.10%29.aspx
http://bugzilla.redhat.com/show_bug.cgi?id=534066

* libparted/labels/dos.c(PARTITION_MSFT_RECOVERY): add define
* libparted/labels/dos.c(raw_part_parse): recognize id 27
* libparted/labels/dos.c(msdos_partition_set_system): recognize id 27
---
 libparted/labels/dos.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/libparted/labels/dos.c b/libparted/labels/dos.c
index fdc679b..cb51491 100644
--- a/libparted/labels/dos.c
+++ b/libparted/labels/dos.c
@@ -81,6 +81,7 @@ static const char MBR_BOOT_CODE[] = {
 #define PARTITION_FAT16_LBA_H  (PARTITION_FAT16_LBA    | PART_FLAG_HIDDEN)
 
 #define PARTITION_COMPAQ_DIAG  0x12
+#define PARTITION_MSFT_RECOVERY        0x27
 #define PARTITION_LDM          0x42
 #define PARTITION_LINUX_SWAP   0x82
 #define PARTITION_LINUX                0x83
@@ -830,6 +831,7 @@ raw_part_parse (const PedDisk* disk, const DosRawPartition* 
raw_part,
        dos_data->system = raw_part->type;
        dos_data->boot = raw_part->boot_ind != 0;
        dos_data->diag = raw_part->type == PARTITION_COMPAQ_DIAG ||
+                        raw_part->type == PARTITION_MSFT_RECOVERY ||
                         raw_part->type == PARTITION_DELL_DIAG;
        dos_data->hidden = raw_part_is_hidden (raw_part);
        dos_data->raid = raw_part->type == PARTITION_LINUX_RAID;
@@ -1334,6 +1336,7 @@ msdos_partition_set_system (PedPartition* part,
                /* Don't change the system if it already is a diag type,
                   otherwise use Compaq as almost all vendors use that. */
                if (dos_data->system != PARTITION_COMPAQ_DIAG &&
+                   dos_data->system != PARTITION_MSFT_RECOVERY &&
                    dos_data->system != PARTITION_DELL_DIAG)
                        dos_data->system = PARTITION_COMPAQ_DIAG;
                return 1;
-- 
1.7.0.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]