From a2fe9262bf5480f091d81befa04c452c86f5f2bb Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 20 Jul 2010 10:09:23 +0000 Subject: [PATCH] - Rebase to new upstream 2.3 release - Drop all patches (all upstreamed) - Recognize scsi disks with a high major as such (#611691) --- .cvsignore | 3 +- parted-2.2-add-diag-flag-rh583626.patch | 213 ----------------- parted-2.2-blkoflow-rh585159.patch | 25 -- parted-2.2-dm_task_run-retcode-rh585158.patch | 91 -------- parted-2.2-extend-diag-flag-rh589451.patch | 217 ------------------ parted-2.2-hi-major-sd-rh611691.patch | 28 +++ parted-dev-mapper-symlink-rh577824.patch | 40 ---- parted.spec | 29 +-- sources | 3 +- 9 files changed, 44 insertions(+), 605 deletions(-) delete mode 100644 parted-2.2-add-diag-flag-rh583626.patch delete mode 100644 parted-2.2-blkoflow-rh585159.patch delete mode 100644 parted-2.2-dm_task_run-retcode-rh585158.patch delete mode 100644 parted-2.2-extend-diag-flag-rh589451.patch create mode 100644 parted-2.2-hi-major-sd-rh611691.patch delete mode 100644 parted-dev-mapper-symlink-rh577824.patch diff --git a/.cvsignore b/.cvsignore index abdbfee..388f948 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1,2 @@ -parted-2.2.tar.xz +parted-2.3.tar.xz +parted-2.3.tar.xz.sig diff --git a/parted-2.2-add-diag-flag-rh583626.patch b/parted-2.2-add-diag-flag-rh583626.patch deleted file mode 100644 index c3534f6..0000000 --- a/parted-2.2-add-diag-flag-rh583626.patch +++ /dev/null @@ -1,213 +0,0 @@ -From 0b5140a3400e41b91c5279ab9432cff86bcb2a86 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Mon, 19 Apr 2010 13:45:45 +0200 -Subject: [PATCH parted 1/2] dos: Add a partition flag for diagnostics / recovery partitions - -msdos partition tables can contain diagnostics partitions (often used -now a days as system recovery partitions). For some users of libparted -(ie anaconda) it is usefull to know if a dos partition is a regular partition -or a diagnostic partition (see rh bug 534066). - -* include/parted/disk.h(_PedPartitionFlag): Add PED_PARTITION_DIAG -* libparted/disk.c(ped_partition_flag_get_name): Add PED_PARTITION_DIAG -* libparted/labels/dos.c: Add support for PED_PARTITION_DIAG flag ---- - include/parted/disk.h | 5 +++-- - libparted/disk.c | 2 ++ - libparted/labels/dos.c | 33 +++++++++++++++++++++++++++++++++ - 4 files changed, 41 insertions(+), 2 deletions(-) - -diff --git a/include/parted/disk.h b/include/parted/disk.h -index dea4d19..f11e393 100644 ---- a/include/parted/disk.h -+++ b/include/parted/disk.h -@@ -68,10 +68,11 @@ enum _PedPartitionFlag { - PED_PARTITION_PREP=10, - PED_PARTITION_MSFT_RESERVED=11, - PED_PARTITION_BIOS_GRUB=12, -- PED_PARTITION_APPLE_TV_RECOVERY=13 -+ PED_PARTITION_APPLE_TV_RECOVERY=13, -+ PED_PARTITION_DIAG=14 - }; - #define PED_PARTITION_FIRST_FLAG PED_PARTITION_BOOT --#define PED_PARTITION_LAST_FLAG PED_PARTITION_APPLE_TV_RECOVERY -+#define PED_PARTITION_LAST_FLAG PED_PARTITION_DIAG - - enum _PedDiskTypeFeature { - PED_DISK_TYPE_EXTENDED=1, /**< supports extended partitions */ -diff --git a/libparted/disk.c b/libparted/disk.c -index f4c0d74..7a60a09 100644 ---- a/libparted/disk.c -+++ b/libparted/disk.c -@@ -2441,6 +2441,8 @@ ped_partition_flag_get_name (PedPartitionFlag flag) - return N_("msftres"); - case PED_PARTITION_APPLE_TV_RECOVERY: - return N_("atvrecv"); -+ case PED_PARTITION_DIAG: -+ return N_("diag"); - - default: - ped_exception_throw ( -diff --git a/libparted/labels/dos.c b/libparted/labels/dos.c -index 6fb4aef..17209da 100644 ---- a/libparted/labels/dos.c -+++ b/libparted/labels/dos.c -@@ -157,6 +157,7 @@ typedef struct { - int lba; - int palo; - int prep; -+ int diag; - OrigState* orig; /* used for CHS stuff */ - } DosPartitionData; - -@@ -835,6 +836,8 @@ raw_part_parse (const PedDisk* disk, const DosRawPartition* raw_part, - dos_data->lba = raw_part_is_lba (raw_part); - dos_data->palo = raw_part->type == PARTITION_PALO; - dos_data->prep = raw_part->type == PARTITION_PREP; -+ dos_data->diag = raw_part->type == PARTITION_COMPAQ_DIAG || -+ raw_part->type == PARTITION_DELL_DIAG; - dos_data->orig = ped_malloc (sizeof (OrigState)); - if (!dos_data->orig) { - ped_partition_destroy (part); -@@ -1236,6 +1239,7 @@ msdos_partition_new (const PedDisk* disk, PedPartitionType part_type, - dos_data->lba = 0; - dos_data->palo = 0; - dos_data->prep = 0; -+ dos_data->diag = 0; - } else { - part->disk_specific = NULL; - } -@@ -1270,6 +1274,7 @@ msdos_partition_duplicate (const PedPartition* part) - new_dos_data->lba = old_dos_data->lba; - new_dos_data->palo = old_dos_data->palo; - new_dos_data->prep = old_dos_data->prep; -+ new_dos_data->diag = old_dos_data->diag; - - if (old_dos_data->orig) { - new_dos_data->orig = ped_malloc (sizeof (OrigState)); -@@ -1317,6 +1322,7 @@ msdos_partition_set_system (PedPartition* part, - dos_data->lvm = 0; - dos_data->palo = 0; - dos_data->prep = 0; -+ dos_data->diag = 0; - if (dos_data->lba) - dos_data->system = PARTITION_EXT_LBA; - else -@@ -1340,6 +1346,14 @@ msdos_partition_set_system (PedPartition* part, - dos_data->system = PARTITION_PREP; - return 1; - } -+ if (dos_data->diag) { -+ /* 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_DELL_DIAG) -+ dos_data->system = PARTITION_COMPAQ_DIAG; -+ return 1; -+ } - - if (!fs_type) - dos_data->system = PARTITION_LINUX; -@@ -1415,6 +1429,7 @@ msdos_partition_set_flag (PedPartition* part, - dos_data->lvm = 0; - dos_data->palo = 0; - dos_data->prep = 0; -+ dos_data->diag = 0; - } - dos_data->raid = state; - return ped_partition_set_system (part, part->fs_type); -@@ -1425,6 +1440,7 @@ msdos_partition_set_flag (PedPartition* part, - dos_data->raid = 0; - dos_data->palo = 0; - dos_data->prep = 0; -+ dos_data->diag = 0; - } - dos_data->lvm = state; - return ped_partition_set_system (part, part->fs_type); -@@ -1438,6 +1454,7 @@ msdos_partition_set_flag (PedPartition* part, - dos_data->hidden = 0; - dos_data->raid = 0; - dos_data->lvm = 0; -+ dos_data->diag = 0; - } - dos_data->palo = state; - return ped_partition_set_system (part, part->fs_type); -@@ -1447,10 +1464,22 @@ msdos_partition_set_flag (PedPartition* part, - dos_data->hidden = 0; - dos_data->raid = 0; - dos_data->lvm = 0; -+ dos_data->diag = 0; - } - dos_data->prep = state; - return ped_partition_set_system (part, part->fs_type); - -+ case PED_PARTITION_DIAG: -+ if (state) { -+ dos_data->hidden = 0; -+ dos_data->raid = 0; -+ dos_data->lvm = 0; -+ dos_data->palo = 0; -+ dos_data->prep = 0; -+ } -+ dos_data->diag = state; -+ return ped_partition_set_system (part, part->fs_type); -+ - default: - return 0; - } -@@ -1490,6 +1519,9 @@ msdos_partition_get_flag (const PedPartition* part, PedPartitionFlag flag) - case PED_PARTITION_PREP: - return dos_data->prep; - -+ case PED_PARTITION_DIAG: -+ return dos_data->diag; -+ - default: - return 0; - } -@@ -1512,6 +1544,7 @@ msdos_partition_is_flag_available (const PedPartition* part, - case PED_PARTITION_LBA: - case PED_PARTITION_PALO: - case PED_PARTITION_PREP: -+ case PED_PARTITION_DIAG: - return 1; - - default: --- -1.7.0.1 - -From f6def89ad61f2c13d344763137e551adf6a23526 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Mon, 19 Apr 2010 13:51:27 +0200 -Subject: [PATCH parted 2/2] dos: Fix prep / palo flag handling - -Setting the prep flag was not clearing the palo flag and vica versa -* libparted/labels/dos.c(msdos_partition_set_flag): Fix prep / palo -flag handling. ---- - libparted/labels/dos.c | 2 ++ - 1 files changed, 2 insertions(+), 0 deletions(-) - -diff --git a/libparted/labels/dos.c b/libparted/labels/dos.c -index 17209da..c0190a1 100644 ---- a/libparted/labels/dos.c -+++ b/libparted/labels/dos.c -@@ -1454,6 +1454,7 @@ msdos_partition_set_flag (PedPartition* part, - dos_data->hidden = 0; - dos_data->raid = 0; - dos_data->lvm = 0; -+ dos_data->prep = 0; - dos_data->diag = 0; - } - dos_data->palo = state; -@@ -1464,6 +1465,7 @@ msdos_partition_set_flag (PedPartition* part, - dos_data->hidden = 0; - dos_data->raid = 0; - dos_data->lvm = 0; -+ dos_data->palo = 0; - dos_data->diag = 0; - } - dos_data->prep = state; --- -1.7.0.1 - diff --git a/parted-2.2-blkoflow-rh585159.patch b/parted-2.2-blkoflow-rh585159.patch deleted file mode 100644 index a6031de..0000000 --- a/parted-2.2-blkoflow-rh585159.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -up parted-1.8.1/libparted/fs/ext2/parted_io.c.blkoflow parted-1.8.1/libparted/fs/ext2/parted_io.c ---- parted-1.8.1/libparted/fs/ext2/parted_io.c.blkoflow 2006-12-03 22:27:47.000000000 +0000 -+++ parted-1.8.1/libparted/fs/ext2/parted_io.c 2010-04-20 15:55:06.000000000 +0100 -@@ -82,7 +82,9 @@ static int do_read(void *cookie, void *p - { - struct my_cookie *monster = cookie; - -- return ped_geometry_read(monster->geom, ptr, block << (monster->logsize - 9), num << (monster->logsize - 9)); -+ return ped_geometry_read(monster->geom, ptr, -+ (PedSector)block << (monster->logsize - 9), -+ (PedSector)num << (monster->logsize - 9)); - } - - static int do_set_blocksize(void *cookie, int logsize) -@@ -98,8 +100,8 @@ static int do_write(void *cookie, void * - struct my_cookie *monster = cookie; - - return ped_geometry_write(monster->geom, ptr, -- block << (monster->logsize - 9), -- num << (monster->logsize - 9)); -+ (PedSector)block << (monster->logsize - 9), -+ (PedSector)num << (monster->logsize - 9)); - } - - diff --git a/parted-2.2-dm_task_run-retcode-rh585158.patch b/parted-2.2-dm_task_run-retcode-rh585158.patch deleted file mode 100644 index 3eb2808..0000000 --- a/parted-2.2-dm_task_run-retcode-rh585158.patch +++ /dev/null @@ -1,91 +0,0 @@ -From e20825c9f78c1ef69b71e574c46e3833b16b8e08 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Fri, 23 Apr 2010 12:13:53 +0200 -Subject: [PATCH parted] linux: dm_task_run returns 0 on error - -We were checking for a return value of < 0 for dm_task_run errors, but -dm_task_run returns 0 on error (and 1 on success). Thanks to Joe Jin -for spotting this, see Red Hat bug 582907. - -* libparted/arch/linux.c(_dm_remove_map_name, _dm_is_part, -_dm_remove_parts, _dm_add_partition): dm_task_run returns 0 on error. ---- - libparted/arch/linux.c | 19 +++++-------------- - 1 files changed, 5 insertions(+), 14 deletions(-) - -diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c -index 85cf813..d7ec2e4 100644 ---- a/libparted/arch/linux.c -+++ b/libparted/arch/linux.c -@@ -2321,7 +2321,7 @@ _dm_remove_map_name(char *name) - rc = dm_task_run(task); - dm_task_update_nodes(); - dm_task_destroy(task); -- if (rc < 0) -+ if (!rc) - return 1; - - return 0; -@@ -2341,12 +2341,8 @@ _dm_is_part (struct dm_info *this, char *name) - return 0; - - dm_task_set_name(task, name); -- rc = dm_task_run(task); -- if (rc < 0) { -- rc = 0; -+ if (!dm_task_run(task)) - goto err; -- } -- rc = 0; - - memset(info, '\0', sizeof *info); - dm_task_get_info(task, info); -@@ -2357,7 +2353,6 @@ _dm_is_part (struct dm_info *this, char *name) - if (!deps) - goto err; - -- rc = 0; - for (i = 0; i < deps->count; i++) { - unsigned int ma = major(deps->device[i]), - mi = minor(deps->device[i]); -@@ -2389,8 +2384,7 @@ _dm_remove_parts (PedDevice* dev) - arch_specific->minor, 0)) - goto err; - -- rc = dm_task_run(task); -- if (rc < 0) -+ if (!dm_task_run(task)) - goto err; - - memset(info, '\0', sizeof *info); -@@ -2432,7 +2426,6 @@ err: - static int - _dm_add_partition (PedDisk* disk, PedPartition* part) - { -- int rc; - char* vol_name = NULL; - const char* dev_name = NULL; - char* params = NULL; -@@ -2450,8 +2443,7 @@ _dm_add_partition (PedDisk* disk, PedPartition* part) - arch_specific->minor, 0)) - goto err; - -- rc = dm_task_run(task); -- if (rc < 0) -+ if (!dm_task_run(task)) - goto err; - - dev_name = dm_task_get_name (task); -@@ -2474,8 +2466,7 @@ _dm_add_partition (PedDisk* disk, PedPartition* part) - dm_task_set_name (task, vol_name); - dm_task_add_target (task, 0, part->geom.length, - "linear", params); -- rc = dm_task_run (task); -- if (rc >= 0) { -+ if (dm_task_run (task)) { - //printf("0 %ld linear %s\n", part->geom.length, params); - dm_task_update_nodes(); - dm_task_destroy(task); --- -1.7.0.1 - diff --git a/parted-2.2-extend-diag-flag-rh589451.patch b/parted-2.2-extend-diag-flag-rh589451.patch deleted file mode 100644 index bdfc9d4..0000000 --- a/parted-2.2-extend-diag-flag-rh589451.patch +++ /dev/null @@ -1,217 +0,0 @@ -From 72a58fb27c71a8f74fd31c4ca734536e20ac7918 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Thu, 6 May 2010 09:54:45 +0200 -Subject: [PATCH parted 1/2] msdos: recognize id 27 as a diagnostics (recovery) partition - -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 -@@ -837,6 +838,7 @@ raw_part_parse (const PedDisk* disk, con - dos_data->palo = raw_part->type == PARTITION_PALO; - dos_data->prep = raw_part->type == PARTITION_PREP; - dos_data->diag = raw_part->type == PARTITION_COMPAQ_DIAG || -+ raw_part->type == PARTITION_MSFT_RECOVERY || - raw_part->type == PARTITION_DELL_DIAG; - dos_data->orig = ped_malloc (sizeof (OrigState)); - if (!dos_data->orig) { -@@ -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 - -From 042f7dae4b95681cc613b4aad7c0339e2eef0bbe Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Thu, 6 May 2010 10:10:03 +0200 -Subject: [PATCH parted 2/2] 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 ---- - libparted/labels/gpt.c | 39 +++++++++++++++++++++++++++++++++++++-- - 1 files changed, 39 insertions(+), 4 deletions(-) - -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; --- -1.7.0.1 - diff --git a/parted-2.2-hi-major-sd-rh611691.patch b/parted-2.2-hi-major-sd-rh611691.patch new file mode 100644 index 0000000..9a05eed --- /dev/null +++ b/parted-2.2-hi-major-sd-rh611691.patch @@ -0,0 +1,28 @@ +diff -up parted-2.1/libparted/arch/linux.c.original parted-2.1/libparted/arch/linux.c +--- parted-2.1/libparted/arch/linux.c.original 2010-07-06 15:05:19.921823935 +0900 ++++ parted-2.1/libparted/arch/linux.c 2010-07-06 16:42:16.420762063 +0900 +@@ -221,6 +221,14 @@ struct blkdev_ioctl_param { + #define SCSI_DISK5_MAJOR 69 + #define SCSI_DISK6_MAJOR 70 + #define SCSI_DISK7_MAJOR 71 ++#define SCSI_DISK8_MAJOR 128 ++#define SCSI_DISK9_MAJOR 129 ++#define SCSI_DISK10_MAJOR 130 ++#define SCSI_DISK11_MAJOR 131 ++#define SCSI_DISK12_MAJOR 132 ++#define SCSI_DISK13_MAJOR 133 ++#define SCSI_DISK14_MAJOR 134 ++#define SCSI_DISK15_MAJOR 135 + #define COMPAQ_SMART2_MAJOR 72 + #define COMPAQ_SMART2_MAJOR1 73 + #define COMPAQ_SMART2_MAJOR2 74 +@@ -259,7 +267,8 @@ struct blkdev_ioctl_param { + #define SCSI_BLK_MAJOR(M) ( \ + (M) == SCSI_DISK0_MAJOR \ + || (M) == SCSI_CDROM_MAJOR \ +- || ((M) >= SCSI_DISK1_MAJOR && (M) <= SCSI_DISK7_MAJOR)) ++ || ((M) >= SCSI_DISK1_MAJOR && (M) <= SCSI_DISK7_MAJOR) \ ++ || ((M) >= SCSI_DISK8_MAJOR && (M) <= SCSI_DISK15_MAJOR)) + + /* Maximum number of partitions supported by linux. */ + #define MAX_NUM_PARTS 64 diff --git a/parted-dev-mapper-symlink-rh577824.patch b/parted-dev-mapper-symlink-rh577824.patch deleted file mode 100644 index 76f6381..0000000 --- a/parted-dev-mapper-symlink-rh577824.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 70352b39e16f881b915b06440331acf47bcef984 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Tue, 6 Apr 2010 15:02:09 +0200 -Subject: [PATCH parted] libparted: Don't canonicalize /dev/mapper paths - -Besides fixing the issue displayed by libparted/tests/symlink.c, -this has the added advantage that the output of parted p on one of these -devices now says: -"Disk /dev/mapper/BigVol2-lv_iscsi_disk2: 34.4GB" - -Which is a lot more user friendly then the output before this patch: -"Disk /dev/dm-6: 34.4GB" - -* libparted/device.c: Don't canonicalize /dev/mapper paths ---- - libparted/device.c | 6 ++++-- - 1 files changed, 4 insertions(+), 2 deletions(-) - -diff --git a/libparted/device.c b/libparted/device.c -index 0f36a03..64da978 100644 ---- a/libparted/device.c -+++ b/libparted/device.c -@@ -139,10 +139,12 @@ PedDevice* - ped_device_get (const char* path) - { - PedDevice* walk; -- char* normal_path; -+ char* normal_path = NULL; - - PED_ASSERT (path != NULL, return NULL); -- normal_path = canonicalize_file_name (path); -+ /* Don't canonicalize /dev/mapper paths, see tests/symlink.c */ -+ if (strncmp (path, "/dev/mapper/", 12)) -+ normal_path = canonicalize_file_name (path); - if (!normal_path) - /* Well, maybe it is just that the file does not exist. - * Try it anyway. */ --- -1.7.0.1 - diff --git a/parted.spec b/parted.spec index 0f9d50c..9b28d7b 100644 --- a/parted.spec +++ b/parted.spec @@ -3,26 +3,18 @@ Summary: The GNU disk partition manipulation program Name: parted -Version: 2.2 -Release: 5%{?dist} +Version: 2.3 +Release: 1%{?dist} License: GPLv3+ Group: Applications/System URL: http://www.gnu.org/software/parted Source0: ftp://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz +Source1: ftp://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz.sig # All patches are in upstream git -# Don't cache the resolving of /dev/mapper/... symlinks, they may point -# to a different /dev/dm-# by the time we use the cached result. -Patch0: parted-dev-mapper-symlink-rh577824.patch -# Add a partition flag for detecting diagnostics / recovery partitions -Patch1: parted-2.2-add-diag-flag-rh583626.patch -# Properly check dm_task_run return codes -Patch2: parted-2.2-dm_task_run-retcode-rh585158.patch -# Fix mkpartfs (ext2) on partition >2TB -Patch3: parted-2.2-blkoflow-rh585159.patch -# Also recognize recovery partitions with id 27 / on gpt -Patch4: parted-2.2-extend-diag-flag-rh589451.patch +# Recognize scsi disks with a high major as such +Patch0: parted-2.2-hi-major-sd-rh611691.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: e2fsprogs-devel @@ -34,6 +26,7 @@ BuildRequires: device-mapper-devel BuildRequires: libselinux-devel BuildRequires: libuuid-devel BuildRequires: libblkid-devel >= 2.17 +BuildRequires: gnupg2 Requires(post): /sbin/ldconfig Requires(post): /sbin/install-info @@ -62,11 +55,8 @@ Parted library, you need to install this package. %prep %setup -q +gpg --verify %{SOURCE1} %{SOURCE0} %patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 iconv -f ISO-8859-1 -t UTF8 AUTHORS > tmp; touch -r AUTHORS tmp; mv tmp AUTHORS @@ -142,6 +132,11 @@ fi %changelog +* Tue Jul 20 2010 Hans de Goede 2.3-1 +- Rebase to new upstream 2.3 release +- Drop all patches (all upstreamed) +- Recognize scsi disks with a high major as such (#611691) + * Thu May 6 2010 Hans de Goede 2.2-5 - Also recognize recovery partitions with id 27 / on gpt (#589451) diff --git a/sources b/sources index 2eea271..fab6d47 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ -03b1c64e30e3f4feb96947ff4d0b299e parted-2.2.tar.xz +01d93eaaa3f290a17dd9d5dbfc7bb927 parted-2.3.tar.xz +ccc7924b5b2069fa0afd7c86e0df8ed3 parted-2.3.tar.xz.sig