[Parted-commits] GNU Parted Official Repository: Changes to 'master'

Jim Meyering meyering at alioth.debian.org
Thu May 6 13:49:02 UTC 2010


 NEWS                   |    4 ++--
 bootstrap              |   12 ++++++------
 libparted/labels/dos.c |    3 +++
 libparted/labels/gpt.c |   39 +++++++++++++++++++++++++++++++++++++--
 4 files changed, 48 insertions(+), 10 deletions(-)

New commits:
commit 48da38ed7c0b8dd38c2458445e51dbb74bd183f2
Author: Jim Meyering <meyering at redhat.com>
Date:   Thu May 6 15:20:00 2010 +0200

    maint: use latest bootstrap script from gnulib
    
    * bootstrap: Sync from gnulib.

diff --git a/bootstrap b/bootstrap
index bf163c7..a9a778a 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Print a version string.
-scriptversion=2010-02-25.16; # UTC
+scriptversion=2010-04-30.16; # UTC
 
 # Bootstrap this package from checked-out sources.
 
@@ -424,7 +424,7 @@ case ${GNULIB_SRCDIR--} in
 
     trap cleanup_gnulib 1 2 13 15
 
-    git clone --help|grep depth > /dev/null && shallow='--depth 2' || shallow=
+    git clone -h|grep -- --depth > /dev/null && shallow='--depth 2' || shallow=
     git clone $shallow git://git.sv.gnu.org/gnulib "$gnulib_path" ||
       cleanup_gnulib
 
@@ -437,7 +437,7 @@ case ${GNULIB_SRCDIR--} in
   if test -d "$GNULIB_SRCDIR"/.git && \
         git_modules_config submodule.gnulib.url >/dev/null; then
     echo "$0: getting gnulib files..."
-    if git submodule --help|grep reference > /dev/null; then
+    if git submodule -h|grep -- --reference > /dev/null; then
       # Prefer the one-liner available in git 1.6.4 or newer.
       git submodule update --init --reference "$GNULIB_SRCDIR" \
         "$gnulib_path" || exit $?
@@ -488,7 +488,7 @@ update_po_files() {
   test -d $ref_po_dir || mkdir $ref_po_dir || return
   download_po_files $ref_po_dir $domain \
     && ls "$ref_po_dir"/*.po 2>/dev/null |
-      sed 's|.*/||; s|\.po$||' > "$po_dir/LINGUAS"
+      sed 's|.*/||; s|\.po$||' > "$po_dir/LINGUAS" || return
 
   langs=`cd $ref_po_dir && echo *.po|sed 's/\.po//g'`
   test "$langs" = '*' && langs=x
@@ -819,7 +819,7 @@ if test $with_gettext = yes; then
       a\
           '"$XGETTEXT_OPTIONS"' $${end_of_xgettext_options+}
     }
-  ' po/Makevars.template >po/Makevars
+  ' po/Makevars.template >po/Makevars || exit 1
 
   if test -d runtime-po; then
     # Similarly for runtime-po/Makevars, but not quite the same.
@@ -833,7 +833,7 @@ if test $with_gettext = yes; then
         a\
             '"$XGETTEXT_OPTIONS_RUNTIME"' $${end_of_xgettext_options+}
       }
-    ' <po/Makevars.template >runtime-po/Makevars
+    ' po/Makevars.template >runtime-po/Makevars || exit 1
 
     # Copy identical files from po to runtime-po.
     (cd po && cp -p Makefile.in.in *-quot *.header *.sed *.sin ../runtime-po)

commit e9f5f716deb064e686c796c4f4a7bb9da0f6bf7e
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Thu May 6 15:09:35 2010 +0200

    gpt: recognize microsoft recovery GUID
    
    Microsoft advices creating recovery partitions with a GUID of
    de94bba4-06d1-4d40-a16a-bfd50179d6ac, see:
    http://technet.microsoft.com/en-us/library/dd744301%28WS.10%29.aspx
    
    This patch makes parted recognize this guid (using the DIAG flag).
    * libparted/labels/gpt.c (PARTITION_MSFT_RECOVERY, GPTPartitionData,
    _parse_part_entry, gpt_partition_new, gpt_partition_set_system,
    gpt_partition_set_flag, gpt_partition_get_flag,
    gpt_partition_is_flag_available): Support microsoft recovery GUID.
    * NEWS (New features): Add it.

diff --git a/NEWS b/NEWS
index addfe2e..90de462 100644
--- a/NEWS
+++ b/NEWS
@@ -8,8 +8,8 @@ GNU parted NEWS                                    -*- outline -*-
 
   parted now recognizes Linux Software RAID Arrays
 
-  libparted has a new partition flag to check for msdos disklabel diagnostics
-  partitions: PED_PARTITION_DIAG
+  libparted has a new partition flag to check for diagnostic (aka recovery
+  or reserved) partitions: PED_PARTITION_DIAG
 
 ** Bug fixes
 
diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c
index 4793315..4aedd6d 100644
--- a/libparted/labels/gpt.c
+++ b/libparted/labels/gpt.c
@@ -103,6 +103,10 @@ typedef struct
     ((efi_guid_t) { PED_CPU_TO_LE32 (0xE3C9E316), PED_CPU_TO_LE16 (0x0B5C), \
                     PED_CPU_TO_LE16 (0x4DB8), 0x81, 0x7D, \
                     { 0xF9, 0x2D, 0xF0, 0x02, 0x15, 0xAE }})
+#define PARTITION_MSFT_RECOVERY \
+    ((efi_guid_t) { PED_CPU_TO_LE32 (0xDE94BBA4), PED_CPU_TO_LE16 (0x06D1), \
+                    PED_CPU_TO_LE16 (0x4D40), 0xA1, 0x6A, \
+                    { 0xBF, 0xD5, 0x01, 0x79, 0xD6, 0xAC }})
 #define PARTITION_BASIC_DATA_GUID \
     ((efi_guid_t) { PED_CPU_TO_LE32 (0xEBD0A0A2), PED_CPU_TO_LE16 (0xB9E5), \
                     PED_CPU_TO_LE16 (0x4433), 0x87, 0xC0, \
@@ -269,6 +273,7 @@ typedef struct _GPTPartitionData
   int hidden;
   int msftres;
   int atvrecv;
+  int msftrecv;
 } GPTPartitionData;
 
 static PedDiskType gpt_disk_type;
@@ -773,6 +778,7 @@ _parse_part_entry (PedDisk *disk, GuidPartitionEntry_t *pte)
   gpt_part_data->lvm = gpt_part_data->raid
     = gpt_part_data->boot = gpt_part_data->hp_service
     = gpt_part_data->hidden = gpt_part_data->msftres
+    = gpt_part_data->msftrecv
     = gpt_part_data->bios_grub = gpt_part_data->atvrecv = 0;
 
   if (pte->Attributes.RequiredToFunction & 0x1)
@@ -790,6 +796,8 @@ _parse_part_entry (PedDisk *disk, GuidPartitionEntry_t *pte)
     gpt_part_data->hp_service = 1;
   else if (!guid_cmp (gpt_part_data->type, PARTITION_MSFT_RESERVED_GUID))
     gpt_part_data->msftres = 1;
+  else if (!guid_cmp (gpt_part_data->type, PARTITION_MSFT_RECOVERY))
+    gpt_part_data->msftrecv = 1;
   else if (!guid_cmp (gpt_part_data->type, PARTITION_APPLE_TV_RECOVERY_GUID))
     gpt_part_data->atvrecv = 1;
 
@@ -1291,6 +1299,7 @@ gpt_partition_new (const PedDisk *disk,
   gpt_part_data->hp_service = 0;
   gpt_part_data->hidden = 0;
   gpt_part_data->msftres = 0;
+  gpt_part_data->msftrecv = 0;
   gpt_part_data->atvrecv = 0;
   uuid_generate ((unsigned char *) &gpt_part_data->uuid);
   swap_uuid_and_efi_guid ((unsigned char *) (&gpt_part_data->uuid));
@@ -1387,6 +1396,11 @@ gpt_partition_set_system (PedPartition *part,
       gpt_part_data->type = PARTITION_MSFT_RESERVED_GUID;
       return 1;
     }
+  if (gpt_part_data->msftrecv)
+    {
+      gpt_part_data->type = PARTITION_MSFT_RECOVERY;
+      return 1;
+    }
   if (gpt_part_data->atvrecv)
     {
       gpt_part_data->type = PARTITION_APPLE_TV_RECOVERY_GUID;
@@ -1491,6 +1505,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state)
           = gpt_part_data->bios_grub
           = gpt_part_data->hp_service
           = gpt_part_data->msftres
+          = gpt_part_data->msftrecv
           = gpt_part_data->atvrecv = 0;
       return gpt_partition_set_system (part, part->fs_type);
     case PED_PARTITION_BIOS_GRUB:
@@ -1501,6 +1516,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state)
           = gpt_part_data->boot
           = gpt_part_data->hp_service
           = gpt_part_data->msftres
+          = gpt_part_data->msftrecv
           = gpt_part_data->atvrecv = 0;
       return gpt_partition_set_system (part, part->fs_type);
     case PED_PARTITION_RAID:
@@ -1511,6 +1527,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state)
           = gpt_part_data->bios_grub
           = gpt_part_data->hp_service
           = gpt_part_data->msftres
+          = gpt_part_data->msftrecv
           = gpt_part_data->atvrecv = 0;
       return gpt_partition_set_system (part, part->fs_type);
     case PED_PARTITION_LVM:
@@ -1521,6 +1538,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state)
           = gpt_part_data->bios_grub
           = gpt_part_data->hp_service
           = gpt_part_data->msftres
+          = gpt_part_data->msftrecv
           = gpt_part_data->atvrecv = 0;
       return gpt_partition_set_system (part, part->fs_type);
     case PED_PARTITION_HPSERVICE:
@@ -1531,6 +1549,7 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state)
           = gpt_part_data->lvm
           = gpt_part_data->bios_grub
           = gpt_part_data->msftres
+          = gpt_part_data->msftrecv
           = gpt_part_data->atvrecv = 0;
       return gpt_partition_set_system (part, part->fs_type);
     case PED_PARTITION_MSFT_RESERVED:
@@ -1541,6 +1560,18 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state)
           = gpt_part_data->lvm
           = gpt_part_data->bios_grub
           = gpt_part_data->hp_service
+          = gpt_part_data->msftrecv
+          = gpt_part_data->atvrecv = 0;
+      return gpt_partition_set_system (part, part->fs_type);
+    case PED_PARTITION_DIAG:
+      gpt_part_data->msftrecv = state;
+      if (state)
+        gpt_part_data->boot
+          = gpt_part_data->raid
+          = gpt_part_data->lvm
+          = gpt_part_data->bios_grub
+          = gpt_part_data->hp_service
+          = gpt_part_data->msftres
           = gpt_part_data->atvrecv = 0;
       return gpt_partition_set_system (part, part->fs_type);
     case PED_PARTITION_APPLE_TV_RECOVERY:
@@ -1551,7 +1582,8 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state)
           = gpt_part_data->lvm
           = gpt_part_data->bios_grub
           = gpt_part_data->hp_service
-          = gpt_part_data->msftres = 0;
+          = gpt_part_data->msftres
+          = gpt_part_data->msftrecv = 0;
       return gpt_partition_set_system (part, part->fs_type);
     case PED_PARTITION_HIDDEN:
       gpt_part_data->hidden = state;
@@ -1586,7 +1618,9 @@ gpt_partition_get_flag (const PedPartition *part, PedPartitionFlag flag)
       return gpt_part_data->hp_service;
     case PED_PARTITION_MSFT_RESERVED:
       return gpt_part_data->msftres;
-   case PED_PARTITION_APPLE_TV_RECOVERY:
+    case PED_PARTITION_DIAG:
+      return gpt_part_data->msftrecv;
+    case PED_PARTITION_APPLE_TV_RECOVERY:
       return gpt_part_data->atvrecv;
     case PED_PARTITION_HIDDEN:
       return gpt_part_data->hidden;
@@ -1611,6 +1645,7 @@ gpt_partition_is_flag_available (const PedPartition *part,
     case PED_PARTITION_BIOS_GRUB:
     case PED_PARTITION_HPSERVICE:
     case PED_PARTITION_MSFT_RESERVED:
+    case PED_PARTITION_DIAG:
     case PED_PARTITION_APPLE_TV_RECOVERY:
     case PED_PARTITION_HIDDEN:
       return 1;

commit b1c20d70f4ef351a757f7be52d61e067f02b7f89
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Thu May 6 10:25:35 2010 +0200

    msdos: recognize id 27 as a diagnostics (recovery) partition type
    
    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): Define.
    (raw_part_parse): Recognize id 27
    (msdos_partition_set_system): Recognize id 27

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;



More information about the Parted-commits mailing list