commit 6807ecc80cea15a1eec2277ec24824b52ae7169fc737e4456ea7083393d0e98c Author: Adrian Schröter Date: Fri May 3 17:42:04 2024 +0200 Sync from SUSE:SLFO:Main parted revision dc5588dbfd804708f468eb1571b92f4f diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/baselibs.conf b/baselibs.conf new file mode 100644 index 0000000..b5e964e --- /dev/null +++ b/baselibs.conf @@ -0,0 +1,4 @@ +libparted2 + obsoletes "parted- <= 2.3.10" + provides "parted- = " +libparted-fs-resize0 diff --git a/direct-handling-of-partition-type-id-and-uuid.patch b/direct-handling-of-partition-type-id-and-uuid.patch new file mode 100644 index 0000000..627d901 --- /dev/null +++ b/direct-handling-of-partition-type-id-and-uuid.patch @@ -0,0 +1,557 @@ +From 1d798715b5998cd4afd184beb88ebdbe1a2642e8 Mon Sep 17 00:00:00 2001 +From: Arvin Schnell +Date: Thu, 14 Oct 2021 16:29:06 +0200 +Subject: [PATCH] allow direct handling of partition type id and uuid + +--- + include/parted/disk.in.h | 23 +++++- + libparted/disk.c | 86 ++++++++++++++++++++++ + libparted/labels/dasd.c | 4 ++ + libparted/labels/dos.c | 30 +++++++- + libparted/labels/gpt.c | 40 ++++++++++- + parted/parted.c | 146 +++++++++++++++++++++++++++++++++++++- + tests/t0800-json-gpt.sh | 2 + + tests/t0801-json-msdos.sh | 5 +- + 8 files changed, 329 insertions(+), 7 deletions(-) + +diff --git a/include/parted/disk.in.h b/include/parted/disk.in.h +index 303f59c..d7fde12 100644 +--- a/include/parted/disk.in.h ++++ b/include/parted/disk.in.h +@@ -32,6 +32,7 @@ + */ + #include + #include ++#include + + /** + * Disk flags +@@ -91,9 +92,11 @@ enum _PedPartitionFlag { + PED_DISK_TYPE_EXTENDED=1, /**< supports extended partitions */ + PED_DISK_TYPE_PARTITION_NAME=2, /**< supports partition names */ +- PED_DISK_TYPE_SYSTEM_NAME=4 /**< supports system names */ ++ PED_DISK_TYPE_SYSTEM_NAME=4, /**< supports system names */ ++ PED_DISK_TYPE_PARTITION_TYPE_ID=8, /**< supports partition type-ids */ ++ PED_DISK_TYPE_PARTITION_TYPE_UUID=16, /**< supports partition type-uuids */ + }; + #define PED_DISK_TYPE_FIRST_FEATURE PED_DISK_TYPE_EXTENDED +-#define PED_DISK_TYPE_LAST_FEATURE PED_DISK_TYPE_SYSTEM_NAME ++#define PED_DISK_TYPE_LAST_FEATURE PED_DISK_TYPE_PARTITION_TYPE_UUID + + struct _PedDisk; + struct _PedPartition; +@@ -247,6 +250,13 @@ struct _PedDiskOps { + PedPartitionFlag flag); + void (*partition_set_name) (PedPartition* part, const char* name); + const char* (*partition_get_name) (const PedPartition* part); ++ ++ int (*partition_set_type_id) (PedPartition* part, uint8_t id); ++ uint8_t (*partition_get_type_id) (const PedPartition* part); ++ ++ int (*partition_set_type_uuid) (PedPartition* part, const uint8_t* uuid); ++ uint8_t* (*partition_get_type_uuid) (const PedPartition* part); ++ + int (*partition_align) (PedPartition* part, + const PedConstraint* constraint); + int (*partition_enumerate) (PedPartition* part); +@@ -347,6 +357,10 @@ extern int ped_partition_set_system (PedPartition* part, + extern int ped_partition_set_system_name (PedPartition* part, const char* name); + extern const char* ped_partition_get_name (const PedPartition* part); + extern const char* ped_partition_get_system_name (const PedPartition* part); ++extern int ped_partition_set_type_id (PedPartition* part, uint8_t id); ++extern uint8_t ped_partition_get_type_id (const PedPartition* part); ++extern int ped_partition_set_type_uuid (PedPartition* part, const uint8_t* uuid); ++extern uint8_t* ped_partition_get_type_uuid (const PedPartition* part); + extern int ped_partition_is_busy (const PedPartition* part); + extern char* ped_partition_get_path (const PedPartition* part); + +diff --git a/libparted/disk.c b/libparted/disk.c +index 8496fc0..80f3154 100644 +--- a/libparted/disk.c ++++ b/libparted/disk.c +@@ -1458,6 +1458,36 @@ _assert_partition_name_feature (const PedDiskType* disk_type) + return 1; + } + ++static int ++_assert_partition_type_id_feature (const PedDiskType* disk_type) ++{ ++ if (!ped_disk_type_check_feature ( ++ disk_type, PED_DISK_TYPE_PARTITION_TYPE_ID)) { ++ ped_exception_throw ( ++ PED_EXCEPTION_ERROR, ++ PED_EXCEPTION_CANCEL, ++ "%s disk labels do not support partition type-ids.", ++ disk_type->name); ++ return 0; ++ } ++ return 1; ++} ++ ++static int ++_assert_partition_type_uuid_feature (const PedDiskType* disk_type) ++{ ++ if (!ped_disk_type_check_feature ( ++ disk_type, PED_DISK_TYPE_PARTITION_TYPE_UUID)) { ++ ped_exception_throw ( ++ PED_EXCEPTION_ERROR, ++ PED_EXCEPTION_CANCEL, ++ "%s disk labels do not support partition type-uuids.", ++ disk_type->name); ++ return 0; ++ } ++ return 1; ++} ++ + /** + * Sets the name of a partition. + * +@@ -1510,6 +1540,62 @@ ped_partition_get_name (const PedPartition* part) + return part->disk->type->ops->partition_get_name (part); + } + ++int ++ped_partition_set_type_id (PedPartition *part, uint8_t id) ++{ ++ PED_ASSERT (part != NULL); ++ PED_ASSERT (part->disk != NULL); ++ PED_ASSERT (ped_partition_is_active (part)); ++ ++ if (!_assert_partition_type_id_feature (part->disk->type)) ++ return 0; ++ ++ PED_ASSERT (part->disk->type->ops->partition_set_type_id != NULL); ++ return part->disk->type->ops->partition_set_type_id (part, id); ++} ++ ++uint8_t ++ped_partition_get_type_id (const PedPartition *part) ++{ ++ PED_ASSERT (part != NULL); ++ PED_ASSERT (part->disk != NULL); ++ PED_ASSERT (ped_partition_is_active (part)); ++ ++ if (!_assert_partition_type_id_feature (part->disk->type)) ++ return 0; ++ ++ PED_ASSERT (part->disk->type->ops->partition_set_type_id != NULL); ++ return part->disk->type->ops->partition_get_type_id (part); ++} ++ ++int ++ped_partition_set_type_uuid (PedPartition *part, const uint8_t* uuid) ++{ ++ PED_ASSERT (part != NULL); ++ PED_ASSERT (part->disk != NULL); ++ PED_ASSERT (ped_partition_is_active (part)); ++ ++ if (!_assert_partition_type_uuid_feature (part->disk->type)) ++ return 0; ++ ++ PED_ASSERT (part->disk->type->ops->partition_set_type_uuid != NULL); ++ return part->disk->type->ops->partition_set_type_uuid (part, uuid); ++} ++ ++uint8_t* ++ped_partition_get_type_uuid (const PedPartition *part) ++{ ++ PED_ASSERT (part != NULL); ++ PED_ASSERT (part->disk != NULL); ++ PED_ASSERT (ped_partition_is_active (part)); ++ ++ if (!_assert_partition_type_uuid_feature (part->disk->type)) ++ return NULL; ++ ++ PED_ASSERT (part->disk->type->ops->partition_set_type_uuid != NULL); ++ return part->disk->type->ops->partition_get_type_uuid (part); ++} ++ + /** @} */ + + /** +diff --git a/libparted/labels/dasd.c b/libparted/labels/dasd.c +index 6b0b10d..1747202 100644 +--- a/libparted/labels/dasd.c ++++ b/libparted/labels/dasd.c +@@ -117,6 +117,10 @@ static PedDiskOps dasd_disk_ops = { + + partition_set_name: NULL, + partition_get_name: NULL, ++ partition_set_type_id: NULL, ++ partition_get_type_id: NULL, ++ partition_set_type_uuid: NULL, ++ partition_get_type_uuid: NULL, + disk_set_flag: dasd_disk_set_flag, + disk_get_flag: dasd_disk_get_flag, + disk_is_flag_available: dasd_disk_is_flag_available, +diff --git a/libparted/labels/dos.c b/libparted/labels/dos.c +index b44ccaf..44c8cfc 100644 +--- a/libparted/labels/dos.c ++++ b/libparted/labels/dos.c +@@ -1754,6 +1754,30 @@ msdos_partition_is_flag_available (const PedPartition* part, + } + } + ++ ++int ++msdos_partition_set_type_id (PedPartition *part, uint8_t id) ++{ ++ DosPartitionData *dos_part_data = part->disk_specific; ++ ++ dos_part_data->system = id; ++ ++ // TODO set the correct flag but there is no function for that. better cleanup flags ++ // and use system directly (like in gpt.c) ++ ++ return 1; ++} ++ ++ ++uint8_t _GL_ATTRIBUTE_PURE ++msdos_partition_get_type_id (const PedPartition *part) ++{ ++ const DosPartitionData *dos_part_data = part->disk_specific; ++ ++ return dos_part_data->system; ++} ++ ++ + static PedGeometry* + _try_constraint (const PedPartition* part, const PedConstraint* external, + PedConstraint* internal) +@@ -2590,6 +2614,10 @@ static PedDiskOps msdos_disk_ops = { + + partition_set_name: NULL, + partition_get_name: NULL, ++ partition_set_type_id: msdos_partition_set_type_id, ++ partition_get_type_id: msdos_partition_get_type_id, ++ partition_set_type_uuid: NULL, ++ partition_get_type_uuid: NULL, + + PT_op_function_initializers (msdos) + }; +@@ -2598,7 +2626,7 @@ static PedDiskType msdos_disk_type = { + next: NULL, + name: "msdos", + ops: &msdos_disk_ops, +- features: PED_DISK_TYPE_EXTENDED ++ features: PED_DISK_TYPE_EXTENDED | PED_DISK_TYPE_PARTITION_TYPE_ID + }; + + void +diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c +index c5d7bb3..db18790 100644 +--- a/libparted/labels/gpt.c ++++ b/libparted/labels/gpt.c +@@ -1685,6 +1685,45 @@ gpt_partition_get_name (const PedPartition *part) + return gpt_part_data->translated_name; + } + ++ ++static int ++gpt_partition_set_type_uuid (PedPartition *part, const uint8_t* uuid) ++{ ++ GPTPartitionData *gpt_part_data = part->disk_specific; ++ ++ efi_guid_t* type_uuid = &gpt_part_data->type; ++ memcpy(type_uuid, uuid, sizeof (efi_guid_t)); ++ ++ /* type_uuid is always LE, while uint8_t is always kind of BE */ ++ ++ type_uuid->time_low = PED_SWAP32(type_uuid->time_low); ++ type_uuid->time_mid = PED_SWAP16(type_uuid->time_mid); ++ type_uuid->time_hi_and_version = PED_SWAP16(type_uuid->time_hi_and_version); ++ ++ return 1; ++} ++ ++ ++static uint8_t* ++gpt_partition_get_type_uuid (const PedPartition *part) ++{ ++ const GPTPartitionData *gpt_part_data = part->disk_specific; ++ ++ efi_guid_t type_uuid = gpt_part_data->type; ++ ++ /* type_uuid is always LE, while uint8_t is always kind of BE */ ++ ++ type_uuid.time_low = PED_SWAP32(type_uuid.time_low); ++ type_uuid.time_mid = PED_SWAP16(type_uuid.time_mid); ++ type_uuid.time_hi_and_version = PED_SWAP16(type_uuid.time_hi_and_version); ++ ++ uint8_t* buf = ped_malloc(sizeof (uuid_t)); ++ memcpy(buf, &type_uuid, sizeof (uuid_t)); ++ ++ return buf; ++} ++ ++ + static int + gpt_get_max_primary_partition_count (const PedDisk *disk) + { +@@ -1780,6 +1814,10 @@ static PedDiskOps gpt_disk_ops = + + partition_set_name: gpt_partition_set_name, + partition_get_name: gpt_partition_get_name, ++ partition_set_type_id: NULL, ++ partition_get_type_id: NULL, ++ partition_set_type_uuid: gpt_partition_set_type_uuid, ++ partition_get_type_uuid: gpt_partition_get_type_uuid, + disk_set_flag: gpt_disk_set_flag, + disk_get_flag: gpt_disk_get_flag, + disk_is_flag_available: gpt_disk_is_flag_available, +@@ -1792,7 +1830,7 @@ static PedDiskType gpt_disk_type = + next: NULL, + name: "gpt", + ops: &gpt_disk_ops, +- features: PED_DISK_TYPE_PARTITION_NAME ++ features: PED_DISK_TYPE_PARTITION_NAME | PED_DISK_TYPE_PARTITION_TYPE_UUID + }; + + void +diff --git a/parted/parted.c b/parted/parted.c +index 310f011..f840037 100644 +--- a/parted/parted.c ++++ b/parted/parted.c +@@ -19,6 +19,7 @@ + + #include + #include ++#include + + #include "argmatch.h" + #include "closeout.h" +@@ -174,6 +175,8 @@ static const char* end_msg = N_("END is disk location, such as " + static const char* state_msg = N_("STATE is one of: on, off\n"); + static const char* device_msg = N_("DEVICE is usually /dev/hda or /dev/sda\n"); + static const char* name_msg = N_("NAME is any word you want\n"); ++static const char* type_id_msg = N_("TYPE_ID is a value between 0x01 and 0xff\n"); ++static const char* type_uuid_msg = N_("TYPE_UUID is a non-null uuid\n"); + + static const char* copyright_msg = N_( + "Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n" +@@ -917,6 +920,110 @@ error: + return 0; + } + ++static int ++do_type_id (PedDevice** dev, PedDisk** diskp) ++{ ++ PedPartition* part = NULL; ++ char* input = NULL; ++ ++ if (!*diskp) ++ *diskp = ped_disk_new (*dev); ++ if (!*diskp) ++ goto error; ++ ++ if (!ped_disk_type_check_feature((*diskp)->type, PED_DISK_TYPE_PARTITION_TYPE_ID)) { ++ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL, ++ _("%s disk labels do not support partition type-id."), ++ (*diskp)->type->name); ++ goto error; ++ } ++ ++ if (!command_line_get_partition (_("Partition number?"), *diskp, &part)) ++ goto error; ++ ++ uint8_t type_id = ped_partition_get_type_id (part); ++ ++ static char buf[8]; ++ snprintf(buf, 8, "0x%02x", type_id); ++ ++ input = command_line_get_word (_("Partition type-id?"), buf, NULL, 0); ++ if (!input) ++ goto error; ++ ++ unsigned int tmp = strtol (input, (char**) NULL, 0); ++ if (tmp == 0 || tmp > 0xff) { ++ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL, ++ _("Invalid id.")); ++ goto error; ++ } ++ ++ if (!ped_partition_set_type_id (part, tmp)) ++ goto error_free_input; ++ ++ free (input); ++ ++ if (!ped_disk_commit (*diskp)) ++ goto error; ++ return 1; ++ ++error_free_input: ++ free (input); ++error: ++ return 0; ++} ++ ++static int ++do_type_uuid (PedDevice** dev, PedDisk** diskp) ++{ ++ PedPartition* part = NULL; ++ char* input = NULL; ++ ++ if (!*diskp) ++ *diskp = ped_disk_new (*dev); ++ if (!*diskp) ++ goto error; ++ ++ if (!ped_disk_type_check_feature((*diskp)->type, PED_DISK_TYPE_PARTITION_TYPE_UUID)) { ++ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL, ++ _("%s disk labels do not support partition type-uuid."), ++ (*diskp)->type->name); ++ goto error; ++ } ++ ++ if (!command_line_get_partition (_("Partition number?"), *diskp, &part)) ++ goto error; ++ ++ uint8_t* type_uuid = ped_partition_get_type_uuid (part); ++ static char buf[UUID_STR_LEN]; ++ uuid_unparse_lower (type_uuid, buf); ++ free (type_uuid); ++ ++ input = command_line_get_word (_("Partition type-uuid?"), buf, NULL, 0); ++ if (!input) ++ goto error; ++ ++ uuid_t tmp; ++ if (uuid_parse (input, tmp) != 0 || uuid_is_null (tmp)) { ++ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL, ++ _("Invalid uuid.")); ++ goto error; ++ } ++ ++ if (!ped_partition_set_type_uuid (part, tmp)) ++ goto error_free_input; ++ ++ free (input); ++ ++ if (!ped_disk_commit (*diskp)) ++ goto error; ++ return 1; ++ ++error_free_input: ++ free (input); ++error: ++ return 0; ++} ++ + static char* + partition_print_flags (PedPartition const *part) + { +@@ -1161,6 +1268,8 @@ do_print (PedDevice** dev, PedDisk** diskp) + Table* table; + int has_extended; + int has_name; ++ int has_id; ++ int has_uuid; + int has_devices_arg = 0; + int has_free_arg = 0; + int has_list_arg = 0; +@@ -1270,6 +1379,10 @@ do_print (PedDevice** dev, PedDisk** diskp) + PED_DISK_TYPE_EXTENDED); + has_name = ped_disk_type_check_feature ((*diskp)->type, + PED_DISK_TYPE_PARTITION_NAME); ++ has_id = ped_disk_type_check_feature ((*diskp)->type, ++ PED_DISK_TYPE_PARTITION_TYPE_ID); ++ has_uuid = ped_disk_type_check_feature ((*diskp)->type, ++ PED_DISK_TYPE_PARTITION_TYPE_UUID); + + PedPartition* part; + if (opt_output_mode == HUMAN) { +@@ -1407,6 +1520,21 @@ do_print (PedDevice** dev, PedDisk** diskp) + + if (!(part->type & PED_PARTITION_FREESPACE)) { + ++ if (has_id) { ++ uint8_t type_id = ped_partition_get_type_id (part); ++ static char buf[8]; ++ snprintf(buf, 8, "0x%02x", type_id); ++ ul_jsonwrt_value_s (&json, "type-id", buf); ++ } ++ ++ if (has_uuid) { ++ uint8_t* type_uuid = ped_partition_get_type_uuid (part); ++ static char buf[UUID_STR_LEN]; ++ uuid_unparse_lower (type_uuid, buf); ++ ul_jsonwrt_value_s (&json, "type-uuid", buf); ++ free (type_uuid); ++ } ++ + if (has_name) { + name = ped_partition_get_name (part); + if (strcmp (name, "") != 0) +@@ -2218,6 +2346,22 @@ _("name NUMBER NAME name partition NUMBER as NAME"), + NULL), + str_list_create (_(number_msg), _(name_msg), NULL), 1)); + ++command_register (commands, command_create ( ++ str_list_create_unique ("type-id", _("type-id"), NULL), ++ do_type_id, ++ str_list_create ( ++_("type-id NUMBER TYPE-ID type-id set TYPE-ID of partition NUMBER"), ++NULL), ++ str_list_create (_(number_msg), _(type_id_msg), NULL), 1)); ++ ++command_register (commands, command_create ( ++ str_list_create_unique ("type-uuid", _("type-uuid"), NULL), ++ do_type_uuid, ++ str_list_create ( ++_("type-uuid NUMBER TYPE-UUID type-uuid set TYPE-UUID of partition NUMBER"), ++NULL), ++ str_list_create (_(number_msg), _(type_uuid_msg), NULL), 1)); ++ + command_register (commands, command_create ( + str_list_create_unique ("print", _("print"), NULL), + do_print, +diff --git a/tests/t0800-json-gpt.sh b/tests/t0800-json-gpt.sh +index 8dd1862..354c0bd 100755 +--- a/tests/t0800-json-gpt.sh ++++ b/tests/t0800-json-gpt.sh +@@ -62,6 +62,7 @@ cat < exp || fail=1 + "end": "20479s", + "size": "10240s", + "type": "primary", ++ "type-uuid": "0fc63daf-8483-4772-8e79-3d69d8477de4", + "name": "test1" + },{ + "number": 2, +@@ -69,6 +70,7 @@ cat < exp || fail=1 + "end": "61439s", + "size": "40960s", + "type": "primary", ++ "type-uuid": "a19d880f-05fc-4d3b-a006-743f0f84911e", + "name": "test2", + "flags": [ + "raid" +diff --git a/tests/t0801-json-msdos.sh b/tests/t0801-json-msdos.sh +index a14a5af..c5446d8 100755 +--- a/tests/t0801-json-msdos.sh ++++ b/tests/t0801-json-msdos.sh +@@ -52,13 +52,15 @@ cat < exp || fail=1 + "start": "5.00MiB", + "end": "10.0MiB", + "size": "5.00MiB", +- "type": "primary" ++ "type": "primary", ++ "type-id": "0x83" + },{ + "number": 2, + "start": "10.0MiB", + "end": "30.0MiB", + "size": "20.0MiB", + "type": "extended", ++ "type-id": "0x0f", + "flags": [ + "lba" + ] +@@ -68,6 +70,7 @@ cat < exp || fail=1 + "end": "20.0MiB", + "size": "10.0MiB", + "type": "logical", ++ "type-id": "0x8e", + "flags": [ + "lvm" + ] diff --git a/dummy-bootcode-only-for-x86.patch b/dummy-bootcode-only-for-x86.patch new file mode 100644 index 0000000..85dfedf --- /dev/null +++ b/dummy-bootcode-only-for-x86.patch @@ -0,0 +1,32 @@ +From: Petr Uzel +Subject: parted: dos: Wipe boot code only on x86 +Patch-mainline: no, custom SUSE patch +--- + libparted/labels/dos.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +Index: parted-3.3/libparted/labels/dos.c +=================================================================== +--- parted-3.3.orig/libparted/labels/dos.c ++++ parted-3.3/libparted/labels/dos.c +@@ -1287,6 +1287,12 @@ msdos_write (const PedDisk* disk) + return 0; + DosRawTable *table = (DosRawTable *) s0; + ++/* ++ * Some ARM devices, such as the OMAP3 series, have a buggy boot rom that ++ * simply goes into nirvana if it finds non-0 in the first 4 bytes of the SD ++ * card. ++ */ ++#if defined(__x86_64__) || defined(__i386__) + /* either no bootrecord at all, or AIX IPL signature ... */ + if ( (!table->boot_code[0]) || + ( table->boot_code[0] == (char) 0xc9 && +@@ -1297,6 +1303,7 @@ msdos_write (const PedDisk* disk) + memset (table, 0, 512); + memcpy (table->boot_code, MBR_BOOT_CODE, sizeof (MBR_BOOT_CODE)); + } ++#endif + + /* If there is no unique identifier, generate a random one */ + if (!table->mbr_signature) diff --git a/fatresize-0.1.tar.bz2 b/fatresize-0.1.tar.bz2 new file mode 100644 index 0000000..7e27847 --- /dev/null +++ b/fatresize-0.1.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d38e580c61216f059528c18612d6d80d9e4eb4fea01d3f670877c45aef78150b +size 1542 diff --git a/fatresize-fix-getting-dev-name.patch b/fatresize-fix-getting-dev-name.patch new file mode 100644 index 0000000..5f8f5a1 --- /dev/null +++ b/fatresize-fix-getting-dev-name.patch @@ -0,0 +1,73 @@ +From: Sebastian Parschauer +Date: Sun, 3 Dec 2017 12:09:44 +0100 +Subject: Fix getting the device name from partition name +References: boo#959181 +Patch-mainline: submitted, https://github.com/ya-mouse/fatresize/pull/4 + +There are many partition device names like e.g. /dev/mmcblk0p1 where +it is not enough to trim the trailing digits to get the disk device +name. Using open() here would depend on a POSIX platform. So do it +like _ped_device_probe() and silence libparted exceptions and try +to get the device with ped_device_get(). Trim further trailing +characters until libparted finds it. Print an error and exit if +the partition name is invalid. + +Fixes #2 + +Signed-off-by: Sebastian Parschauer +--- + fatresize/fatresize.c | 29 +++++++++++++++++++++++++++++ + 1 file changed, 29 insertions(+) + +--- a/fatresize/fatresize.c ++++ b/fatresize/fatresize.c +@@ -9,6 +9,7 @@ + #include + #include + ++#include + #include + #include + +@@ -79,6 +80,18 @@ resize(const char* disk_device, int part + } + + ++/* Code parts have been taken from _ped_device_probe(). */ ++static void ++probe_device(PedDevice **dev, const char *path) ++{ ++ ped_exception_fetch_all(); ++ *dev = ped_device_get(path); ++ if (!*dev) ++ ped_exception_catch(); ++ ped_exception_leave_all(); ++} ++ ++ + int + main(int argc, char** argv) + { +@@ -126,6 +139,22 @@ main(int argc, char** argv) + disk_device = strndup(argv[1], pos - argv[1] + 1); + partition_number = strtol(pos + 1, NULL, 10); + ++ PedDevice *peddev = NULL; ++ /* check if the device really exists */ ++ while (pos != argv[1] && *pos != '/' && !peddev) ++ { ++ disk_device[pos - argv[1] + 1] = '\0'; ++ probe_device(&peddev, disk_device); ++ --pos; ++ } ++ if (!peddev) ++ { ++ free(disk_device); ++ fprintf(stderr, "invalid device\n"); ++ exit(EXIT_FAILURE); ++ } ++ ped_device_destroy(peddev); ++ + if (argc == 3) + { + char* endptr = NULL; diff --git a/hfs_fix.dif b/hfs_fix.dif new file mode 100644 index 0000000..6ba17c4 --- /dev/null +++ b/hfs_fix.dif @@ -0,0 +1,31 @@ +--- + libparted/labels/mac.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +Index: parted-3.3/libparted/labels/mac.c +=================================================================== +--- parted-3.3.orig/libparted/labels/mac.c ++++ parted-3.3/libparted/labels/mac.c +@@ -468,7 +468,7 @@ _rawpart_is_void (MacRawPartition* raw_p + return _rawpart_cmp_type (raw_part, "Apple_Void"); + } + +-/* returns 1 if the raw_part represents a partition that is "unused space", or ++/* returns 0 if the raw_part represents a partition that is "unused space", or + * doesn't represent a partition at all. NOTE: some people make Apple_Free + * partitions with MacOS, because they can't select another type. So, if the + * name is anything other than "Extra" or "", it is treated as a "real" +@@ -531,6 +531,13 @@ _rawpart_analyse (MacRawPartition* raw_p + if (!part) + goto error; + ++ /* Check for Apple_Free and set type to PED_PARTITION_FREESPACE */ ++ if (_rawpart_cmp_type (raw_part, "Apple_Free") ++ && (strcmp (raw_part->name, "Extra") == 0)) ++ part->type = PED_PARTITION_FREESPACE; ++ else ++ part->type = PED_PARTITION_NORMAL; ++ + mac_part_data = part->disk_specific; + + strncpy (mac_part_data->volume_name, raw_part->name, 32); diff --git a/libparted-avoid-libdevice-mapper-warnings.patch b/libparted-avoid-libdevice-mapper-warnings.patch new file mode 100644 index 0000000..b80f4a0 --- /dev/null +++ b/libparted-avoid-libdevice-mapper-warnings.patch @@ -0,0 +1,24 @@ +From: Petr Uzel +Subject: libparted: Avoid libdevice-mapper warnings +Patch-mainline: no, custom SUSE patch +--- + libparted/arch/linux.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +Index: parted-3.3/libparted/arch/linux.c +=================================================================== +--- parted-3.3.orig/libparted/arch/linux.c ++++ parted-3.3/libparted/arch/linux.c +@@ -2852,6 +2852,12 @@ _dm_remove_partition(PedDisk* disk, int + goto err; + } + close (fd); ++ /* After we closed the fd, udev starts sniffing it, rendering the device busy for a moment ++ * This is not fatal since we're going to retry anyway, but produces bogus warnings ++ * from libdevice-mapper. ++ * Avoid this by giving udev a moment to release the device ++ */ ++ usleep(100000); + struct dm_task *task = dm_task_create(DM_DEVICE_REMOVE); + if (!task) + goto err; diff --git a/libparted-canonicalize-dev-md-paths.patch b/libparted-canonicalize-dev-md-paths.patch new file mode 100644 index 0000000..8b21a94 --- /dev/null +++ b/libparted-canonicalize-dev-md-paths.patch @@ -0,0 +1,36 @@ +From: Sebastian Parschauer +Date: Mon, 19 Feb 2018 17:45:32 +0100 +Subject: libparted: Canonicalize /dev/md/ paths +References: bsc#1078820 +Patch-mainline: submitted, 2018-02-20 + +The BLKPG* ioctl handling relies on getting the current partitions +from /sys/block/$devname/. With an md name like e.g. "vol0", the +block device to be used cannot be found and the BLKPG* ioctls are +used for all partitions. So canonicalize /dev/md/ paths as well. + +Test: t6100-mdraid-partitions + +Signed-off-by: Sebastian Parschauer +--- + libparted/device.c | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +diff --git a/libparted/device.c b/libparted/device.c +index 36fecd2..2fd3c2f 100644 +--- a/libparted/device.c ++++ b/libparted/device.c +@@ -152,11 +152,8 @@ ped_device_get (const char* path) + char* normal_path = NULL; + + PED_ASSERT (path != NULL); +- /* Don't canonicalize /dev/mapper or /dev/md/ paths, see +- tests/symlink.c +- */ +- if (strncmp (path, "/dev/mapper/", 12) && +- strncmp (path, "/dev/md/", 8)) ++ /* Don't canonicalize /dev/mapper/ paths. */ ++ 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. diff --git a/libparted-dasd-add-swap-flag-handling-for-DASD-CDL.patch b/libparted-dasd-add-swap-flag-handling-for-DASD-CDL.patch new file mode 100644 index 0000000..69debff --- /dev/null +++ b/libparted-dasd-add-swap-flag-handling-for-DASD-CDL.patch @@ -0,0 +1,136 @@ +From: Sebastian Parschauer +Date: Thu, 15 Jun 2017 19:04:41 +0200 +Subject: libparted/dasd: add swap flag handling for DASD-CDL +References: fate#314888, bsc#1044536 +Patch-mainline: no, upstream wants to drop the swap flag + +The way how the linux-swap partition type is handled is not how +fdasd handles it. It is only set if there is a linux-swap file +system set with mkpart or if there is a swap file system created +by mkswap on disk. But we want to know the partition type on disk. + +So introduce a swap flag which behaves like the other flags. The +parted function do_mkpart() sets this flag for us if creating a +partition with FS type name "linux-swap*". + +Signed-off-by: Sebastian Parschauer +--- + libparted/labels/dasd.c | 42 +++++++++++++++++++++++++----------------- + 1 file changed, 25 insertions(+), 17 deletions(-) + +Index: parted-3.3/libparted/labels/dasd.c +=================================================================== +--- parted-3.3.orig/libparted/labels/dasd.c ++++ parted-3.3/libparted/labels/dasd.c +@@ -65,6 +65,7 @@ extern void ped_disk_dasd_done (); + typedef struct { + int type; + int system; ++ int swap; + int raid; + int lvm; + } DasdPartitionData; +@@ -316,6 +317,7 @@ dasd_read (PedDisk* disk) + part->num = 1; + part->fs_type = ped_file_system_probe (&part->geom); + dasd_data = part->disk_specific; ++ dasd_data->swap = 0; + dasd_data->raid = 0; + dasd_data->lvm = 0; + dasd_data->type = 0; +@@ -400,6 +402,7 @@ dasd_read (PedDisk* disk) + part->num = 1; + part->fs_type = ped_file_system_probe (&part->geom); + dasd_data = part->disk_specific; ++ dasd_data->swap = 0; + dasd_data->raid = 0; + dasd_data->lvm = 0; + dasd_data->type = 0; +@@ -457,18 +460,11 @@ dasd_read (PedDisk* disk) + } + + dasd_data = part->disk_specific; ++ dasd_data->swap = !strncmp(PART_TYPE_SWAP, str, 6); + dasd_data->raid = !strncmp(PART_TYPE_RAID, str, 6); + dasd_data->lvm = !strncmp(PART_TYPE_LVM, str, 6); + dasd_partition_set_system(part, part->fs_type); + +- if (strncmp(PART_TYPE_SWAP, str, 6) == 0) { +- fs = ped_file_system_probe(&part->geom); +- if (fs && is_linux_swap(fs->name)) { +- dasd_data->system = PARTITION_LINUX_SWAP; +- PDEBUG; +- } +- } +- + vtoc_ebcdic_enc(p->f1->DS1DSNAM, p->f1->DS1DSNAM, 44); + + dasd_data->type = 0; +@@ -749,14 +745,25 @@ dasd_partition_set_flag (PedPartition* p + dasd_data = part->disk_specific; + + switch (flag) { ++ case PED_PARTITION_SWAP: ++ if (state) { ++ dasd_data->raid = 0; ++ dasd_data->lvm = 0; ++ } ++ dasd_data->swap = state; ++ return ped_partition_set_system(part, part->fs_type); + case PED_PARTITION_RAID: +- if (state) ++ if (state) { ++ dasd_data->swap = 0; + dasd_data->lvm = 0; ++ } + dasd_data->raid = state; + return ped_partition_set_system(part, part->fs_type); + case PED_PARTITION_LVM: +- if (state) ++ if (state) { ++ dasd_data->swap = 0; + dasd_data->raid = 0; ++ } + dasd_data->lvm = state; + return ped_partition_set_system(part, part->fs_type); + default: +@@ -774,6 +781,8 @@ dasd_partition_get_flag (const PedPartit + dasd_data = part->disk_specific; + + switch (flag) { ++ case PED_PARTITION_SWAP: ++ return dasd_data->swap; + case PED_PARTITION_RAID: + return dasd_data->raid; + case PED_PARTITION_LVM: +@@ -802,6 +811,8 @@ dasd_partition_is_flag_available (const + return 0; + + switch (flag) { ++ case PED_PARTITION_SWAP: ++ return 1; + case PED_PARTITION_RAID: + return 1; + case PED_PARTITION_LVM: +@@ -985,17 +996,14 @@ dasd_partition_set_system (PedPartition* + return 1; + } + +- if (!fs_type) { +- dasd_data->system = PARTITION_LINUX; +- PDEBUG; +- } else if (is_linux_swap (fs_type->name)) { ++ if (dasd_data->swap) { + dasd_data->system = PARTITION_LINUX_SWAP; + PDEBUG; +- } else { +- dasd_data->system = PARTITION_LINUX; +- PDEBUG; ++ return 1; + } + ++ dasd_data->system = PARTITION_LINUX; ++ PDEBUG; + return 1; + } + diff --git a/libparted-dasd-implicit-partition-disk-flag.patch b/libparted-dasd-implicit-partition-disk-flag.patch new file mode 100644 index 0000000..8a929d7 --- /dev/null +++ b/libparted-dasd-implicit-partition-disk-flag.patch @@ -0,0 +1,130 @@ +From: Petr Uzel +Subject: libparted: dasd: Add an implicit partition disk flag +Patch-mainline: no, custom SUSE patch +--- + include/parted/disk.in.h | 4 +++- + libparted/disk.c | 2 ++ + libparted/labels/dasd.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 50 insertions(+), 1 deletion(-) + +Index: parted-3.3/include/parted/disk.in.h +=================================================================== +--- parted-3.3.orig/include/parted/disk.in.h ++++ parted-3.3/include/parted/disk.in.h +@@ -38,9 +38,11 @@ enum _PedDiskFlag { + PED_DISK_CYLINDER_ALIGNMENT=1, + /* This flag controls whether the boot flag of a GPT PMBR is set */ + PED_DISK_GPT_PMBR_BOOT=2, ++ /* This flag indicates that there is an implicit (aka fake) partition on the DASD disk */ ++ PED_DISK_DASD_IMPLICIT_PARTITION=3, + }; + #define PED_DISK_FIRST_FLAG PED_DISK_CYLINDER_ALIGNMENT +-#define PED_DISK_LAST_FLAG PED_DISK_GPT_PMBR_BOOT ++#define PED_DISK_LAST_FLAG PED_DISK_DASD_IMPLICIT_PARTITION + + /** + * Partition types +Index: parted-3.3/libparted/disk.c +=================================================================== +--- parted-3.3.orig/libparted/disk.c ++++ parted-3.3/libparted/disk.c +@@ -841,6 +841,8 @@ ped_disk_flag_get_name(PedDiskFlag flag) + return N_("cylinder_alignment"); + case PED_DISK_GPT_PMBR_BOOT: + return N_("pmbr_boot"); ++ case PED_DISK_DASD_IMPLICIT_PARTITION: ++ return N_("implicit_partition_table"); + default: + ped_exception_throw ( + PED_EXCEPTION_BUG, +Index: parted-3.3/libparted/labels/dasd.c +=================================================================== +--- parted-3.3.orig/libparted/labels/dasd.c ++++ parted-3.3/libparted/labels/dasd.c +@@ -73,6 +73,7 @@ typedef struct { + unsigned int format_type; + unsigned int label_block; + volume_label_t vlabel; ++ unsigned int has_implicit_partition; + } DasdDiskSpecific; + + static int dasd_probe (const PedDevice *dev); +@@ -107,6 +108,10 @@ static int dasd_partition_set_system (Pe + const PedFileSystemType* fs_type); + static int dasd_alloc_metadata (PedDisk* disk); + ++static int dasd_disk_set_flag (PedDisk *disk, PedDiskFlag flag, int state); ++static int dasd_disk_is_flag_available(const PedDisk *disk, PedDiskFlag flag); ++static int dasd_disk_get_flag (const PedDisk *disk, PedDiskFlag flag); ++ + #include "pt-common.h" + PT_define_limit_functions (dasd) + +@@ -116,6 +121,9 @@ static PedDiskOps dasd_disk_ops = { + + partition_set_name: NULL, + partition_get_name: NULL, ++ disk_set_flag: dasd_disk_set_flag, ++ disk_get_flag: dasd_disk_get_flag, ++ disk_is_flag_available: dasd_disk_is_flag_available, + + get_partition_alignment: dasd_get_partition_alignment, + +@@ -150,6 +158,8 @@ dasd_alloc (const PedDevice* dev) + return NULL; + } + ++ disk_specific->has_implicit_partition = 0; ++ + /* CDL format, newer */ + disk_specific->format_type = 2; + disk_specific->label_block = 2; +@@ -289,6 +299,7 @@ dasd_read (PedDisk* disk) + goto error_close_dev; + + disk_specific->format_type = 1; ++ disk_specific->has_implicit_partition = 1; + + /* Register implicit partition */ + ped_disk_delete_all (disk); +@@ -922,6 +933,40 @@ dasd_partition_enumerate (PedPartition* + } + + static int ++dasd_disk_set_flag (PedDisk *disk, PedDiskFlag flag, int state) ++{ ++ /* PED_DISK_DASD_IMPLICIT_PARTITION is immutable */ ++ return 0; ++} ++ ++static int ++dasd_disk_is_flag_available(const PedDisk *disk, PedDiskFlag flag) ++{ ++ switch (flag) ++ { ++ case PED_DISK_DASD_IMPLICIT_PARTITION: ++ return 1; ++ default: ++ return 0; ++ } ++} ++ ++static int ++dasd_disk_get_flag (const PedDisk *disk, PedDiskFlag flag) ++{ ++ DasdDiskSpecific* disk_specific = disk->disk_specific; ++ ++ switch (flag) ++ { ++ case PED_DISK_DASD_IMPLICIT_PARTITION: ++ return disk_specific->has_implicit_partition; ++ break; ++ default: ++ return 0; ++ } ++} ++ ++static int + dasd_partition_set_system (PedPartition* part, + const PedFileSystemType* fs_type) + { diff --git a/libparted-dasd-improve-lvm-raid-flag-handling.patch b/libparted-dasd-improve-lvm-raid-flag-handling.patch new file mode 100644 index 0000000..58c517f --- /dev/null +++ b/libparted-dasd-improve-lvm-raid-flag-handling.patch @@ -0,0 +1,44 @@ +From: Andre Wild +Date: Fri, 24 Mar 2017 03:11:11 +0100 +Subject: libparted/dasd: improve lvm/raid flag handling for DASD-CDL +References: bsc#1040163, fate#314888 +Patch-mainline: submitted, 2017-05-23 + +This commit corrects the reading of lvm/raid flags on DASD/CDL formatted +disks. Previously, users were not able to see what was the actual flags +stored on the disk. Now the file system check is removed and this issue +is corrected. + +Fixes: c8873b0044c8 ("When reading the DASD disk label, ...") +Signed-off-by: Andre Wild +Signed-off-by: Wang Dong +Signed-off-by: Hendrik Brueckner +Acked-by: Sebastian Parschauer +--- + libparted/labels/dasd.c | 15 +++------------ + 1 file changed, 3 insertions(+), 12 deletions(-) + +--- a/libparted/labels/dasd.c ++++ b/libparted/labels/dasd.c +@@ -457,18 +457,9 @@ dasd_read (PedDisk* disk) + } + + dasd_data = part->disk_specific; +- +- if ((strncmp(PART_TYPE_RAID, str, 6) == 0) && +- (ped_file_system_probe(&part->geom) == NULL)) +- ped_partition_set_flag(part, PED_PARTITION_RAID, 1); +- else +- ped_partition_set_flag(part, PED_PARTITION_RAID, 0); +- +- if ((strncmp(PART_TYPE_LVM, str, 6) == 0) && +- (ped_file_system_probe(&part->geom) == NULL)) +- ped_partition_set_flag(part, PED_PARTITION_LVM, 1); +- else +- ped_partition_set_flag(part, PED_PARTITION_LVM, 0); ++ dasd_data->raid = !strncmp(PART_TYPE_RAID, str, 6); ++ dasd_data->lvm = !strncmp(PART_TYPE_LVM, str, 6); ++ dasd_partition_set_system(part, part->fs_type); + + if (strncmp(PART_TYPE_SWAP, str, 6) == 0) { + fs = ped_file_system_probe(&part->geom); diff --git a/libparted-fix-NVDIMM-partition-naming.patch b/libparted-fix-NVDIMM-partition-naming.patch new file mode 100644 index 0000000..4fa41aa --- /dev/null +++ b/libparted-fix-NVDIMM-partition-naming.patch @@ -0,0 +1,23 @@ +From: Sebastian Parschauer +Date: Mon, 23 Oct 2017 17:47:47 +0200 +Subject: libparted: Fix NVDIMM partition naming +References: bsc#1064446 +Patch-mainline: no, required to fix custom SUSE device naming + +Signed-off-by: Sebastian Parschauer +--- + libparted/arch/linux.c | 1 + + 1 file changed, 1 insertion(+) + +Index: parted-3.3/libparted/arch/linux.c +=================================================================== +--- parted-3.3.orig/libparted/arch/linux.c ++++ parted-3.3/libparted/arch/linux.c +@@ -2489,6 +2489,7 @@ _device_get_part_path (PedDevice const * + dev->type == PED_DEVICE_CPQARRAY || + dev->type == PED_DEVICE_DAC960 || + dev->type == PED_DEVICE_NVME || ++ dev->type == PED_DEVICE_PMEM || + dev->type == PED_DEVICE_SDMMC) + p = "p"; + else if (dev->type == PED_DEVICE_DM) diff --git a/libparted-fix-nvme-partition-naming.patch b/libparted-fix-nvme-partition-naming.patch new file mode 100644 index 0000000..bcfdeb2 --- /dev/null +++ b/libparted-fix-nvme-partition-naming.patch @@ -0,0 +1,20 @@ +From: Petr Uzel +Subject: libparted: Fix NVMe device naming +References: bsc#982169 +Patch-mainline: no, required to fix custom SUSE device naming +--- + libparted/arch/linux.c | 1 + + 1 file changed, 1 insertion(+) + +Index: parted-3.3/libparted/arch/linux.c +=================================================================== +--- parted-3.3.orig/libparted/arch/linux.c ++++ parted-3.3/libparted/arch/linux.c +@@ -2488,6 +2488,7 @@ _device_get_part_path (PedDevice const * + if (dev->type == PED_DEVICE_ATARAID || + dev->type == PED_DEVICE_CPQARRAY || + dev->type == PED_DEVICE_DAC960 || ++ dev->type == PED_DEVICE_NVME || + dev->type == PED_DEVICE_SDMMC) + p = "p"; + else if (dev->type == PED_DEVICE_DM) diff --git a/libparted-linux-pmem-path.patch b/libparted-linux-pmem-path.patch new file mode 100644 index 0000000..a329577 --- /dev/null +++ b/libparted-linux-pmem-path.patch @@ -0,0 +1,15 @@ + libparted/arch/linux.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) +Index: parted-3.3/libparted/arch/linux.c +=================================================================== +--- parted-3.3.orig/libparted/arch/linux.c ++++ parted-3.3/libparted/arch/linux.c +@@ -2489,7 +2489,7 @@ _device_get_part_path (PedDevice const * + dev->type == PED_DEVICE_CPQARRAY || + dev->type == PED_DEVICE_DAC960 || + dev->type == PED_DEVICE_NVME || +- dev->type == PED_DEVICE_PMEM || ++ ((dev->type == PED_DEVICE_PMEM) && (!isdigit (devpath[path_len -1 ]))) || + dev->type == PED_DEVICE_SDMMC) + p = "p"; + else if (dev->type == PED_DEVICE_DM) diff --git a/libparted-make-BLKRRPART-more-robust.patch b/libparted-make-BLKRRPART-more-robust.patch new file mode 100644 index 0000000..50f36e2 --- /dev/null +++ b/libparted-make-BLKRRPART-more-robust.patch @@ -0,0 +1,51 @@ +From: Petr Uzel +Subject: libparted: Make BLKRRPART more robust +Patch-mainline: no, upstream does not use BLKRRPART and leaves DASDs broken +--- + libparted/arch/linux.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +Index: parted-3.3/libparted/arch/linux.c +=================================================================== +--- parted-3.3.orig/libparted/arch/linux.c ++++ parted-3.3/libparted/arch/linux.c +@@ -39,6 +39,7 @@ + #include + #include + #include /* for uname() */ ++#include + #include + #include + #include +@@ -3242,14 +3243,15 @@ static int + _kernel_reread_part_table (PedDevice* dev) + { + LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev); +- int retry_count = 9; ++ int retry_count = 5; + + sync(); ++ flock(arch_specific->fd, LOCK_EX); + while (ioctl (arch_specific->fd, BLKRRPART)) { + retry_count--; + sync(); +- if (retry_count == 3) +- sleep(1); /* Pause to allow system to settle */ ++ ++ sleep(1); /* Pause to allow system to settle */ + + if (!retry_count) { + ped_exception_throw ( +@@ -3259,10 +3261,12 @@ _kernel_reread_part_table (PedDevice* de + "table on %s (%s). As a result, it may not " + "reflect all of your changes until after reboot."), + dev->path, strerror (errno)); ++ flock(arch_specific->fd, LOCK_UN); + return 0; + } + } + ++ flock(arch_specific->fd, LOCK_UN); + return 1; + } + diff --git a/libparted-open-the-device-RO-and-lazily-switch-to-RW.patch b/libparted-open-the-device-RO-and-lazily-switch-to-RW.patch new file mode 100644 index 0000000..567e69e --- /dev/null +++ b/libparted-open-the-device-RO-and-lazily-switch-to-RW.patch @@ -0,0 +1,139 @@ +From: Petr Uzel +Date: Thu, 26 May 2016 09:28:21 +0200 +Subject: libparted: open the device RO and lazily switch to RW only if + necessary +References: bsc#979275 +Patch-mainline: not yet + +Avoid useless udev events triggered by opening the device RW +for purely read-only operations. + +Author: Michael Matz +[sparschauer: Use _flush_cache() also for reads, don't switch to RW + in _flush_cache() to avoid a possible recursion (bnc#989751), open + partitions in _flush_cache() O_RDONLY instead of O_WRONLY] +Signed-off-by: Sebastian Parschauer +--- + libparted/arch/linux.c | 33 ++++++++++++++++++++++++++++++--- + libparted/arch/linux.h | 1 + + 2 files changed, 31 insertions(+), 3 deletions(-) + +Index: parted-3.3/libparted/arch/linux.c +=================================================================== +--- parted-3.3.orig/libparted/arch/linux.c ++++ parted-3.3/libparted/arch/linux.c +@@ -298,6 +298,9 @@ static unsigned int _device_get_partitio + static int _device_open (PedDevice* dev, int flags); + static int _device_open_ro (PedDevice* dev); + static int _device_close (PedDevice* dev); ++static int linux_close (PedDevice* dev); ++static void _flush_cache (PedDevice* dev); ++ + + static int + _read_fd (int fd, char **buf) +@@ -451,6 +454,22 @@ _is_blkext_major (int major) + return _major_type_in_devices (major, "blkext"); + } + ++static void ++_ensure_read_write (PedDevice *dev) ++{ ++ PED_ASSERT (dev != NULL); ++ LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev); ++ ++ if (arch_specific->rw) ++ return; ++ ++ if (!linux_close(dev)) ++ return; ++ ++ if (!_device_open (dev, RW_MODE)) ++ return; ++} ++ + #ifdef ENABLE_DEVICE_MAPPER + static int + _dm_task_run_wait (struct dm_task *task, uint32_t cookie) +@@ -1678,7 +1697,7 @@ _flush_cache (PedDevice* dev) + if (!name) + break; + if (!_partition_is_mounted_by_path (name)) { +- fd = open (name, WR_MODE, 0); ++ fd = open (name, RD_MODE, 0); + if (fd > -1) { + ioctl (fd, BLKFLSBUF); + retry: +@@ -1709,7 +1728,7 @@ _device_open_ro (PedDevice* dev) + static int + linux_open (PedDevice* dev) + { +- return _device_open (dev, RW_MODE); ++ return _device_open (dev, RD_MODE); + } + + static int +@@ -1747,6 +1766,10 @@ retry: + } + } else { + dev->read_only = 0; ++ if (flags == WR_MODE || flags == RW_MODE) ++ arch_specific->rw = 1; ++ else ++ arch_specific->rw = 0; + } + + _flush_cache (dev); +@@ -1984,6 +2007,7 @@ _write_lastoddsector (PedDevice* dev, co + + PED_ASSERT(dev != NULL); + PED_ASSERT(buffer != NULL); ++ _ensure_read_write (dev); + + arch_specific = LINUX_SPECIFIC (dev); + +@@ -2032,6 +2056,9 @@ linux_write (PedDevice* dev, const void* + return 1; + } + ++ _ensure_read_write (dev); ++ if (count == 0) ++ return 1; /* We just ensured the device is open RW (see call from dasd_write()) */ + if (_get_linux_version() < KERNEL_VERSION (2,6,0)) { + /* Kludge. This is necessary to read/write the last + block of an odd-sized disk, until Linux 2.5.x kernel fixes. +@@ -2570,6 +2597,7 @@ _blkpg_part_command (PedDevice* dev, str + LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev); + struct blkpg_ioctl_arg ioctl_arg; + ++ _ensure_read_write (dev); + ioctl_arg.op = op; + ioctl_arg.flags = 0; + ioctl_arg.datalen = sizeof (struct blkpg_partition); +Index: parted-3.3/libparted/arch/linux.h +=================================================================== +--- parted-3.3.orig/libparted/arch/linux.h ++++ parted-3.3/libparted/arch/linux.h +@@ -30,6 +30,7 @@ struct _LinuxSpecific { + int fd; + int major; + int minor; ++ int rw; + char* dmtype; /**< device map target type */ + #if defined __s390__ || defined __s390x__ + unsigned int real_sector_size; +Index: parted-3.3/libparted/labels/dasd.c +=================================================================== +--- parted-3.3.orig/libparted/labels/dasd.c ++++ parted-3.3/libparted/labels/dasd.c +@@ -637,6 +637,10 @@ dasd_write (const PedDisk* disk) + return 1; + } + ++ /* Ensure the device is open RW */ ++ char dummy[10]; /* to avoid assertion in ped_device_write */ ++ ped_device_write(disk->dev, &dummy, 0, 0); ++ + /* initialize the anchor */ + fdasd_initialize_anchor(&anchor); + if (fdasd_get_geometry(disk->dev, &anchor, arch_specific->fd) == 0) diff --git a/libparted-partition-naming.patch b/libparted-partition-naming.patch new file mode 100644 index 0000000..157e0b8 --- /dev/null +++ b/libparted-partition-naming.patch @@ -0,0 +1,65 @@ +From: Petr Uzel +Subject: libparted: Change partition naming for SUSE needs +References: bsc#1056508 +Patch-mainline: no, custom SUSE patch + +Device mapper partitions always use the suffix "-part%d" for +partition names. Other devices with a trailing number in their +name use the "p%d" suffix. All other devices use the "%d" suffix. + +YaST depends on this. + +[mwilck: Fixed dm part name in _dm_add_partition(), bsc#1056508] +[sparschauer: Fixed dm part name in _dm_resize_partition(), bsc#1056508] +[sparschauer: Wrote the patch description] +[sparschauer: Dropped "_part" suffix, bsc#1078820, bsc#1081547] +Signed-off-by: Sebastian Parschauer +--- + libparted/arch/linux.c | 20 +++++++++++++------- + 1 file changed, 13 insertions(+), 7 deletions(-) + +Index: parted-3.3/libparted/arch/linux.c +=================================================================== +--- parted-3.3.orig/libparted/arch/linux.c ++++ parted-3.3/libparted/arch/linux.c +@@ -2456,11 +2456,17 @@ _device_get_part_path (PedDevice const * + result = zasprintf ("%.*s/part%d", + (int) (path_len - 5), devpath, num); + } else { +- char const *p = (dev->type == PED_DEVICE_DAC960 +- || dev->type == PED_DEVICE_CPQARRAY +- || dev->type == PED_DEVICE_ATARAID +- || isdigit (devpath[path_len - 1]) +- ? "p" : ""); ++ const char *p; ++ if (dev->type == PED_DEVICE_ATARAID || ++ dev->type == PED_DEVICE_CPQARRAY || ++ dev->type == PED_DEVICE_DAC960 || ++ dev->type == PED_DEVICE_SDMMC) ++ p = "p"; ++ else if (dev->type == PED_DEVICE_DM) ++ p = "-part"; ++ else ++ p = (isdigit (devpath[path_len - 1]) ++ ? "p" : ""); + result = zasprintf ("%s%s%d", devpath, p, num); + } + #ifdef ENABLE_DEVICE_MAPPER +@@ -2927,7 +2933,7 @@ _dm_add_partition (PedDisk* disk, const + size_t name_len = strlen (dev_name); + vol_name = zasprintf ("%s%s%d", + dev_name, +- isdigit (dev_name[name_len - 1]) ? "p" : "", ++ "-part", + part->num); + if (vol_name == NULL) + goto err; +@@ -3004,7 +3010,7 @@ _dm_resize_partition (PedDisk* disk, con + size_t name_len = strlen (dev_name); + vol_name = zasprintf ("%s%s%d", + dev_name, +- isdigit (dev_name[name_len - 1]) ? "p" : "", ++ "-part", + part->num); + if (vol_name == NULL) + goto err; diff --git a/libparted-use-BLKRRPART-for-DASD.patch.patch b/libparted-use-BLKRRPART-for-DASD.patch.patch new file mode 100644 index 0000000..2e8681c --- /dev/null +++ b/libparted-use-BLKRRPART-for-DASD.patch.patch @@ -0,0 +1,80 @@ +From: Petr Uzel +Date: Fri, 14 Feb 2014 09:12:47 +0100 +Subject: libparted: use BLKRRPART for DASDs +References: bnc#862139 +Patch-mainline: no, upstream dropped proper DASD support + +This reverts upstream commit 9fa0e1800db5b9f094ae481fd95a51da03f19e95. +This reverts upstream commit 1223b9fc07859cb619c80dc057bd05458f9b5669. +and some fixups on top +--- + libparted/arch/linux.c | 50 ++++++++++++++++++++++++++++++++++++++++--------- + 1 file changed, 41 insertions(+), 9 deletions(-) + +Index: parted-3.3/libparted/arch/linux.c +=================================================================== +--- parted-3.3.orig/libparted/arch/linux.c ++++ parted-3.3/libparted/arch/linux.c +@@ -3239,6 +3239,34 @@ _disk_sync_part_table (PedDisk* disk) + } + + static int ++_kernel_reread_part_table (PedDevice* dev) ++{ ++ LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev); ++ int retry_count = 9; ++ ++ sync(); ++ while (ioctl (arch_specific->fd, BLKRRPART)) { ++ retry_count--; ++ sync(); ++ if (retry_count == 3) ++ sleep(1); /* Pause to allow system to settle */ ++ ++ if (!retry_count) { ++ ped_exception_throw ( ++ PED_EXCEPTION_WARNING, ++ PED_EXCEPTION_IGNORE, ++ _("WARNING: the kernel failed to re-read the partition " ++ "table on %s (%s). As a result, it may not " ++ "reflect all of your changes until after reboot."), ++ dev->path, strerror (errno)); ++ return 0; ++ } ++ } ++ ++ return 1; ++} ++ ++static int + _have_blkpg () + { + static int have_blkpg = -1; +@@ -3257,14 +3285,19 @@ linux_disk_commit (PedDisk* disk) + { + if (disk->dev->type != PED_DEVICE_FILE) { + +- /* We now require BLKPG support. If this assertion fails, +- please write to the mailing list describing your system. +- Assuming it's never triggered, ... +- FIXME: remove this assertion in 2012. */ +- assert (_have_blkpg ()); +- +- if (!_disk_sync_part_table (disk)) +- return 0; ++ /* The ioctl() command BLKPG_ADD_PARTITION does not notify ++ * the devfs system; consequently, /proc/partitions will not ++ * be up to date, and the proper links in /dev are not ++ * created. Therefore, if using DevFS, we must get the kernel ++ * to re-read and grok the partition table. ++ */ ++ /* Work around kernel dasd problem so we really do BLKRRPART */ ++ if (disk->dev->type == PED_DEVICE_DASD) ++ return _kernel_reread_part_table(disk->dev); ++ ++ assert(_have_blkpg()); ++ if (!_disk_sync_part_table(disk)) ++ return 0; + } + + return 1; diff --git a/libparted-use-BLKRRPART-only-when-needed.patch b/libparted-use-BLKRRPART-only-when-needed.patch new file mode 100644 index 0000000..d1cfd7a --- /dev/null +++ b/libparted-use-BLKRRPART-only-when-needed.patch @@ -0,0 +1,109 @@ +From: Sebastian Parschauer +Date: Thu, 25 Jan 2018 17:06:00 +0100 +Subject: libparted: dasd: Use BLKRRPART only when needed +References: bsc#1065197, bsc#1067435 +Patch-mainline: no, upstream dropped proper DASD support + +The BLKRRPART ioctl is required due to limitations of the DASD +disk layout. We use it always for those devices right now but when +adding or removing a partition at the end, then it is enough to use +the BLKPG* ioctls. The problem with BLKRRPART occurs when one of the +first partitions is busy. BLKRRPART touches all partitions and the +parted command fails in this case. +So detect that situation and use BLKRRPART only when needed instead. + +Signed-off-by: Sebastian Parschauer +--- + include/parted/disk.in.h | 1 + + libparted/arch/linux.c | 13 +++++++------ + libparted/disk.c | 15 +++++++++++++-- + 3 files changed, 21 insertions(+), 8 deletions(-) + +Index: parted-3.3/include/parted/disk.in.h +=================================================================== +--- parted-3.3.orig/include/parted/disk.in.h ++++ parted-3.3/include/parted/disk.in.h +@@ -195,6 +195,7 @@ struct _PedDisk { + int update_mode; /**< mode without free/metadata + partitions, for easier + update */ ++ int needs_blkrrpart; /* special cases on DASDs */ + }; + + struct _PedDiskOps { +Index: parted-3.3/libparted/arch/linux.c +=================================================================== +--- parted-3.3.orig/libparted/arch/linux.c ++++ parted-3.3/libparted/arch/linux.c +@@ -3324,15 +3324,15 @@ static int + linux_disk_commit (PedDisk* disk) + { + if (disk->dev->type != PED_DEVICE_FILE) { +- +- /* The ioctl() command BLKPG_ADD_PARTITION does not notify +- * the devfs system; consequently, /proc/partitions will not +- * be up to date, and the proper links in /dev are not +- * created. Therefore, if using DevFS, we must get the kernel +- * to re-read and grok the partition table. ++ /* If adding or removing partitions not at the end, then the ++ * ioctl() command BLKPG_ADD_PARTITION does not notify the ++ * devfs system; consequently, /proc/partitions will not be up ++ * to date, and the proper links in /dev are not created. ++ * Therefore, if using DevFS, we must get the kernel to re-read ++ * and grok the partition table. + */ + /* Work around kernel dasd problem so we really do BLKRRPART */ +- if (disk->dev->type == PED_DEVICE_DASD) ++ if (disk->dev->type == PED_DEVICE_DASD && disk->needs_blkrrpart) + return _kernel_reread_part_table(disk->dev); + + assert(_have_blkpg()); +Index: parted-3.3/libparted/disk.c +=================================================================== +--- parted-3.3.orig/libparted/disk.c ++++ parted-3.3/libparted/disk.c +@@ -407,6 +407,7 @@ _ped_disk_alloc (const PedDevice* dev, c + disk->update_mode = 1; + disk->part_list = NULL; + disk->needs_clobber = 0; ++ disk->needs_blkrrpart = 0; + return disk; + + error: +@@ -1734,8 +1735,12 @@ _disk_raw_remove (PedDisk* disk, PedPart + + if (part->prev) { + part->prev->next = part->next; +- if (part->next) ++ if (part->next) { ++ /* remove partition in the middle */ ++ if (part->type == PED_PARTITION_NORMAL) ++ disk->needs_blkrrpart = 1; + part->next->prev = part->prev; ++ } + } else { + if (part->type & PED_PARTITION_LOGICAL) { + ped_disk_extended_partition (disk)->part_list +@@ -1743,8 +1748,12 @@ _disk_raw_remove (PedDisk* disk, PedPart + } else { + disk->part_list = part->next; + } +- if (part->next) ++ if (part->next) { ++ /* remove first partition */ ++ if (part->type == PED_PARTITION_NORMAL) ++ disk->needs_blkrrpart = 1; + part->next->prev = NULL; ++ } + } + + return 1; +@@ -1774,6 +1783,8 @@ _disk_raw_add (PedDisk* disk, PedPartiti + } + + if (walk) { ++ if (part->type == PED_PARTITION_NORMAL) ++ disk->needs_blkrrpart = 1; + return _disk_raw_insert_before (disk, walk, part); + } else { + if (last) { diff --git a/more-reliable-informing-the-kernel.patch b/more-reliable-informing-the-kernel.patch new file mode 100644 index 0000000..9359a78 --- /dev/null +++ b/more-reliable-informing-the-kernel.patch @@ -0,0 +1,76 @@ +From: Petr Uzel +Subject: parted: Make informing the kernel more reliable +References: bnc#657360 +Patch-mainline: no + +This patch should make parted's process of informing the kernel +about changes of partition table sligtly more reliable. +It consists of 2 quite unrelated parts: + +* increase the max sleep time if partition is busy from 1 to 2 seconds +* do not inform the kernel when only partition flags change - kernel + does not care about the flags +--- + libparted/arch/linux.c | 2 +- + parted/parted.c | 28 +++++++++++++++++++++++++++- + 2 files changed, 28 insertions(+), 2 deletions(-) + +Index: parted-3.3/libparted/arch/linux.c +=================================================================== +--- parted-3.3.orig/libparted/arch/linux.c ++++ parted-3.3/libparted/arch/linux.c +@@ -3153,7 +3153,7 @@ _disk_sync_part_table (PedDisk* disk) + /* Attempt to remove the partition, retrying for + up to max_sleep_seconds upon any failure due to EBUSY. */ + unsigned int sleep_microseconds = 10000; +- unsigned int max_sleep_seconds = 1; ++ unsigned int max_sleep_seconds = 2; + unsigned int n_sleep = (max_sleep_seconds + * 1000000 / sleep_microseconds); + do { +Index: parted-3.3/parted/parted.c +=================================================================== +--- parted-3.3.orig/parted/parted.c ++++ parted-3.3/parted/parted.c +@@ -267,6 +267,32 @@ _disk_warn_loss (PedDisk* disk) + disk->dev->path) == PED_EXCEPTION_YES; + } + ++/* ++ * Copied from ped_disk_commit(), but with removed the call to ++ * ped_disk_commit_to_os(). This is used in do_set() - BLKPG* ioctls() do not ++ * care about the partition flags anyway. ++ */ ++static int ++ped_disk_commit_just_to_disk (PedDisk* disk) ++{ ++ /* Open the device here, so that the underlying fd is not closed ++ between commit_to_dev and commit_to_os (closing causes unwanted ++ udev events to be sent under Linux). */ ++ if (!ped_device_open (disk->dev)) ++ goto error; ++ ++ if (!ped_disk_commit_to_dev (disk)) ++ goto error_close_dev; ++ ++ ped_device_close (disk->dev); ++ return 1; ++ ++error_close_dev: ++ ped_device_close (disk->dev); ++error: ++ return 0; ++} ++ + /* This function changes "sector" to "new_sector" if the new value lies + * within the required range. + */ +@@ -1791,7 +1817,7 @@ do_set (PedDevice** dev, PedDisk **diskp + + if (!ped_partition_set_flag (part, flag, state)) + goto error; +- if (!ped_disk_commit (*diskp)) ++ if (!ped_disk_commit_just_to_disk (*diskp)) + goto error; + + if ((*dev)->type != PED_DEVICE_FILE) diff --git a/parted-2.4-ncursesw6.patch b/parted-2.4-ncursesw6.patch new file mode 100644 index 0000000..e2918bd --- /dev/null +++ b/parted-2.4-ncursesw6.patch @@ -0,0 +1,30 @@ +From: Petr Uzel +Subject: build: Add ncursesw6 support +Patch-mainline: no, custom SUSE patch +--- + configure.ac | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +Index: parted-3.3/configure.ac +=================================================================== +--- parted-3.3.orig/configure.ac ++++ parted-3.3/configure.ac +@@ -147,7 +147,8 @@ AM_CPPFLAGS="$AM_CPPFLAGS -D_REENTRANT" + + dnl Check for programs. + AC_SEARCH_LIBS([strerror],[cposix]) +-AC_PROG_CC ++AC_PROG_CC_STDC ++AC_USE_SYSTEM_EXTENSIONS + AC_PROG_GCC_TRADITIONAL + AM_PROG_CC_C_O + +@@ -320,7 +321,7 @@ dnl Check for termcap + if test "$with_readline" = yes; then + OLD_LIBS="$LIBS" + LIBS="" +- AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses termcap termlib], ++ AC_SEARCH_LIBS([tgetent], [tinfo ncursesw curses termcap termlib], + [PARTED_LIBS="$PARTED_LIBS $LIBS"], + [AC_MSG_ERROR(dnl + [termcap could not be found which is required for the diff --git a/parted-3.5.tar.xz b/parted-3.5.tar.xz new file mode 100644 index 0000000..c683390 --- /dev/null +++ b/parted-3.5.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4938dd5c1c125f6c78b1f4b3e297526f18ee74aa43d45c248578b1d2470c05a2 +size 1871824 diff --git a/parted-3.5.tar.xz.sig b/parted-3.5.tar.xz.sig new file mode 100644 index 0000000..40b9245 --- /dev/null +++ b/parted-3.5.tar.xz.sig @@ -0,0 +1,11 @@ +-----BEGIN PGP SIGNATURE----- + +iQEzBAABCgAdFiEEtMa0UeT6i0IyyhkeEX6MFo7+On8FAmJduCkACgkQEX6MFo7+ +On9cLAgAmAn86lYjZj+Ka5EHrVtaFgh1Nvz84EOwZd0TVRTJyP/u56QrOXxRYFFr +6SiJuI1sWfpkzMGG8RYhcr/hu0Os4rtDdhwXXA75QexpSZamPRSo/EU7skrPW0ZD +ycw6jUIBO5de4kCLmM/4byl6LV5eFixJYJ5zfD+SnQsMJvO6/fBo0Dv+pNGF/m5F +mQeLWmgfqCNZ3INoHLPxuP08gpA9aELp6UFipbqBZqeRIk4K+jGSWlLu62mwl2sQ +1OYIIdKacBrh14ZhRqXZKGKHk94RxiFtD/7CLXK/qzEFylKUMQ/XpUB0QkZNHVZW +l2kRXsEGC1c7dWSbMX8lgy02HjfuVQ== +=7scj +-----END PGP SIGNATURE----- diff --git a/parted-add-ignore-busy-option.patch b/parted-add-ignore-busy-option.patch new file mode 100644 index 0000000..b4e313a --- /dev/null +++ b/parted-add-ignore-busy-option.patch @@ -0,0 +1,107 @@ +From: Sebastian Parschauer +Date: Mon, 20 Nov 2017 18:01:56 +0100 +Subject: parted: Add '--ignore-busy' option +References: bsc#1058667 +Patch-mainline: not yet, based on v3 submitted on 2017-11-07 + +There are dangerous actions like e.g. shrinking or removing a busy +partition which should be possible in script mode but not without +using an option to enforce that. This is meant to prevent buggy +scripts from doing those actions unintentionally. + +Also add proper printing of the help text for a long option without +a short option. + +Suggested-by: Phillip Susi +Signed-off-by: Sebastian Parschauer +--- + doc/C/parted.8 | 3 +++ + parted/parted.c | 16 ++++++++++++++-- + 2 files changed, 17 insertions(+), 2 deletions(-) + +Index: parted-3.3/doc/C/parted.8 +=================================================================== +--- parted-3.3.orig/doc/C/parted.8 ++++ parted-3.3/doc/C/parted.8 +@@ -30,6 +30,9 @@ never prompts for user intervention + .B -v, --version + displays the version + .TP ++.B --ignore-busy ++perform the requested action in script mode although a partition is busy ++.TP + .B --wipesignatures + mkpart wipes the superblock signatures from the disk region where it is + about to create the partition +Index: parted-3.3/parted/parted.c +=================================================================== +--- parted-3.3.orig/parted/parted.c ++++ parted-3.3/parted/parted.c +@@ -76,8 +76,9 @@ static int MEGABYTE_SECTORS (PedDevice* + enum + { + PRETEND_INPUT_TTY = CHAR_MAX + 1, +- WIPESIGNATURES = CHAR_MAX + 2, ++ IGNORE_BUSY = CHAR_MAX + 2, ++ WIPESIGNATURES = CHAR_MAX + 3, + }; + + /* Output modes */ + enum +@@ -118,6 +119,7 @@ static struct option const options[] = { + {"fix", 0, NULL, 'f'}, + {"version", 0, NULL, 'v'}, + {"align", required_argument, NULL, 'a'}, ++ {"ignore-busy", 0, NULL, IGNORE_BUSY}, + {"wipesignatures", 0, NULL, WIPESIGNATURES}, + {"-pretend-input-tty", 0, NULL, PRETEND_INPUT_TTY}, + {NULL, 0, NULL, 0} +@@ -130,10 +132,13 @@ static const char *const options_help [] + {"fix", N_("in script mode, fix instead of abort when asked")}, + {"version", N_("displays the version")}, + {"align=[none|cyl|min|opt]", N_("alignment for new partitions")}, ++ {"ignore-busy", N_("perform action although partition is busy")}, + {"wipesignatures", N_("wipe superblock signatures when creating partition")}, + {NULL, NULL} + }; + ++#define LONGOPT_HELP_START 6 /* index to first long option help */ ++ + int opt_script_mode = 0; + int opt_fix_mode = 0; + int pretend_input_tty = 0; +@@ -141,6 +146,7 @@ int opt_machine_mode = 0; + int disk_is_modified = 0; + int is_toggle_mode = 0; + int alignment = ALIGNMENT_OPTIMAL; ++int ignore_busy = 0; + + static const char* number_msg = N_( + "NUMBER is the partition number used by Linux. On MS-DOS disk labels, the " +@@ -514,12 +520,17 @@ print_options_help () + { + int i; + +- for (i=0; options_help [i][0]; i++) { ++ for (i=0; i < LONGOPT_HELP_START; i++) { + printf (" -%c, --%-25.25s %s\n", + options_help [i][0][0], + options_help [i][0], + _(options_help [i][1])); + } ++ for (i=LONGOPT_HELP_START; options_help [i][0]; i++) { ++ printf (" --%-29.25s %s\n", ++ options_help [i][0], ++ _(options_help [i][1])); ++ } + } + + int +@@ -2299,6 +2310,7 @@ while (1) + alignment = XARGMATCH ("--align", optarg, + align_args, align_types); + break; ++ case IGNORE_BUSY: ignore_busy = 1; break; + case PRETEND_INPUT_TTY: + pretend_input_tty = 1; + break; diff --git a/parted-fatresize-autoconf.patch b/parted-fatresize-autoconf.patch new file mode 100644 index 0000000..751ff62 --- /dev/null +++ b/parted-fatresize-autoconf.patch @@ -0,0 +1,42 @@ +From: Petr Uzel +Subject: build: Patch fatresize build into parted package +Patch-mainline: no, custom SUSE patch + +Fatresize is used by YaST to resize FAT16/FAT32 file systems. It uses +libparted functions for that purpose but does not resize the FAT +partition afterward. That is the task of parted instead. So using it +without parted and YaST doesn't make much sense. + +Versions more recent than 0.1 like e.g. 1.0.3 are incompatible and +risk data loss by silently increasing the FS size (See: bsc#1072479). + +Upstream: https://github.com/ya-mouse/fatresize +[sparschauer: Wrote the patch description] +--- + Makefile.am | 2 +- + configure.ac | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +Index: parted-3.3/Makefile.am +=================================================================== +--- parted-3.3.orig/Makefile.am ++++ parted-3.3/Makefile.am +@@ -1,5 +1,5 @@ + ACLOCAL_AMFLAGS = -I m4 +-SUBDIRS = po lib include libparted parted partprobe doc debug tests ++SUBDIRS = po lib include libparted parted partprobe fatresize doc debug tests + + EXTRA_DIST = \ + .version \ +Index: parted-3.3/configure.ac +=================================================================== +--- parted-3.3.orig/configure.ac ++++ parted-3.3/configure.ac +@@ -571,6 +571,7 @@ libparted.pc + libparted-fs-resize.pc + parted/Makefile + partprobe/Makefile ++fatresize/Makefile + doc/Makefile + doc/C/Makefile + doc/pt_BR/Makefile diff --git a/parted-fix-resizepart-and-rm-command.patch b/parted-fix-resizepart-and-rm-command.patch new file mode 100644 index 0000000..31b70d1 --- /dev/null +++ b/parted-fix-resizepart-and-rm-command.patch @@ -0,0 +1,122 @@ +From: Sebastian Parschauer +Date: Tue, 7 Nov 2017 14:09:46 +0100 +Subject: parted: Fix resizepart and rm command +References: bsc#1058667 +Patch-mainline: not yet, based on v3 submitted on 2017-11-07 + +In script mode the resizepart command fails when shrinking and +if the partition is busy. Also the warnings printed in this +case are only applicable to interactive mode. A similar problem +exists with the rm command. +So print different warnings in script mode and continue if growing +a busy partition. Require the '--ignore-busy' option to be set in +order to shrink or remove a busy partition. Shrinking cannot be +more dangerous in script mode than removing. So allow shrinking a +partition in script mode which is not busy. + +In interactive mode there is a problem if providing the partition +number and the end of the partition as arguments to the resizepart +command directly with a busy partition. The warning is shown and +after continuing anyway parted asks for the partition end although +it has already been provided. So count the number of words on +command line and warn after processing all of them or after getting +the partition number. + +Fixes: 21c58e17c473 ("parted: add resizepart command") +Reported-by: Arvin Schnell +Signed-off-by: Sebastian Parschauer +--- + parted/parted.c | 39 ++++++++++++++++++++++++++++++++------- + 2 files changed, 36 insertions(+), 7 deletions(-) + +Index: parted-3.3/parted/parted.c +=================================================================== +--- parted-3.3.orig/parted/parted.c ++++ parted-3.3/parted/parted.c +@@ -229,13 +229,19 @@ _timer_handler (PedTimer* timer, void* c + } + + static int +-_partition_warn_busy (PedPartition* part) ++_partition_warn_busy (PedPartition* part, bool dangerous) + { + char* path; + + if (ped_partition_is_busy (part)) { + path = ped_partition_get_path (part); +- if (ped_exception_throw ( ++ if (opt_script_mode && (!dangerous || ignore_busy)) { ++ ped_exception_throw ( ++ PED_EXCEPTION_WARNING, ++ PED_EXCEPTION_UNHANDLED, ++ _("Partition %s is being used, continuing anyway."), ++ path); ++ } else if (ped_exception_throw ( + PED_EXCEPTION_WARNING, + PED_EXCEPTION_YES_NO, + _("Partition %s is being used. Are you sure you " \ +@@ -1655,6 +1661,11 @@ do_resizepart (PedDevice** dev, PedDisk* + PedSector start, end, oldend; + PedGeometry *range_end = NULL; + PedConstraint* constraint; ++ int cmdline_words = command_line_get_word_count(); ++ /* update this if adding/removing arguments to/from this command */ ++ const int part_idx = 1; ++ const int end_idx = 2; ++ const bool danger_if_busy = false; + int rc = 0; + char* end_input = NULL; + char* end_size = NULL; +@@ -1671,7 +1682,8 @@ do_resizepart (PedDevice** dev, PedDisk* + } + + /* If the partition is busy this may clear the command_line and prompt the user */ +- if (!_partition_warn_busy (part)) ++ /* warn early if the partition end is not provided on cmdline */ ++ if (cmdline_words <= part_idx && !_partition_warn_busy (part, danger_if_busy)) + goto error; + + /* Push the End value back onto the command_line, if it exists */ +@@ -1871,13 +1873,23 @@ do_resizepart (PedDevice** dev, PedDisk* + start, end)) + goto error_destroy_constraint; + /* warn when shrinking partition - might lose data */ +- if (part->geom.end < oldend) +- if (ped_exception_throw ( ++ if (part->geom.end < oldend) { ++ if (opt_script_mode && (!ped_partition_is_busy (part) || ignore_busy)) { ++ char *path = ped_partition_get_path (part); ++ ped_exception_throw ( ++ PED_EXCEPTION_WARNING, ++ PED_EXCEPTION_UNHANDLED, ++ _("Shrinking partition %s, data loss possible."), path); ++ free(path); ++ } else if (ped_exception_throw ( + PED_EXCEPTION_WARNING, + PED_EXCEPTION_YES_NO, + _("Shrinking a partition can cause data loss, " \ + "are you sure you want to continue?")) != PED_EXCEPTION_YES) ++ { + goto error_destroy_constraint; ++ } ++ } + ped_disk_commit (disk); + + if ((*dev)->type != PED_DEVICE_FILE) +@@ -1714,6 +1739,7 @@ static int + do_rm (PedDevice** dev, PedDisk** diskp) + { + PedPartition* part = NULL; ++ const bool danger_if_busy = true; + + if (!*diskp) + *diskp = ped_disk_new (*dev); +@@ -1722,7 +1748,7 @@ do_rm (PedDevice** dev, PedDisk** diskp) + + if (!command_line_get_partition (_("Partition number?"), *diskp, &part)) + goto error; +- if (!_partition_warn_busy (part)) ++ if (!_partition_warn_busy (part, danger_if_busy)) + goto error; + + if (!ped_disk_delete_partition (*diskp, part)) diff --git a/parted-implement-wipesignatures-option.patch b/parted-implement-wipesignatures-option.patch new file mode 100644 index 0000000..da1b2ab --- /dev/null +++ b/parted-implement-wipesignatures-option.patch @@ -0,0 +1,206 @@ +From: Petr Uzel +Date: Thu, 28 Apr 2016 17:18:44 +0200 +Subject: [PATCH] parted: implement --wipesignatures option +References: bsc#943623, fate#319893, bsc#980834 +Patch-mainline: no, custom extension + +With this option, parted uses libblkid to wipe superblock signatures +from a disk region where it is about to create a new partition. + +[sparschauer: Use own #if USE_BLKID block in linux_dev_ops (bsc#1047031)] +Signed-off-by: Sebastian Parschauer +--- + doc/C/parted.8 | 4 ++++ + include/parted/device.in.h | 2 ++ + libparted/arch/linux.c | 39 +++++++++++++++++++++++++++++++++++++++ + libparted/device.c | 17 +++++++++++++++++ + parted/parted.c | 16 ++++++++++++++++ + 5 files changed, 78 insertions(+) + +Index: parted-3.3/doc/C/parted.8 +=================================================================== +--- parted-3.3.orig/doc/C/parted.8 ++++ parted-3.3/doc/C/parted.8 +@@ -30,6 +30,10 @@ never prompts for user intervention + .B -v, --version + displays the version + .TP ++.B --wipesignatures ++mkpart wipes the superblock signatures from the disk region where it is ++about to create the partition ++.TP + .B -a \fIalignment-type\fP, --align \fIalignment-type\fP + Set alignment for newly created partitions, valid alignment types are: + .RS +Index: parted-3.3/include/parted/device.in.h +=================================================================== +--- parted-3.3.orig/include/parted/device.in.h ++++ parted-3.3/include/parted/device.in.h +@@ -122,6 +122,7 @@ struct _PedDeviceArchOps { + /* These functions are optional */ + PedAlignment *(*get_minimum_alignment)(const PedDevice *dev); + PedAlignment *(*get_optimum_alignment)(const PedDevice *dev); ++ int (*wipe_signatures)(const PedDevice *dev, PedSector start, PedSector length); + }; + + #include +@@ -158,6 +159,7 @@ extern PedConstraint *ped_device_get_opt + + extern PedAlignment *ped_device_get_minimum_alignment(const PedDevice *dev); + extern PedAlignment *ped_device_get_optimum_alignment(const PedDevice *dev); ++extern int ped_device_wipe_signatures(const PedDevice *dev, PedSector start, PedSector length); + + /* private stuff ;-) */ + +Index: parted-3.3/libparted/arch/linux.c +=================================================================== +--- parted-3.3.orig/libparted/arch/linux.c ++++ parted-3.3/libparted/arch/linux.c +@@ -3395,6 +3395,44 @@ linux_get_optimum_alignment(const PedDev + blkid_topology_get_alignment_offset(tp) / dev->sector_size, + blkid_topology_get_optimal_io_size(tp) / dev->sector_size); + } ++ ++static int ++linux_wipe_signatures(const PedDevice *dev, PedSector start, PedSector length) ++{ ++ PED_ASSERT (dev != NULL); ++ LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev); ++ ++ blkid_loff_t wipe_offset = start * dev->sector_size; ++ blkid_loff_t wipe_size = length * dev->sector_size; ++ ++ _ensure_read_write (dev); ++ ++ blkid_probe pr; ++ pr = blkid_new_probe(); ++ if (!pr) ++ goto error; ++ ++ if (blkid_probe_set_device(pr, arch_specific->fd, wipe_offset, wipe_size) == -1) ++ goto error_free_probe; ++ if (blkid_probe_enable_superblocks(pr, 1) == -1) ++ goto error_free_probe; ++ if (blkid_probe_set_superblocks_flags(pr, BLKID_SUBLKS_MAGIC) == -1) ++ goto error_free_probe; ++ ++ while (blkid_do_probe(pr) == 0) { ++ if (blkid_do_wipe(pr, 0) == -1) ++ goto error_free_probe; ++ } ++ ++ blkid_free_probe(pr); ++ return 1; ++ ++error_free_probe: ++ blkid_free_probe(pr); ++ ++error: ++ return 0; ++} + #endif + + #if defined __s390__ || defined __s390x__ +@@ -3471,6 +3509,9 @@ static PedDeviceArchOps linux_dev_ops = + get_minimum_alignment: linux_get_minimum_alignment, + get_optimum_alignment: linux_get_optimum_alignment, + #endif ++#if USE_BLKID ++ wipe_signatures: linux_wipe_signatures, ++#endif + }; + + PedDiskArchOps linux_disk_ops = { +Index: parted-3.3/libparted/device.c +=================================================================== +--- parted-3.3.orig/libparted/device.c ++++ parted-3.3/libparted/device.c +@@ -559,4 +559,21 @@ ped_device_get_optimum_alignment(const P + return align; + } + ++ ++/** ++ * Wipe superblock signatures from the specified region on the device. ++ * ++ * \return zero on failure ++ */ ++int ++ped_device_wipe_signatures(const PedDevice *dev, PedSector start, PedSector length) ++{ ++ int ret = 0; ++ ++ if (ped_architecture->dev_ops->wipe_signatures) ++ ret = ped_architecture->dev_ops->wipe_signatures(dev, start, length); ++ ++ return ret; ++} ++ + /** @} */ +Index: parted-3.3/parted/parted.c +=================================================================== +--- parted-3.3.orig/parted/parted.c ++++ parted-3.3/parted/parted.c +@@ -76,6 +76,7 @@ static int MEGABYTE_SECTORS (PedDevice* + enum + { + PRETEND_INPUT_TTY = CHAR_MAX + 1, ++ WIPESIGNATURES = CHAR_MAX + 2, + }; + + /* Output modes */ +@@ -117,6 +118,7 @@ static struct option const options[] = { + {"fix", 0, NULL, 'f'}, + {"version", 0, NULL, 'v'}, + {"align", required_argument, NULL, 'a'}, ++ {"wipesignatures", 0, NULL, WIPESIGNATURES}, + {"-pretend-input-tty", 0, NULL, PRETEND_INPUT_TTY}, + {NULL, 0, NULL, 0} + }; +@@ -128,11 +130,13 @@ static const char *const options_help [] + {"version", N_("displays the version")}, + {"align=[none|cyl|min|opt]", N_("alignment for new partitions")}, ++ {"wipesignatures", N_("wipe superblock signatures when creating partition")}, + {NULL, NULL} + }; + + int opt_script_mode = 0; + int opt_fix_mode = 0; + int pretend_input_tty = 0; + int opt_output_mode = HUMAN; ++int wipesignatures = 0; + int disk_is_modified = 0; + int is_toggle_mode = 0; +@@ -651,6 +655,7 @@ _adjust_end_if_iec (PedSector* start, Pe + } + } + ++ + static int + do_mkpart (PedDevice** dev, PedDisk** diskp) + { +@@ -848,6 +853,14 @@ do_mkpart (PedDevice** dev, PedDisk** di + if (ped_partition_is_flag_available (part, PED_PARTITION_LBA)) + ped_partition_set_flag (part, PED_PARTITION_LBA, 1); + ++ if (wipesignatures) { ++ if (!ped_device_wipe_signatures(*dev, part->geom.start, part->geom.length)) ++ ped_exception_throw ( ++ PED_EXCEPTION_WARNING, ++ PED_EXCEPTION_OK, ++ _("Wiping the superblock signatures has failed.")); ++ } ++ + if (!ped_disk_commit (disk)) + goto error_remove_part; + +@@ -2252,6 +2265,9 @@ while (1) + case PRETEND_INPUT_TTY: + pretend_input_tty = 1; + break; ++ case WIPESIGNATURES: ++ wipesignatures = 1; ++ break; + default: + wrong = 1; + break; diff --git a/parted-mac.patch b/parted-mac.patch new file mode 100644 index 0000000..87b92ec --- /dev/null +++ b/parted-mac.patch @@ -0,0 +1,180 @@ +From: Petr Uzel +Subject: parted: mac: Print the system name +Patch-mainline: no, custom SUSE patch +--- + include/parted/disk.in.h | 9 +++++++-- + libparted/disk.c | 33 +++++++++++++++++++++++++++++++++ + libparted/labels/mac.c | 34 +++++++++++++++++++++++++++++++++- + parted/parted.c | 12 ++++++++++++ + 4 files changed, 85 insertions(+), 3 deletions(-) + +Index: parted-3.3/include/parted/disk.in.h +=================================================================== +--- parted-3.3.orig/include/parted/disk.in.h ++++ parted-3.3/include/parted/disk.in.h +@@ -83,10 +83,11 @@ enum _PedPartitionFlag { + + enum _PedDiskTypeFeature { + PED_DISK_TYPE_EXTENDED=1, /**< supports extended partitions */ +- PED_DISK_TYPE_PARTITION_NAME=2 /**< supports partition names */ ++ PED_DISK_TYPE_PARTITION_NAME=2, /**< supports partition names */ ++ PED_DISK_TYPE_SYSTEM_NAME=4 /**< supports system names */ + }; + #define PED_DISK_TYPE_FIRST_FEATURE PED_DISK_TYPE_EXTENDED +-#define PED_DISK_TYPE_LAST_FEATURE PED_DISK_TYPE_PARTITION_NAME ++#define PED_DISK_TYPE_LAST_FEATURE PED_DISK_TYPE_SYSTEM_NAME + + struct _PedDisk; + struct _PedPartition; +@@ -246,6 +247,8 @@ struct _PedDiskOps { + /* other */ + int (*alloc_metadata) (PedDisk* disk); + int (*get_max_primary_partition_count) (const PedDisk* disk); ++ void (*partition_set_system_name) (PedPartition* part, const char* name); ++ const char* (*partition_get_system_name) (const PedPartition* part); + bool (*get_max_supported_partition_count) (const PedDisk* disk, + int* supported); + PedAlignment *(*get_partition_alignment)(const PedDisk *disk); +@@ -337,7 +340,9 @@ extern int ped_partition_is_flag_availab + extern int ped_partition_set_system (PedPartition* part, + const PedFileSystemType* fs_type); + extern int ped_partition_set_name (PedPartition* part, const char* name); ++extern int ped_partition_set_system_name (PedPartition* part, const char* name); + extern const char* ped_partition_get_name (const PedPartition* part); ++extern const char* ped_partition_get_system_name (const PedPartition* part); + extern int ped_partition_is_busy (const PedPartition* part); + extern char* ped_partition_get_path (const PedPartition* part); + +Index: parted-3.3/libparted/disk.c +=================================================================== +--- parted-3.3.orig/libparted/disk.c ++++ parted-3.3/libparted/disk.c +@@ -1185,6 +1185,39 @@ _disk_pop_update_mode (PedDisk* disk) + * @{ + */ + ++const char* ++ped_partition_get_system_name (const PedPartition* part) ++{ ++ PED_ASSERT (part != NULL); ++ PED_ASSERT (part->disk != NULL); ++ PED_ASSERT (ped_partition_is_active (part)); ++ ++ if (!ped_disk_type_check_feature ( ++ part->disk->type, PED_DISK_TYPE_SYSTEM_NAME)) ++ return NULL; /* silent skip */ ++ ++ PED_ASSERT (part->disk->type->ops->partition_get_system_name != NULL); ++ return part->disk->type->ops->partition_get_system_name (part); ++} ++ ++int ++ped_partition_set_system_name (PedPartition* part, const char* name) ++{ ++ PED_ASSERT (part != NULL); ++ PED_ASSERT (part->disk != NULL); ++ PED_ASSERT (ped_partition_is_active (part)); ++ PED_ASSERT (name != NULL); ++ ++ if (!ped_disk_type_check_feature ( ++ part->disk->type, PED_DISK_TYPE_SYSTEM_NAME)) ++ return 0; /* silent skip */ ++ ++ PED_ASSERT (part->disk->type->ops->partition_set_system_name != NULL); ++ part->disk->type->ops->partition_set_system_name (part, name); ++ return 1; ++} ++ ++ + PedPartition* + _ped_partition_alloc (const PedDisk* disk, PedPartitionType type, + const PedFileSystemType* fs_type, +Index: parted-3.3/libparted/labels/mac.c +=================================================================== +--- parted-3.3.orig/libparted/labels/mac.c ++++ parted-3.3/libparted/labels/mac.c +@@ -1396,6 +1396,36 @@ mac_get_partition_alignment(const PedDis + return ped_alignment_new(0, 1); + } + ++/* we do not really want to call this ... yet */ ++static void ++mac_partition_set_system_name (PedPartition* part, const char* name) ++{ ++ MacPartitionData* mac_data; ++ int i; ++ ++ PED_ASSERT (part != NULL); ++ PED_ASSERT (part->disk_specific != NULL); ++ mac_data = part->disk_specific; ++ ++ strncpy (mac_data->system_name, name, 32); ++ mac_data->system_name [32] = 0; ++ for (i = strlen (mac_data->system_name) - 1; ++ mac_data->system_name[i] == ' '; i--) ++ mac_data->system_name [i] = 0; ++} ++ ++static const char* ++mac_partition_get_system_name (const PedPartition* part) ++{ ++ MacPartitionData* mac_data; ++ ++ PED_ASSERT (part != NULL); ++ PED_ASSERT (part->disk_specific != NULL); ++ mac_data = part->disk_specific; ++ ++ return mac_data->system_name; ++} ++ + static PedConstraint* + _primary_constraint (PedDisk* disk) + { +@@ -1596,6 +1626,8 @@ static PedDiskOps mac_disk_ops = { + + partition_set_name: mac_partition_set_name, + partition_get_name: mac_partition_get_name, ++ partition_set_system_name: mac_partition_set_system_name, ++ partition_get_system_name: mac_partition_get_system_name, + + get_partition_alignment: mac_get_partition_alignment, + +@@ -1606,7 +1638,7 @@ static PedDiskType mac_disk_type = { + next: NULL, + name: "mac", + ops: &mac_disk_ops, +- features: PED_DISK_TYPE_PARTITION_NAME ++ features: PED_DISK_TYPE_PARTITION_NAME | PED_DISK_TYPE_SYSTEM_NAME + }; + + void +Index: parted-3.3/parted/parted.c +=================================================================== +--- parted-3.3.orig/parted/parted.c ++++ parted-3.3/parted/parted.c +@@ -946,6 +946,7 @@ + static char* + partition_print_flags (PedPartition const *part) + { ++ const char* sysname; + char *res = xstrdup (""); + if (!part) + return res; +@@ -967,6 +968,17 @@ + } + } + ++ sysname = ped_partition_get_system_name( part ); ++ if (sysname) { ++ char tmpstr[21]; ++ snprintf(tmpstr, sizeof(tmpstr) - 1, "type=%s", sysname); ++ size_t new_len = res_buf_len + strlen(sep) + strlen(tmpstr); ++ res = xrealloc(res, new_len); ++ stpcpy (stpcpy (res + res_buf_len - 1, sep), tmpstr); ++ res_buf_len = new_len; ++ sep = ", "; ++ } ++ + return res; + } + diff --git a/parted-mkpart-set-a-swap-flag-if-available.patch b/parted-mkpart-set-a-swap-flag-if-available.patch new file mode 100644 index 0000000..eb30c59 --- /dev/null +++ b/parted-mkpart-set-a-swap-flag-if-available.patch @@ -0,0 +1,46 @@ +From: Sebastian Parschauer +Date: Thu, 15 Jun 2017 18:50:32 +0200 +Subject: parted: mkpart: set a swap flag if available +References: fate#314888, bsc#1044536 +Patch-mainline: no, upstream wants to drop the swap flag + +libparted can't differentiate if ped_partition_set_system() is +called from mkpart context or when reading from disk. This makes +it hard to handle the linux-swap partition type properly. + +So check in do_mkpart() if a swap flag is available and only set it +there if the selected FS type name starts with "linux-swap". + +Signed-off-by: Sebastian Parschauer +--- + parted/parted.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +Index: parted-3.3/parted/parted.c +=================================================================== +--- parted-3.3.orig/parted/parted.c ++++ parted-3.3/parted/parted.c +@@ -656,6 +656,13 @@ _adjust_end_if_iec (PedSector* start, Pe + } + + ++static inline int ++is_linux_swap (char const *fs_type_name) ++{ ++ char const *prefix = "linux-swap"; ++ return strncmp (fs_type_name, prefix, strlen (prefix)) == 0; ++} ++ + static int + do_mkpart (PedDevice** dev, PedDisk** diskp) + { +@@ -852,6 +859,9 @@ do_mkpart (PedDevice** dev, PedDisk** di + goto error_remove_part; + if (ped_partition_is_flag_available (part, PED_PARTITION_LBA)) + ped_partition_set_flag (part, PED_PARTITION_LBA, 1); ++ if (ped_partition_is_flag_available (part, PED_PARTITION_SWAP) && ++ fs_type && is_linux_swap(fs_type->name)) ++ ped_partition_set_flag (part, PED_PARTITION_SWAP, 1); + + if (wipesignatures) { + if (!ped_device_wipe_signatures(*dev, part->geom.start, part->geom.length)) diff --git a/parted-print-max-partitions-for-yast.patch b/parted-print-max-partitions-for-yast.patch new file mode 100644 index 0000000..db78694 --- /dev/null +++ b/parted-print-max-partitions-for-yast.patch @@ -0,0 +1,24 @@ +From: Anna Maresova +Date: Wed Mar 25 18:17:28 CET 2020 +Subject: parted: print maximum number of partitions for yast +Patch-mainline: no, custom SUSE patch + +Index: parted-3.3/parted/parted.c +=================================================================== +--- parted-3.3.orig/parted/parted.c ++++ parted-3.3/parted/parted.c +@@ -1125,10 +1125,13 @@ _print_disk_info (const PedDevice *dev, + break; + + } +- printf ("%s:%s:%s:%lld:%lld:%s:%s:%s;\n", ++ printf ("%s:%s:%s:%lld:%lld:%s:%s:%s", + escaped_path, end, transport[dev->type], + dev->sector_size, dev->phys_sector_size, + pt_name, escaped_model, disk_flags); ++ if (getenv("PARTED_PRINT_NUMBER_OF_PARTITION_SLOTS")) ++ printf(":%lld", diskp && diskp->type->ops->get_max_primary_partition_count ? diskp->type->ops->get_max_primary_partition_count(diskp) : 0); ++ printf(";\n"); + free (escaped_path); + free (escaped_model); + } else if (opt_output_mode == JSON) { diff --git a/parted-wipeaix.patch b/parted-wipeaix.patch new file mode 100644 index 0000000..71af64f --- /dev/null +++ b/parted-wipeaix.patch @@ -0,0 +1,26 @@ +From: Petr Uzel +Subject: parted: dos: Wipe AIX FS signatures +Patch-mainline: no, custom SUSE patch +--- + libparted/labels/dos.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +Index: parted-3.3/libparted/labels/dos.c +=================================================================== +--- parted-3.3.orig/libparted/labels/dos.c ++++ parted-3.3/libparted/labels/dos.c +@@ -1287,7 +1287,13 @@ msdos_write (const PedDisk* disk) + return 0; + DosRawTable *table = (DosRawTable *) s0; + +- if (!table->boot_code[0]) { ++ /* either no bootrecord at all, or AIX IPL signature ... */ ++ if ( (!table->boot_code[0]) || ++ ( table->boot_code[0] == (char) 0xc9 && ++ table->boot_code[1] == (char) 0xc2 && ++ table->boot_code[2] == (char) 0xd4 && ++ table->boot_code[3] == (char) 0xc1) ++ ) { + memset (table, 0, 512); + memcpy (table->boot_code, MBR_BOOT_CODE, sizeof (MBR_BOOT_CODE)); + } diff --git a/parted.changes b/parted.changes new file mode 100644 index 0000000..f136087 --- /dev/null +++ b/parted.changes @@ -0,0 +1,1924 @@ +------------------------------------------------------------------- +Thu Jun 23 07:34:55 CEST 2022 - aschnell@suse.com + +- drop type flag (SUSE specific) to fix bsc#1190847 + refreshed patches: + - parted-mac.patch + - tests-adapt-to-SUSE.patch + drop patches: + - parted-type.patch + - parted-type-accept-hex.patch + - parted-json-no-type-flag.patch + +------------------------------------------------------------------- +Wed Jun 1 09:27:16 UTC 2022 - Dirk Müller + +- use static keyring file (and switch to the release team keyring) + +------------------------------------------------------------------- +Wed May 18 09:19:29 CEST 2022 - aschnell@suse.com + +- add new type command from upstream + added patches: + - type-command.patch + +------------------------------------------------------------------- +Wed Apr 20 09:11:11 CEST 2022 - aschnell@suse.com + +- update to version 3.5: + * Add support for JSON output. + * Add support for linux-home flag for GPT. + * Add --fix option. + added patches: + - direct-handling-of-partition-type-id-and-uuid.patch + - parted-json-no-type-flag.patch + refreshed patches: + - libparted-open-the-device-RO-and-lazily-switch-to-RW.patch + - parted-2.4-ncursesw6.patch + - parted-add-ignore-busy-option.patch + - parted-fix-resizepart-and-rm-command.patch + - parted-implement-wipesignatures-option.patch + - parted-print-max-partitions-for-yast.patch + - parted-type.patch + - tests-disable.patch + removed patches: + - parted-escape-printed-device-path.patch + - parted-mkpart-allow-empty-gpt-part-name.patch + +------------------------------------------------------------------- +Tue Oct 19 13:16:11 CEST 2021 - aschnell@suse.com + +- fixed name of shared library package and split off + libparted-fs-resize (bsc#1191778) + +------------------------------------------------------------------- +Tue Oct 19 09:48:22 UTC 2021 - Dominique Leuenberger + +- BuildRequire python3-base: Fix execution of test suite. Otherwise + we fail with + ./t0282-gpt-move-backup.sh: /usr/bin/python3: bad interpreter: No + such file or directory. + +------------------------------------------------------------------- +Mon Sep 20 07:35:15 CEST 2021 - aschnell@suse.com + +- run checks during build +- added patches: + tests-disable.patch + +------------------------------------------------------------------- +Mon Jul 26 16:50:36 CEST 2021 - aschnell@suse.com + +- update to version 3.4: + * Add new partition type flags chromeos_kernel and bls_boot. + * Add support for the F2FS filesystem. + refreshed patches: + - dummy-bootcode-only-for-x86.patch + - parted-fix-resizepart-and-rm-command.patch + - parted-type.patch + - parted-wipeaix.patch + - tests-adapt-to-SUSE.patch + removed patches: + - parted-fix-end_input-usage.patch + - parted-resize-alias-to-resizepart.patch + +------------------------------------------------------------------- +Fri Mar 19 13:51:01 UTC 2021 - jeffm@suse.com + +- Direct file system manipulation support was removed in 2011. + - Removed build dependencies on libreiserfs-devel and + e2fsprogs-devel. + +------------------------------------------------------------------- +Tue Aug 25 18:24:26 CEST 2020 - ro@suse.de + +- re-add missing hunk to fix bsc#1164907 + parted-type-accept-hex.patch + type on the cmdline could be specified in hex as 0x82 + +------------------------------------------------------------------- +Wed Apr 8 17:37:47 UTC 2020 - Anna Maresova + +- print maximum number of partitions for yast + (bsc#1168756, bsc#1161783) + - add parted-print-max-partitions-for-yast.patch +- make parted work with pmemXs devices (bsc#1164260) + - add libparted-linux-pmem-path.patch + +------------------------------------------------------------------- +Fri Jan 3 14:46:27 UTC 2020 - Anna Maresova + +- fix crash in do_resizepart + + parted-fix-end_input-usage.patch: Fix end_input usage in + do_resizepart + +------------------------------------------------------------------- +Fri Nov 22 14:25:28 UTC 2019 - Anna Maresova + +- update to version 3.3, noteworthy changes: + - s390: Re-enabled virtio-attached DASD heuristics by using + HDIO_GETGEO when probing device geometry. Fixes a bug with + KVM virtio-blk backed by a DASD. + Parted now recognizes NVMe devices, NVDIMM, and RAM drives. + - Fix atari disklabel false positives by probing other labels first. + - Fix resizepart to adjust the end to be -1 sector when using iec + power of 2 units so that the next partition can start immediately + following the new end, just like mkpart does. + - Fix set and disk_set to not crash when there are no flags to set. + - Fix a udev cookie leak when using resizepart on device-mapper devices. + - Fix a gettext crash/error sometimes when using localized languages. + - Fix fat resize to preverve boot code, and thus not render the + filesystem unreconized by Windows. + - Fix rescue command: the rescue command often failed to find + filesystems due to leaving on cylinder alignment. + - libparted-fs-resize: Prevent crash resizing FAT file systems with very + deep directories with path names over 512 bytes long. + - Use 512b sector size when communicating with device-mapper. Fixes + problems with partitions being created too small on dm devices + with sector sizes > 5121b + - Don't crash in the disk_set command when a disk label is not found + - libparted-fs-resize: Prevent crash resizing FAT16 file systems. + - libparted-fs-resize: Prevent crash resizing FAT16 file systems. + - If the user specifies start/end of the partition as cylinders + and a cylinder has a size which is power of 2, then such address + does not trigger exact placement. + - mkpart: Allow negative start value when FS-TYPE is not given +- remove following patches (now in upstream): + - 0001-fdasd-geometry-handling-updated-from-upstream-s390-t.patch + - 0002-dasd-enhance-device-probing.patch + - 0003-parted-fix-build-error-on-s390.patch + - 0004-fdasd.c-Safeguard-against-geometry-misprobing.patch + - 0005-libparted-Remove-fdasd-geometry-code-from-alloc_meta.patch + - clean-the-disk-information-when-commands-fail-in-int.patch + - lib-fs-resize-prevent-crash-resizing-FAT16.patch + - libpartd-dasd-improve-flag-processing-for-DASD-LDL.patch + - libparted-Add-support-for-NVDIMM-devices.patch + - libparted-Add-support-for-NVMe-devices.patch + - libparted-Add-support-for-RAM-drives.patch + - libparted-BLKPG_RESIZE_PARTITION-uses-bytes.patch + - libparted-Use-read-only-when-probing-devices-on-linu.patch + - libparted-allow-bigger-snap-radius-if-cylinders-are-used.patch + - libparted-dasd-add-an-exception-for-changing-DASD-LD.patch + - libparted-dasd-add-new-fdasd-functions.patch + - libparted-dasd-add-test-cases-for-the-new-fdasd-func.patch + - libparted-dasd-correct-the-offset-where-the-first-pa.patch + - libparted-dasd-unify-vtoc-handling-for-cdl-ldl.patch + - libparted-dasd-update-and-improve-fdasd-functions.patch + - libparted-device-mapper-uses-512b-sectors.patch + - libparted-dont-warn-if-no-HDIO_GET_IDENTITY.patch + - libparted-fix-starting-CHS-in-protective-MBR.patch + - libparted-fix-udev-cookie-leak.patch + - libparted-make-sure-not-to-treat-percentages-and-cyls-as-exact.patch + - libparted-set-swap-flag-on-GPT-partitions.patch + - libparted-sysmacros.patch + - parted-3.2.tar.xz + - parted-3.2.tar.xz.sig + - parted-check-the-name-of-partition-first-when-to-nam.patch + - parted-dont-crash-in-disk_set-when-disk-label-not-found.patch + - parted-fix-crash-due-to-improper-partition-number-in.patch + - parted-fix-wrong-error-label-jump-in-mkpart.patch + - parted-ui-remove-unneccesary-information-of-command.patch + - tests-check-extended-partition-length.patch + - tests-increase-scsi_debug-tmo.patch + - tests-set-optimal-blocks-for-scsi_debug.patch + - tests-update-t0220-t0280-for-swap-flag.patch + - tests-use-wait_for_dev_to_-functions.patch + - tests-wait_for_-loop.patch +- backported or refreshed remaining patches + +------------------------------------------------------------------- +Wed Jul 10 10:16:16 UTC 2019 - Anna Maresova + +- changed: parted-fix-crash-due-to-improper-partition-number-in.patch + Changed the patch to behave in the same way like before last change + for numbers with leading zeroes. + +------------------------------------------------------------------- +Mon Jul 1 14:14:36 UTC 2019 - Anna Maresova + +- port fixes for various bugs from upstream (bsc#1136245) + - add: libparted-dasd-correct-the-offset-where-the-first-pa.patch + 4126d02, correct the offset where the first partition begins. + This patch implements libparted-dasd-do-not-use-first-tracks.patch + - remove: libparted-dasd-do-not-use-first-tracks.patch + - add: parted-fix-crash-due-to-improper-partition-number-in.patch + 149f009, fix crash due to improper partition number input, + changed call to strtol, use base 0 to fit our parted-type.patch + - modify: parted-type.patch (removed ui.c part) + - add: parted-check-the-name-of-partition-first-when-to-nam.patch + d7a2ff1, check the name of partition first when to name a partition + - add: libparted-dasd-add-test-cases-for-the-new-fdasd-func.patch + c11f5c0, 571e078, add test cases for the new fdasd functions + - add: libparted-dasd-add-an-exception-for-changing-DASD-LD.patch + ee2c0c2, add an exception for changing DASD-LDL partition table + - add: libpartd-dasd-improve-flag-processing-for-DASD-LDL.patch + 1545d6d, improve flag processing for DASD-LDL + - add: clean-the-disk-information-when-commands-fail-in-int.patch + 5a61f15, clean the disk information when commands fail in + interactive mode + - add: parted-ui-remove-unneccesary-information-of-command.patch + 0b7946a, remove unneccesary information of command line + - add: parted-fix-wrong-error-label-jump-in-mkpart.patch + af150f6, fix wrong error label jump in mkpart + - refresh: libparted-dasd-unify-vtoc-handling-for-cdl-ldl.patch + 4f25d54, unify vtoc handling for cdl/ldl + - refresh: libparted-dasd-update-and-improve-fdasd-functions.patch + db37c8c, update and improve fdasd functions + - refresh: libparted-dasd-add-new-fdasd-functions.patch + b9e1281, add new fdasd functions + +------------------------------------------------------------------- +Wed Aug 1 14:49:47 UTC 2018 - sparschauer@suse.de + +- libparted: Include for major() macro with + glibc >= 2.27 + - add: libparted-sysmacros.patch + +------------------------------------------------------------------- +Thu May 24 15:57:24 CEST 2018 - kukuk@suse.de + +- Use %license instead of %doc [bsc#1082318] + +------------------------------------------------------------------- +Tue Feb 20 15:11:35 UTC 2018 - sparschauer@suse.de + +- libparted: Canonicalize /dev/md/ paths (bsc#1078820) + - add: libparted-canonicalize-dev-md-paths.patch + - add: tests-add-helper-require_swap_.patch + - add: tests-add-dev-md-check-to-t6100.patch + +------------------------------------------------------------------- +Mon Feb 19 16:01:51 UTC 2018 - sparschauer@suse.de + +- libparted: Fix partition device naming for all devices + (bsc#1078820, bsc#1081547) + - The "_part%d" suffix which has been used for SLE10 compatibility + is wrong now as the kernel does not use that any more and + uses "p%d" instead. + - amend: libparted-partition-naming.patch + - refresh: libparted-fix-nvme-partition-naming.patch + - refresh: libparted-fix-NVDIMM-partition-naming.patch + +------------------------------------------------------------------- +Fri Jan 26 15:22:20 UTC 2018 - sparschauer@suse.de + +- libparted: dasd: Use BLKRRPART only when needed (bsc#1065197, + bsc#1067435) + - add: libparted-use-BLKRRPART-only-when-needed.patch + +------------------------------------------------------------------- +Fri Dec 22 17:23:25 CET 2017 - sparschauer@suse.de + +- Amend patch headers (no functional change) + +------------------------------------------------------------------- +Tue Dec 19 17:23:10 UTC 2017 - sparschauer@suse.de + +- fatresize: Fix getting the device name from partition name + (boo#959181) + - add: fatresize-fix-getting-dev-name.patch + +------------------------------------------------------------------- +Tue Nov 21 09:26:23 UTC 2017 - sebastian.parschauer@suse.com + +- Fix the resizepart and rm command (bsc#1058667) + - fix asking for the partition end for resizepart in interactive mode + when the partition is busy + - allow resizepart shrinking and rm of busy partitions in script mode + by adding the --ignore-busy option + - allow growing busy partitions in script mode by default + - print a warning when shrinking a non-busy partition in script mode + - fix help text printing of long options without short option + - remove: parted-do-not-warn-when-shrinking-in-script-mode.patch + - add: parted-add-ignore-busy-option.patch + - add: parted-fix-resizepart-and-rm-command.patch + +------------------------------------------------------------------- +Mon Nov 13 17:17:40 CET 2017 - sparschauer@suse.de + +- Escape printed device path in machine mode (bsc#1066467) + - add: parted-escape-printed-device-path.patch + +------------------------------------------------------------------- +Mon Oct 23 18:18:36 CEST 2017 - sparschauer@suse.de + +- Add support for NVDIMM devices (bsc#1064446) + - add: libparted-Add-support-for-NVDIMM-devices.patch + - add: libparted-fix-NVDIMM-partition-naming.patch) + +------------------------------------------------------------------- +Wed Sep 20 10:00:07 UTC 2017 - sparschauer@suse.de + +- Prepare to fix the resizepart command (bsc#1058667) + - add: libparted-BLKPG_RESIZE_PARTITION-uses-bytes.patch + - add: libparted-fix-udev-cookie-leak.patch + - add: tests-check-extended-partition-length.patch + +------------------------------------------------------------------- +Wed Sep 13 13:54:45 UTC 2017 - sparschauer@suse.de + +- Make SUSE parted pass all tests in upstream test suite + - add: tests-set-optimal-blocks-for-scsi_debug.patch + - add: tests-increase-scsi_debug-tmo.patch + - add: tests-use-wait_for_dev_to_-functions.patch + - add: tests-wait_for_-loop.patch + - add: tests-update-t0220-t0280-for-swap-flag.patch + - add: tests-adapt-to-SUSE.patch + +------------------------------------------------------------------- +Wed Sep 13 10:30:16 CEST 2017 - sparschauer@suse.de + +- Fix partition naming for dm devices not ending in a digit and + also fix resizing of dm partitions (bsc#1056508) + - amend: libparted-partition-naming.patch + +------------------------------------------------------------------- +Thu Aug 24 16:51:37 CEST 2017 - sparschauer@suse.de + +- Drop using deprecated configure option "--disable-Werror" +- Drop (SUSE specific) support for hybrid pMBR (gpt_sync_mbr + label) (fate#317849, bsc#1041322) + - remove: parted-gpt-mbr-sync.patch + - remove: libparted-ppc-prepboot-in-syncmbr.patch + - remove: parted-workaround-windows7-gpt-implementation.patch + - refresh patches +- libparted: Fix starting CHS in protective MBR (bsc#969165) + - add: libparted-fix-starting-CHS-in-protective-MBR.patch + +------------------------------------------------------------------- +Tue Aug 15 17:21:02 CEST 2017 - sparschauer@suse.de + +- Fix s390x --wipesignatures regression caused by fate#320525 + (bsc#1047031) + - amend: parted-implement-wipesignatures-option.patch + - refresh: 0002-dasd-enhance-device-probing.patch + +------------------------------------------------------------------- +Fri Aug 11 16:15:08 CEST 2017 - sparschauer@suse.de + +- Amend parsing of empty GPT partition names to require quoted + empty strings '""' or "''" (bsc#1023818, boo#1032562) + - amend: parted-mkpart-allow-empty-gpt-part-name.patch + +------------------------------------------------------------------- +Thu Aug 10 16:44:57 CEST 2017 - sparschauer@suse.de + +- parted: mkpart: Allow empty string "" for the GPT partition name + in script mode (bsc#1023818, boo#1032562) + - add: parted-mkpart-allow-empty-gpt-part-name.patch + +------------------------------------------------------------------- +Thu Jun 15 20:28:08 CEST 2017 - sparschauer@suse.de + +- Add a swap flag for dasd/gpt and handle it like gdisk/fdasd + (bsc#1044536, fate#314888) + - add: parted-mkpart-set-a-swap-flag-if-available.patch + - add: libparted-set-swap-flag-on-GPT-partitions.patch + - add: libparted-dasd-add-swap-flag-handling-for-DASD-CDL.patch + +------------------------------------------------------------------- +Wed May 24 17:15:17 CEST 2017 - sparschauer@suse.de + +- Fix printing DASD/CDL partition flags "lvm" and "raid" + (bsc#1040163, fate#314888) + - add: libparted-dasd-improve-lvm-raid-flag-handling.patch + +------------------------------------------------------------------- +Tue May 16 15:28:47 CEST 2017 - sparschauer@suse.de + +- Enhance fdasd detection and probing (bsc#935127, fate#320525) + - add: 0001-fdasd-geometry-handling-updated-from-upstream-s390-t.patch + - add: 0002-dasd-enhance-device-probing.patch + - add: 0003-parted-fix-build-error-on-s390.patch + - add: 0004-fdasd.c-Safeguard-against-geometry-misprobing.patch + - add: 0005-libparted-Remove-fdasd-geometry-code-from-alloc_meta.patch + - refresh: libparted-dasd-update-and-improve-fdasd-functions.patch + - refresh: libparted-dasd-add-new-fdasd-functions.patch + +------------------------------------------------------------------- +Thu May 11 12:53:20 CEST 2017 - sparschauer@suse.de + +- Add support for RAM drives for not erasing them when printing + their partitions (bsc#1006834) + - add: libparted-Add-support-for-RAM-drives.patch + +------------------------------------------------------------------- +Tue May 2 10:45:37 CEST 2017 - sparschauer@suse.de + +- Use latest fdasd/vtoc code base from s390-tools (fate#321531) + - add: libparted-dasd-unify-vtoc-handling-for-cdl-ldl.patch + - add: libparted-dasd-update-and-improve-fdasd-functions.patch + - add: libparted-dasd-add-new-fdasd-functions.patch + +------------------------------------------------------------------- +Thu Apr 27 17:37:19 CEST 2017 - sparschauer@suse.de + +- libparted: Don't warn if the HDIO_GET_IDENTITY ioctl isn't + supported (bsc#964012, bsc#1001967) + - add: libparted-dont-warn-if-no-HDIO_GET_IDENTITY.patch +- Amend patch description: + - libparted-open-the-device-RO-and-lazily-switch-to-RW.patch + +------------------------------------------------------------------- +Tue Aug 9 14:36:20 CEST 2016 - sparschauer@suse.de + +- Sync with SLES-12 SP2 for bsc#979275 + - amend: libparted-open-the-device-RO-and-lazily-switch-to-RW.patch + +------------------------------------------------------------------- +Tue Aug 9 14:04:47 CEST 2016 - sparschauer@suse.de + +- Correctly flush caches before reading from the device + (bsc#989751) + - amend: libparted-open-the-device-RO-and-lazily-switch-to-RW.patch + - refresh: libparted-Add-support-for-NVMe-devices.patch + +------------------------------------------------------------------- +Sat Jun 18 07:08:01 UTC 2016 - jengelh@inai.de + +- install_info should run in %preun; otherwise the files to operate + are gone already. +- Drop with-pic: only useful for static libs (which are not built) + +------------------------------------------------------------------- +Tue Jun 14 11:09:20 UTC 2016 - puzel@suse.com + +- Detect NVMe devices and fix the nvme partition naming scheme + (bsc#982169) + - libparted-Add-support-for-NVMe-devices.patch + - libparted-fix-nvme-partition-naming.patch + +------------------------------------------------------------------- +Thu May 26 10:46:38 UTC 2016 - puzel@suse.com + +- Update parted-implement-wipesignatures-option.patch: + - Move functionality to libparted (bsc#980834) +- libparted: open the device RO and lazily switch to RW only if + necessary (bsc#979275) + - libparted-open-the-device-RO-and-lazily-switch-to-RW.patch + +------------------------------------------------------------------- +Wed May 18 07:23:08 UTC 2016 - puzel@suse.com + +- implement --wipesignatures option (bsc#943623, fate#319893) + - parted-implement-wipesignatures-option.patch + +------------------------------------------------------------------- +Fri Mar 11 11:20:12 UTC 2016 - puzel@suse.com + +- libparted: Use read only when probing devices on linux + - libparted-Use-read-only-when-probing-devices-on-linu.patch + (bsc#967375) + +------------------------------------------------------------------- +Thu Sep 10 09:18:30 UTC 2015 - fvogt@suse.com + +- Update parted-gpt-mbr-sync.patch to fix bsc#945068 + Basically just a copy of gpt_alloc with minor modifications now + +------------------------------------------------------------------- +Tue May 26 11:21:37 UTC 2015 - puzel@suse.com + +- Remove 'udevadm' from Requires; parted no longer calls 'udevadm + settle' + +------------------------------------------------------------------- +Thu May 21 06:42:51 UTC 2015 - puzel@suse.com + +- Add note to specfile to remove parted-resize-alias-to-resizepart.patch + compatibility patch once bnc#931765 is resolved. + +------------------------------------------------------------------- +Tue May 5 13:39:24 UTC 2015 - puzel@suse.com + +- Do not warn about shrinking a partition if script mode is used + (bnc#929189) + - add: parted-do-not-warn-when-shrinking-in-script-mode.patch + +------------------------------------------------------------------- +Wed Feb 11 15:01:56 UTC 2015 - puzel@suse.com + +- Update to parted-3.2; Notable changes: + - Added new partition type flag, esp, to set the type to 0xEF on + MS-DOS. Also aliased to boot on GPT to set the UEFI ESP GUID. + - You can now choose to ignore errors about partitions that + overlap, or are longer than the disk. This allows you to use + parted to repair the problem. + - When attempting to manipulate a mounted partition, parted now + issues a warning that you can choose to ignore, instead of an + error. + - When creating a loop label, it automatically comes with a + partition using the whole disk. + - parted -l no longer lists device-mapper devices other than + dmraid whole disks. + - Added new Linux-specific partition GUID type code + (0FC63DAF-8483-4772-8E79-3D69D8477DE4) for Linux filesystem + data on GPT disks. This type code is now assigned as the + default partition type code for new partitions holding Linux + filesystems. + - Added new "msftdata" flag to identify partitions holding NTFS + or FAT filesystems on GPT disks. This flag corresponds to a + GPT type code of EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 + ("Microsoft Basic Data"). Since Linux filesystem partitions + formerly used this type code, this flag may optionally be set + on Linux partitions to make the partition table type codes + match former configurations in case the new Linux filesystem + type code causes problems with some utility. Note that this + flag cannot be removed from NTFS or FAT partitions within + parted except by setting a competing flag, such as "boot" + (which sets the type code used by EFI System partitions) or + "msftres" (which sets the "Microsoft Reserved" type code). + - Many bugfixes (see /usr/share/doc/packages/parted/NEWS) +- merge parted-fix-cciss-partition-naming.patch, + libparted-fix-mmcblk-partition-name.patch, + fix-dm-partition-name.patch + into libparted-partition-naming.patch +- Add parted-resize-alias-to-resizepart.patch +- Add libparted-avoid-libdevice-mapper-warnings.patch +- drop patches (in upstream): + - fix-error-informing-the-kernel.patch + - Fix-help-text-for-disk_-set-toggle.patch + - libparted-Avoid-dasd-as-default-disk-type-while-probe.patch + - libparted-add-support-for-EAV-DASD-partitions.patch + - libparted-add-support-for-implicit-FBA-DASD-partition.patch + - libparted-copy-pmbr_boot-when-duplicating-GPT-disk.patch + - libparted-initialize-dasd-part-type.patch + - libparted-mklabel-to-support-EAV-DASD.patch + - libparted-mklabel-to-support-EDEV-DASD.patch + - parted-Add-Intel-Rapid-Start-Technology-partition.patch + - parted-GPT-add-support-for-PReP-GUID.patch + - parted-btrfs-support.patch + - parted-resize-command.patch +- drop do-not-create-dm-nodes.patch: Not needed anymore since + parted DM handling has been reworked. +- modified more-reliable-informing-the-kernel.patch: No longer + call 'udevadm settle' as it was causing issues. +- add patches from upstream (post-3.2): + - lib-fs-resize-prevent-crash-resizing-FAT16.patch + - libparted-device-mapper-uses-512b-sectors.patch + - parted-dont-crash-in-disk_set-when-disk-label-not-found.patch +- refresh patches + +------------------------------------------------------------------- +Fri Nov 14 09:18:50 UTC 2014 - dimstar@opensuse.org + +- No longer perform gpg validation; osc source_validator does it + implicit: + + Drop gpg-offline BuildRequires. + + No longer execute gpg_verify. + +------------------------------------------------------------------- +Thu Sep 11 10:30:04 UTC 2014 - puzel@suse.com + +- Add an "implicit_partition_table" disk flag to mark + FBA DASD disks with fake partition (bnc#894585) + - libparted-dasd-implicit-partition-disk-flag.patch +- refresh following patches to fix build: + - parted-type.patch + - parted-mac.patch + - parted-Add-Intel-Rapid-Start-Technology-partition.patch + +------------------------------------------------------------------- +Sat Sep 6 21:47:27 UTC 2014 - andreas.stieger@gmx.de + +- Keyring contained no less than 374 public keys. + Replace with project members only keyring from project page. + +------------------------------------------------------------------- +Mon Aug 18 15:28:56 UTC 2014 - fcrozat@suse.com + +- Add obsoletes/provides to baselibs.conf. + +------------------------------------------------------------------- +Fri Jul 25 15:43:42 UTC 2014 - puzel@suse.com + +- Fix a bug where cylinders can be treated by parted as exact + location, which prevents it from adjusting partition/start end. + (bnc#880369) + - libparted-make-sure-not-to-treat-percentages-and-cyls-as-exact.patch + +------------------------------------------------------------------- +Fri Jul 18 10:10:07 UTC 2014 - puzel@suse.com + +- Make informing the kernel by BLKRRPART (specific to s390) more + robust by sleeping between every retry and by placing + exclusive file lock on the blockdevice (bnc#886005) + - libparted-make-BLKRRPART-more-robust.patch + +------------------------------------------------------------------- +Wed Jul 16 13:14:09 UTC 2014 - puzel@suse.com + +- Improve DASD label handling; backport following patches + from upstream (bnc#887333): + - libparted-add-support-for-implicit-FBA-DASD-partition.patch + - libparted-add-support-for-EAV-DASD-partitions.patch + - libparted-mklabel-to-support-EAV-DASD.patch + - libparted-Avoid-dasd-as-default-disk-type-while-probe.patch + - libparted-mklabel-to-support-EDEV-DASD.patch + +------------------------------------------------------------------- +Thu May 29 12:55:29 UTC 2014 - puzel@suse.com + +- Allow bigger snap radius if cylinders are used as units + (bnc#879387): + - add: libparted-allow-bigger-snap-radius-if-cylinders-are-used.patch + +------------------------------------------------------------------- +Tue May 20 10:27:17 UTC 2014 - puzel@suse.com + +- Fix the help text to show *disk* flags instead of partition flags + (bnc#872054): + - add: Fix-help-text-for-disk_-set-toggle.patch + +------------------------------------------------------------------- +Tue Apr 29 13:06:09 UTC 2014 - puzel@suse.com + +- Support setting boot flag in pMBR (bnc#872054): + - drop: revert-gpt-add-commands-to-manipulate-pMBR-boot-flag.patch + - add: libparted-copy-pmbr_boot-when-duplicating-GPT-disk.patch + - refresh patches + +------------------------------------------------------------------- +Mon Feb 17 13:32:19 UTC 2014 - puzel@suse.com + +- Fixup last commit - call BLKRRPART only for DASDs +- added patches: + * libparted-use-BLKRRPART-for-DASD.patch.patch +- removed patches: + * revert-libparted-remove-now-worse-than-useless-_kern.patch + * revert-linux-remove-DASD-restriction-on-_disk_sync_p.patch +------------------------------------------------------------------- +Fri Feb 14 08:30:06 UTC 2014 - puzel@suse.com + +- Use BLKRRPART on DASD disks (instead of BLKPG_*) (bnc#862139) +- added patches: + * revert-libparted-remove-now-worse-than-useless-_kern.patch + * revert-linux-remove-DASD-restriction-on-_disk_sync_p.patch + +------------------------------------------------------------------- +Thu Feb 13 15:40:56 UTC 2014 - puzel@suse.com + +- reserve first 2 tracks on DASD disks for metadata (bnc#862138) + * add: libparted-dasd-do-not-use-first-tracks.patch +- initialize memory for newly allocated partition (bnc#862138) + * add: libparted-initialize-dasd-part-type.patch + +------------------------------------------------------------------- +Fri Jan 24 13:17:34 UTC 2014 - puzel@suse.com + +- include new fatresize(8) utility +- added patches: + * parted-fatresize-autoconf.patch + +------------------------------------------------------------------- +Wed Jan 22 16:15:13 UTC 2014 - puzel@suse.com + +- Do not fail when shrinking the partition in non-interactive mode. +- modified patches: + * parted-resize-command.patch + +------------------------------------------------------------------- +Wed Jan 8 15:32:34 UTC 2014 - puzel@suse.com + +- update to parted-3.1 (fate#316110) +- changes in parted-3.1: + * Changes in behavior + - Floppy drives are no longer scanned on linux: they cannot be + partitioned anyhow, and some users have a misconfigured BIOS + that claims to have a floppy when they don't, and scanning + gets hung up. + - parted: the mkpart command has changed semantics with regard + to specifying the end of the partition. If the end is + specified using units of MiB, GiB, etc., parted subtracts one + sector from the specified value. With this change, it is now + possible to create partitions like 1MiB-2MiB, 2MiB-3MiB and + so on. + * Many bugfixes (see changelog) +- changes in parted-3.0: + * Changes in behavior + - Remove all FS-related (file system-related) sub-commands; + these commands are no longer recognized because they were all + dependent on parted "knowing" too much about file system: + mkpartfs, mkfs, cp, move, check. + - 'resize' command changed semantics: + it no longer resizes the filesystem, but only moves end + sector of the partition +- libparted-devel contains libparted-fs-resize library +- add ability to change size of the partition (ignoring contained + filesystem) with 'resize' command; this command has different + semantics than the former 'resize' command which upstream + decided to drop + - parted-resize-command.patch (fate#316110) +- when using syncmbr on POWER, make the first partition type 0x41 + (PReP boot) (bnc#797485) + - add libparted-ppc-prepboot-in-syncmbr.patch +- support for PReP GUID (bnc#797485) + - parted-GPT-add-support-for-PReP-GUID.patch +- Build requires makeinfo +- drop fix-function-def.patch (not needed) +- drop parted-stdio.h.patch (not needed) +- drop parted-use-ext-range.patch (upstream) +- drop fix-nilfs2-probe-function.patch (upstream) +- drop parted-improve-loop-support.patch (upstream) +- drop always-resize-part.dif (FS support removed) +- merged following hybrid pMBR patches: + parted-gpt-mbr-sync.patch, + parted-gpt-sync-mbr-label.patch, + parted-fix-gpt-sync-on-BE-systems.patch + +------------------------------------------------------------------- +Mon Dec 30 09:15:06 UTC 2013 - puzel@suse.com + +- Fix partition device names on MMC devices (bnc#847580) + - libparted-fix-mmcblk-partition-name.patch + +------------------------------------------------------------------- +Tue Sep 17 08:27:12 UTC 2013 - mlin@suse.com + +- Add parted-Add-Intel-Rapid-Start-Technology-partition.patch: + * Add Intel Fast Flash(iFFS) partition type support for Intel Rapid + Start Technology. Added type 0x84 on MS-DOS and + D3BFE2DE-3DAF-11DF-BA40-E3A556D89593 on GPT disk type. + +------------------------------------------------------------------- +Mon Apr 22 15:06:02 UTC 2013 - puzel@suse.com + +- fix hybrid pMBR (gpt_sync_mbr) on BE systems (bnc#809205) + - parted-fix-gpt-sync-on-BE-systems.patch +- detect btrfs filesystem (bnc#810779) + - parted-btrfs-support.patch + +------------------------------------------------------------------- +Mon Apr 15 12:24:12 UTC 2013 - idonmez@suse.com + +- Add Source URL, see https://en.opensuse.org/SourceUrls +- Add GPG checking + +------------------------------------------------------------------- +Wed Nov 21 10:32:05 UTC 2012 - puzel@suse.com + +- add fix-error-informing-the-kernel.patch: + Informing the kernel about partition changes still fails if first + logical partition starts right after the extended partition. Fix + it. + +------------------------------------------------------------------- +Thu Sep 27 13:40:56 UTC 2012 - puzel@suse.com + +- add parted-workaround-windows7-gpt-implementation.patch + (bnc#781688) + +------------------------------------------------------------------- +Fri Jul 27 09:14:44 UTC 2012 - aj@suse.de + +- Fix build with missing gets declaration (glibc 2.16) + +------------------------------------------------------------------- +Tue Jul 3 13:31:20 UTC 2012 - puzel@suse.com + +- copy dummy bootcode to MBR only on x86 because it can cause + problems to certain ARM machine (bnc#769789) + - add: dummy-bootcode-only-for-x86.patch + +------------------------------------------------------------------- +Tue Apr 17 13:59:13 UTC 2012 - puzel@suse.com + +- fix informing the kernel about partitions on cciss devices + (bnc#757225) + - add: parted-fix-cciss-partition-naming.patch + +------------------------------------------------------------------- +Fri Dec 30 08:42:23 UTC 2011 - puzel@suse.com + +- fix crash in nilfs2 probe function if there is tiny (1s) + partition on the disk (bnc#735763) + - fix-nilfs2-probe-function.patch + +------------------------------------------------------------------- +Sun Nov 20 06:27:06 UTC 2011 - coolo@suse.com + +- add libtool as buildrequire to avoid implicit dependency + +------------------------------------------------------------------- +Wed Oct 26 17:22:16 UTC 2011 - puzel@suse.com + +- improve loop support, fix geometry reporting on loopback devices: + parted-improve-loop-support.patch (bnc#726603) + +------------------------------------------------------------------- +Mon Sep 26 08:41:49 UTC 2011 - puzel@suse.com + +- improve parted-gpt-sync-mbr-label.patch: do not + sync partitions that can not be represented by the DOS label + (bnc#710402) + +------------------------------------------------------------------- +Wed Sep 7 15:05:08 UTC 2011 - puzel@suse.com + +- change do-not-create-dm-nodes.patch so that parted does + not remove dm partition mappings and leaves the job up + to kpartx -u called via udev + (bnc#712177, bnc#679780) + +------------------------------------------------------------------- +Mon Sep 5 12:08:48 UTC 2011 - puzel@suse.com + +- add parted-use-ext-range.patch (bnc#715695) + +------------------------------------------------------------------- +Thu Aug 25 10:22:09 UTC 2011 - puzel@novell.com + +- add parted-gpt-sync-mbr-label.patch (bnc#710402) + - this patch implements support for special label 'gpt-sync-mbr' + +------------------------------------------------------------------- +Tue Aug 16 09:07:50 UTC 2011 - puzel@novell.com + +- update parted-gpt-mbr-sync.patch so that it no longer + creates synced partitions one sector shorter (bnc#700465) + +------------------------------------------------------------------- +Sun Jul 31 01:50:07 UTC 2011 - crrodriguez@opensuse.org + +- Use ncursesw6 instead of plain-old ncurses5 +- Disable automake silent rules + +------------------------------------------------------------------- +Thu May 19 13:05:08 UTC 2011 - puzel@novell.com + +- update to parted-2.4 + * Bug fixes + - parted no longer allows the modification of certain in-use + partitions. In particular, before this fix, parted would + permit removal or modification of any in-use partition on a + dmraid and any in-use partition beyond the 15th on a regular + scsi disk. + - Improve support of DASD devices on the s390 architecture. + Parted now supports all DASD types (CKD and FBA), DASD formats + (CDL, LDL, CMS non-reserved, and CMS reserved), and DASD + drivers (ECKD, FBA, and DIAG) in all combinations supported by + the Linux kernel. As before, only CDL format on CKD DASD using + the ECKD driver is supported for read-write operations (create, + delete, move, re-size, etc.). However, the implicit partition + present on LDL- and CMS-formatted disks is now correctly + recognized for read-only operations. In detail: + - parted now correctly handles LDL-format disks with a block + size other than 4096 (bug fix) + - parted now recognizes the CMS disk format, both reserved and + non-reserved (enhancement) + - parted now supports FBA DASD devices (enhancement) + - parted now supports the DIAG driver when running in a virtual + machine under z/VM (enhancement) + - libparted: raise the limit on the maximum start sector and the + maximum number of sectors in a "loop" partition table from 2^32 + to 2^64. + - libparted once again recognizes a whole-disk FAT partition + - libparted now recognizes scsi disks with a high major (128-135) + as scsi disks + - an msdos partition table on a very small device (smaller than + one cylinder) is now recognized. + - libparted: zero-length devices (other than files) are ignored + rather than throwing an exception. + - libparted: gpt label creation can no longer divide by zero with + a defective device or when a concurrent writer modifies the + PE-size bytes in the small interval between the write and + subsequent read of the primary GPT header. + * Changes in behavior + - "parted $dev print" now prints information about the device + (model, size, transport, sector size) even when it fails to + recognize the disk label. + - specifying partition start or end values using MiB, GiB, etc. + suffixes now makes parted do what I want, i.e., use that + precise value, and not some other that is up to 500KiB or + 500MiB away from what I specified. Before, to get that + behavior, you would have had to use carefully chosen values + with units of bytes ("B") or sectors ("s") to obtain the same + result, and with sectors, your usage would not be portable + between devices with varying sector sizes. This change does + not affect how parted handles suffixes like KB, MB, GB, etc. +- drop always_print_geom.diff (merged upstream) + +------------------------------------------------------------------- +Thu Dec 9 09:44:33 UTC 2010 - puzel@novell.com + +- add more-reliable-informing-the-kernel.patch (bnc#657360) + +------------------------------------------------------------------- +Tue Nov 9 12:16:04 UTC 2010 - puzel@novell.com + +- updated always_print_geom.diff to print also physical/logical + sector size (patch by Arvin Schnell) + +------------------------------------------------------------------- +Fri Sep 17 14:47:04 UTC 2010 - puzel@novell.com + +- package according to shared library policy: split libparted0 +- add build dependencies on libblkid and libuuid + +------------------------------------------------------------------- +Fri Sep 17 13:47:05 UTC 2010 - puzel@novell.com + +- fix always-resize-part.dif (bnc#639579) + +------------------------------------------------------------------- +Wed Aug 11 08:45:56 UTC 2010 - puzel@novell.com + +- update parted-type.patch (bnc#630009) + +------------------------------------------------------------------- +Thu Jul 8 11:43:17 UTC 2010 - puzel@novell.com + +- update to parted-2.3 + - parted now recognizes ATA over Ethernet (AoE) devices + - parted now recognizes Linux Software RAID Arrays + - libparted has a new partition flag to check for diagnostic + (aka recovery or reserved) partitions: PED_PARTITION_DIAG + - When libparted deferenced a /dev/mapper/foo symlink, it would + keep the resulting /dev/dm-N name and sometimes use it later, + even though it had since become stale and invalid. + It no longer stores the result of dereferencing a /dev/mapper + symlink. + - libparted's msdos_partition_is_flag_available function now + always reports that the "hidden" flag is not available for + an extended partition. Similarly, + msdos_partition_get_flag(p,PED_PARTITION_HIDDEN) always + returns 0 for an extended partition. + - libparted uses a more accurate heuristic to distinguish between + ext4 and ext3 partitions. + - libparted now properly checks the return value of dm_task_run + when operating on devicemapper devices. + - allow using ped_device_cache_remove(dev) followed by a (later) + ped_device_destroy() without corrupting the device cache. + - when creating an ext2 file system, Parted no longer creates an + invalid one when its size is 2TiB or larger. +- drop etherd_support.diff (included upstream) +- drop parted-remove-experimental-warning.patch (included upstream) +- drop make-align-check-work-in-interactive-mode.patch + (included upstream) +- drop parted-no-inttypes-include (not needed) +- refresh all remaining patches + +------------------------------------------------------------------- +Wed Jun 30 11:12:03 UTC 2010 - puzel@novell.com + +- update make-align-check-work-in-interactive-mode.patch to + be consistent with upstream + +------------------------------------------------------------------- +Mon Jun 28 06:38:35 UTC 2010 - jengelh@medozas.de + +- use %_smp_mflags + +------------------------------------------------------------------- +Thu May 27 15:36:51 UTC 2010 - puzel@novell.com + +- add make-align-check-work-in-interactive-mode.patch (bnc#608704) + +------------------------------------------------------------------- +Fri Apr 2 08:41:02 UTC 2010 - puzel@novell.com + +- add parted-remove-experimental-warning.patch +- refresh always_print_geom.diff to apply at correct function + +------------------------------------------------------------------- +Fri Feb 26 17:56:05 UTC 2010 - puzel@novell.com + +- update to parted-2.2 + - Changes in behavior + - The default alignment (--align option) for newly created + partitions has been changed to optimal. + - New features + - The ped_device_get_*_alignment() functions now return a sane + default value instead of NULL when the so called topology + information is incomplete. The default minimum alignment aligns + to physical sector size, the default optimal alignment is 1MiB, + which is what vista and windows 7 do. + - Bug fixes + - Parted no longer uses a physical sector size of 0 or of any + other value smaller than the logical sector size. + - dos: creating an HFS or HFS+ partition in an msdos partition + table used to set the partition type to 0x83. That is wrong. + The required number is 0xaf, and that is what is used now. + - gpt: read-only operation could clobber MBR part of hybrid + GPT+MBR table [bug introduced in parted-2.1] + - gpt: a read-only operation like "parted $dev print" would + overwrite $dev's protective MBR when exactly one of the primary + and backup GPT tables was found to be corrupt. [bug introduced + prior to parted-1.8.0] + - sun: the version, sanity and nparts VTOC fields were ignored by + libparted. Those fields are properly initialized now. The + nparts (number of partitions) field is initialized to 8 (max. + number of sun partitions) rather that to a real number of + partitions. This solution is compatible with Linux kernel and + Linux fdisk. + - libparted: try harder to inform kernel of partition changes. + Previously when editing partitions, occasionally the kernel + would fail to be informed of partition changes. When this + happened future problems would occur because the kernel had + incorrect information. For example, if this problem arose when + resizing or creating a new partition, then an incorrect + partition size might be displayed or a user might encounter a + failure to format or delete a newly created partition, + respectively. + - libparted: committing a disk that was returned by + ped_disk_duplicate would always result in ped_disk_clobber being + called (and thus the first and last 9KiB of the disk being + zeroed), even if the duplicated disk, was not returned by + ped_disk_fresh(). +- drop do-not-install-test-programs.patch (fixed in upstream) + +------------------------------------------------------------------- +Wed Feb 17 16:33:01 UTC 2010 - puzel@novell.com + +- add do-not-install-test-programs.patch + - avoid deleting this in specfile + +------------------------------------------------------------------- +Mon Feb 1 13:34:10 UTC 2010 - puzel@novell.com + +- update to parted-2.1 (noteworthy changes) + * New features + - new --align= commandline option which can have the + following values: + - none: Use the minimum alignment allowed by the disk type + - cylinder: Align partitions to cylinders (the default) + - minimal: Use minimum alignment as given by the disk + topology information + - optimal: Use optimum alignment as given by the disk + topology information + The minimal and optimal values will use layout information + provided by the disk to align the logical partition table + addresses to actual physical blocks on the disks. The minimal + value uses the minimum alignment needed to align the partition + properly to physical blocks, which avoids performance + degradation. Where as the optimal value uses a multiple of the + physical block size in a way that guarantees optimal + performance. The min and opt values will only work when + compiled with libblkid >= 2.17 and running on a kernel >= + 2.6.31, otherwise they will behave as the none --align value. + - Parted now supports disks with sector size larger than 512 bytes. + Before this release, parted could operate only on disks with a + sector size of 512 bytes. However, disk manufacturers are + already making disks with an exposed hardware sector size of + 4096 bytes. Prior versions of parted cannot even read a + partition table on such a device, not to mention create or + manipulate existing partition tables. Due to internal design + and time constraints, the following less-common partition + table types are currently disabled: + - amiga, bsd, aix, pc98 + - new command "align-check TYPE N" to determine whether the + starting sector of partition N is + TYPE(minimal|optimal)-aligned for the disk. The same + libblkid and kernel version requirements apply as for --align + * Bug fixes + - parted can once again create partition tables on loop devices. + - improved >512-byte sector support + - gpt tables are more rigorously checked + - improved dasd disk support + - handle device nodes created by lvm built with udev + synchronisation enabled properly. + - when printing tables, parted no longer truncates flag names + - Partitions in a GPT table are no longer assigned the + "microsoft reserved partition" type. Before this change, + each partition would be listed with a type of "msftres" by + default. + * Notice + - Parted stopped using BLKPG_* ioctls to inform the kernel + about changes of the partition table. The consequence of this + change is that parted alone can no longer inform the kernel + about changes to partition table on a disk where some of the + partitions are mounted. +- build requires check-devel and pkg-config +- drop parted-1.8.3.dif - fixed by adding pkg-config and check-devel + to BuildRequires +- drop parted.tty.patch, parted.no-O_DIRECT.patch, + do-not-discard-bootcode-in-extended-partition.patch, + avoid-unnecessary-open-close.patch, + do-not-unnecessarily-open-part-dev.patch + - fixed upstream +- drop fix-tests.sh - make check disabled in specfile +- drop fix-error-informing-the-kernel.patch, + fix-race-call-udevadm-settle.patch, + retry-blkpg-ioctl.patch, use-ext-range.patch + - affected code removed as part of the BLKPG to BLKRRPART + switch +- clean up specfile + +------------------------------------------------------------------- +Mon Feb 1 12:22:54 UTC 2010 - jengelh@medozas.de + +- package baselibs.conf + +------------------------------------------------------------------- +Mon Jan 25 15:54:17 UTC 2010 - puzel@novell.com + +- use-ext-range.patch (bnc#567652) + +------------------------------------------------------------------- +Thu Dec 3 14:10:59 UTC 2009 - puzel@novell.com + +- avoid-unnecessary-open-close.patch, + do-not-unnecessarily-open-part-dev.patch, + fix-race-call-udevadm-settle.patch, + retry-blkpg-ioctl.patch (bnc#539521) + +------------------------------------------------------------------- +Wed Oct 7 14:12:15 UTC 2009 - puzel@novell.com + +- do-not-create-dm-nodes.patch (bnc#501773) + +------------------------------------------------------------------- +Fri Jul 31 10:20:05 CEST 2009 - puzel@novell.com + +- update to parted-1.9.0 + * bugfixes: + * parted now preserves the protective MBR (PMBR) in GPT type + labels. + * gpt_read now uses SizeOfPartitionEntry instead of the size + of GuidPartitionEntry_t. This ensures that *all* of the + partition entries are correctly read. + * mklabel (interactive mode) now correctly asks for + confirmation, when replacing an existent label, without + outputting an error message. + * resize now handles FAT16 file systems with a 64k cluster. + This configuration is not common, but it is possible. + * parted now ignores devices of the type /dev/md* when + probing. These types of devices should be handled by the + device-mapper capabilities of parted. + * The parted documentation now describes the differences in + the options passed to mkpart for the label types. + * changes in behavior + * In libparted, the linux-swap "filesystem" types are now + called "linux-swap(v0)" and "linux-swap(v1)" rather than + "linux-swap(old)" and "linux-swap(new)" as in parted 1.8, or + "linux-swap" as in older versions; "old" and "new" generally + make poor names, and v1 is the only format supported by + current Linux kernels. Aliases for all previous names are + available. +- drop following patches as they were merged upstream/are no + longer needed: + * 2TB_size_overflow.diff + * disable_FAT_check.diff + * do-not-automatically-correct-GPT.patch + * dont-require-dvh-partition-name.patch + * fix-array-overflow.patch + * fix-corrupted-gpt-crash.patch + * fix-dasd-probe.patch + * fix-dvh-update.patch + * fix-improper-data-conversion.patch + * fix-make-install-failure.patch + * gnulib.diff + * parted-cmd-arg-fix.patch + * parted-fdasd-compile-fixes +- remove FAT16 stuff from fat16_hfs_fix.dif, rename it hfs_fix.dif +- add fix-tests.sh + * adjust testsuite so that it succeeds with our patchset +- update all patches to remove fuzz, renumber patches +- change license to GPL v3 +- parted-type.patch: fix output of flags + + +------------------------------------------------------------------- +Wed Jul 1 12:13:42 CEST 2009 - puzel@novell.com + +- add libsepol-devel to BR: (fix build) + +------------------------------------------------------------------- +Wed Jun 17 15:43:33 CEST 2009 - puzel@suse.cz + +- add fix-make-install-failure.patch (fix build) +- add fix-array-overflow.patch (fixes warning) +- split -lang subpackage + +------------------------------------------------------------------- +Tue Apr 7 02:55:54 CEST 2009 - crrodriguez@suse.de + +- remove static libraries + +------------------------------------------------------------------- +Tue Mar 10 12:12:02 CET 2009 - puzel@suse.cz + +- fix-multipath-part-name.patch replaced with + fix-dm-partition-name.patch (bnc#471440) + +------------------------------------------------------------------- +Wed Feb 18 11:22:22 CET 2009 - puzel@suse.cz + +- do-not-automatically-correct-GPT.patch (bnc#436825) + +------------------------------------------------------------------- +Tue Feb 10 11:21:52 CET 2009 - puzel@suse.cz + +- dont-require-dvh-partition-name.patch (bnc#471703) + +------------------------------------------------------------------- +Mon Feb 9 13:20:38 CET 2009 - puzel@suse.cz + +- parted-cmd-arg-fix.patch (bnc#473207) + +------------------------------------------------------------------- +Fri Jan 23 13:15:14 CET 2009 - puzel@suse.cz + +- do-not-discard-bootcode-in-extended-partition.patch (bnc#467576) + +------------------------------------------------------------------- +Fri Jan 23 09:08:07 CET 2009 - puzel@suse.cz + +- fix-error-informing-the-kernel.patch (bnc#449183) + +------------------------------------------------------------------- +Thu Jan 22 12:53:26 CET 2009 - puzel@suse.cz + +- fix-multipath-part-name.patch (bnc#447591) + +------------------------------------------------------------------- +Wed Jan 7 12:34:56 CET 2009 - olh@suse.de + +- obsolete old -XXbit packages (bnc#437293) + +------------------------------------------------------------------- +Wed Nov 26 13:59:06 CET 2008 - puzel@suse.cz + +- fix-dasd-probe.patch (bnc#438681) + +------------------------------------------------------------------- +Fri Nov 7 21:58:52 CET 2008 - puzel@suse.cz + +- fix-corrupted-gpt-crash.patch (bnc#439910) +- fix-dvh-update.patch (bnc#397210) + +------------------------------------------------------------------- +Wed Nov 5 12:42:57 CET 2008 - puzel@suse.cz + +- disabled largest_partition_number.patch (bnc#440141) + +------------------------------------------------------------------- +Mon Oct 20 11:27:45 CEST 2008 - puzel@suse.cz + +- fix improper data conversion (bnc#435702) + +------------------------------------------------------------------- +Tue Oct 7 10:55:11 CEST 2008 - puzel@suse.cz + +- updated largest_partition_number.patch (bnc#428992) + +------------------------------------------------------------------- +Thu Aug 28 18:38:02 CEST 2008 - kukuk@suse.de + +- Kill *.la file + +------------------------------------------------------------------- +Mon Aug 25 15:08:51 CEST 2008 - prusnak@suse.cz + +- enabled SELinux support [Fate#303662] + +------------------------------------------------------------------- +Thu Aug 21 11:34:51 CEST 2008 - agraf@suse.de + +- fix the GPT sync to work properly on Macs + +------------------------------------------------------------------- +Mon Aug 11 16:27:24 CEST 2008 - agraf@suse.de + +- make GPT sync more compatible: + - don't sync on IA64 + - always add a partition with partition type 0xee, so Linux is happy + - protect the EFI System Partition if available + +------------------------------------------------------------------- +Tue Jul 22 13:27:27 CEST 2008 - hare@suse.de + +- Fix fdasd.c compilation +- Don't include broken inttypes.h + +------------------------------------------------------------------- +Fri Jul 18 10:03:52 CEST 2008 - agraf@suse.de + +- add GPT sync, so whenever the GPT is modified, fake MBR entries + for the first 4 partitions will be created. This fixes booting + from disks > 2TB and makes booting a Mac possible (bnc#220839) + +------------------------------------------------------------------- +Tue Jul 8 12:08:30 CEST 2008 - puzel@suse.cz + +- added largest_partition_number.patch + * fixes computation of largest partition number (bnc#397210) + +------------------------------------------------------------------- +Fri May 9 17:19:58 CEST 2008 - schwab@suse.de + +- Fix gnulib macro and use autoreconf. + +------------------------------------------------------------------- +Thu Apr 10 12:54:45 CEST 2008 - ro@suse.de + +- added baselibs.conf file to build xxbit packages + for multilib support + +------------------------------------------------------------------- +Mon Mar 24 09:37:13 CET 2008 - ro@suse.de + +- fix typo in specfile + +------------------------------------------------------------------- +Thu Mar 20 15:46:12 CET 2008 - meissner@suse.de + +- fix buildrequires +- change from loading libreiserfs dynamically to just link it + (avoids adding libreiserfs-devel + deps to the system) + FATE#303510 +- enable device mapper linking (I very much doubt it was intended to + be disabled) + +------------------------------------------------------------------- +Sun Mar 16 06:53:23 CET 2008 - crrodriguez@suse.de + +- fix file-not-in-lang rpmlint warnings + +------------------------------------------------------------------- +Tue Jan 15 12:12:17 CET 2008 - fehr@suse.de + +- Add patch 2TB_size_overflow.diff developed by Jim Meyering + to properly handle cases of overflow over + 2TB limit in msdos label (#352484) + +------------------------------------------------------------------- +Mon Aug 13 15:07:28 CEST 2007 - fehr@suse.de + +- Update to new version 1.8.8 + Properly detect 'ext2 fs too small' cases. + Read an msdos partition table from a device with 2K sectors. + Correct handling of HeaderSize field in GPT labels. + Fix block number used when checking for ext2 fs state. + Add detection support for Xen virtual block devices (/dev/xvd*). + Fixed exception handling in mkpart and mkpartfs commands. + Fix invalid command line argument handling. + Close memory leaks in parted.c and table.c. + +------------------------------------------------------------------- +Fri Jul 13 11:38:09 CEST 2007 - olh@suse.de + +- do not open with O_DIRECT (#290087) + +------------------------------------------------------------------- +Thu Jul 5 12:55:37 CEST 2007 - sassmann@suse.de + +- fix parted to generate parseable output (#289049) + added check to test if tty is availabe, if no tty is available + readline functions are omitted + +------------------------------------------------------------------- +Thu Jun 21 17:25:54 CEST 2007 - adrian@suse.de + +- fix changelog entry order + +------------------------------------------------------------------- +Sun May 13 19:25:16 CEST 2007 - olh@suse.de + +- restore mkpart linux-swap syntax (#274080) + +------------------------------------------------------------------- +Thu May 10 14:01:52 CEST 2007 - fehr@suse.de + +- Update to new version 1.8.7 + Fix primary partition cylinder alignment error for DOS disk labels + Avoid segfault due to a double free on reiserfs support + Fix script mode (-s) for mkfs command in parted + Fix off-by-one bug in parted when displaying information about the disk + +------------------------------------------------------------------- +Wed May 2 11:30:23 CEST 2007 - olh@suse.de + +- remove unused check-devel from buildrequires to allow build in sles10 + +------------------------------------------------------------------- +Tue Mar 27 12:47:56 CEST 2007 - sbrabec@suse.cz + +- Require check-devel. + +------------------------------------------------------------------- +Thu Mar 22 13:56:10 CET 2007 - fehr@suse.de + +- Update to new version 1.8.6 + Revert the implementation of the linux-swap(new) and linux-swap(old) types. + +- Update to new version 1.8.5 + Add po translations + +- Update to new version 1.8.4 + Minor bug fix release for 1.8.3 to fix build issues on various platforms + +------------------------------------------------------------------- +Mon Mar 19 14:12:12 CET 2007 - fehr@suse.de + +- Update to new version 1.8.3 + libparted: + - Sync the linux-swap header according to the Linux kernel sources. + - Enable support for swsusp partitions and the ability to differentiate + between old and new versions of linux-swap partitions. + - Preserve starting sector for primary NTFS 3.1 partitions on DOS disklabel. + - Handle 2048-byte logical sectors in linux_read(). + - Don't assume logical sector size is <= 512B on AIX. + - Detect HFS write failure. + - Added HFS+ resize support. + parted/partprobe: + - Use fputs() and putchar() in place for printf(), when possible. + - Detect/report stdout write errors. + - Accept the --version and --help options. + - Fix memory leaks in parted(8). + +------------------------------------------------------------------- +Wed Mar 7 15:47:21 CET 2007 - fehr@suse.de + +- make resize of ext2/3 under YaST2 work again (#249674) + +------------------------------------------------------------------- +Tue Feb 20 13:06:44 CET 2007 - fehr@suse.de + +- make mklabel in scripted mode work again + +------------------------------------------------------------------- +Mon Jan 15 11:51:21 CET 2007 - fehr@suse.de + +- Update to new version 1.8.2 + libparted: + - Add the ped_device_cache_remove() function to remove a device from the + cache. This is necessary for some things that use libparted, including + pyparted. + - Fix a segfault in ped_assert() where the wrong pointer is freed in the + backtrace handler. + - Only call _disk_warn_loss(disk) in do_mklabel() if disk is not NULL. + Fixes a segfault when initializing new volumes. + - Dynamically allocate space for exception messages. + - Output a backtrace when catching SEGV_MAPPER or a general SIGSEGV. + + parted: + - Destroy all objects before return when called with --list or --all option. + - Zero sized device is shown as 0.00B and not -0.00kB. + - Implement 'print devices' command. + - Alias 'print list' to 'print all'. + - Alias 'mktable' to 'mklabel'. + +------------------------------------------------------------------- +Tue Dec 5 11:11:59 CET 2006 - fehr@suse.de + +- Update to new version 1.8.1 + libparted + Rework backtrace support + Disable ext2fs resize for now, tell user to use resize2fs + GPT fixes + Prevent SIGFPE when FAT sector size is 0 + DASD support for IBM zSeries systems + AIX disk label support + Detect Promise SX8 storage devices + Macintosh (ppc and x86) disk label improvements + Add support binary units (MiB, KiB, GiB) + Fix geometry read problems on 64-bit Macs + Add support for /dev/mapper devices via libdevmapper library + Detect Apple_Boot partition types correctly on MacOS X 10.4 systems + parted + Fix loop in print_all(). + Introduce the -list command-line switch. + Warn before mklabel and mkfs. + Proper print when there are no extended partitions, but partition names. + +------------------------------------------------------------------- +Tue Nov 7 13:46:13 CET 2006 - ro@suse.de + +- fix manpage permissions + +------------------------------------------------------------------- +Fri Jul 21 11:15:27 CEST 2006 - olh@suse.de + +- keep kernel interface to extended partition on Linux + +------------------------------------------------------------------- +Tue Jul 18 09:04:11 CEST 2006 - olh@suse.de + +- build with make -j + add parted-mac_data-init.patch + add parted-mac-set-type-corruption.patch (#192082) + +------------------------------------------------------------------- +Mon May 29 16:15:21 CEST 2006 - fehr@suse.de + +- Update to new version 1.7.1 + libparted: bug fixes related to linking, HFS, ext2, the Mac disk label + parted: signal handling bug fix + +------------------------------------------------------------------- +Thu May 18 12:40:04 CEST 2006 - fehr@suse.de + +- Update to new version 1.7.0 + libparted: + * support for Apple GUIDs to GPT code + * probe /dev/hd? before /dev/sd? + * prefer /sys/block to /proc/partitions where possible + * fix of ext2 "strange layout" bug (EXPERIMENTAL) + * handling of sector sizes not equal to 512 + * added ped_device_get_constraint to support device-dependent constraints + + parted: + * new formatter for "print" command + * SIGSEGV handler + * fixed "rescue" command core dump + * fixes for 'mkpart' and 'mkpartfs' and 'print' + * position and size of partitions are displayed with up to two + digits after the decimal dot (depending on the unit and value) + + manual: + * cut down substantially. + Lots of general content will be moved to the GNU Storage Guide. + +------------------------------------------------------------------- +Tue Apr 25 12:52:33 CEST 2006 - fehr@suse.de + +- Update to new version 1.7.0rc5 + +------------------------------------------------------------------- +Mon Mar 6 15:07:05 CET 2006 - schwab@suse.de + +- Fix format string. + +------------------------------------------------------------------- +Wed Jan 25 21:39:16 CET 2006 - mls@suse.de + +- converted neededforbuild to BuildRequires + +------------------------------------------------------------------- +Tue Dec 6 14:47:16 CET 2005 - fehr@suse.de + +- update to new version 1.6.25.1 + +------------------------------------------------------------------- +Wed Nov 9 17:51:06 CET 2005 - fehr@suse.de + +- update to new version 1.6.25 +- make parted correctly refuse to resize inconsistent fat + filesystems even if env var YAST_IS_RUNNING is set (#132967) + +------------------------------------------------------------------- +Thu Sep 8 16:15:51 CEST 2005 - fehr@suse.de + +- fix wrong permissions of brazilian man page (#114849) + +------------------------------------------------------------------- +Mon Aug 15 17:00:04 CEST 2005 - fehr@suse.de + +- update to new version 1.6.24 + +------------------------------------------------------------------- +Wed Aug 3 18:04:19 CEST 2005 - fehr@suse.de + +- make parted print BIOS geometry also if no disk label is present + (#100444) + +------------------------------------------------------------------- +Thu Jul 28 11:34:35 CEST 2005 - fehr@suse.de + +- update to new version 1.6.23 + +------------------------------------------------------------------- +Thu Jul 19 16:37:13 CEST 2005 - pkirsch@suse.de + +- fix fat16 minimum requirements +- fix mac partition handling + +------------------------------------------------------------------- +Thu Apr 7 16:47:33 CEST 2005 - fehr@suse.de + +- update to new version 1.6.22 + +------------------------------------------------------------------- +Wed Mar 16 14:57:55 CET 2005 - fehr@suse.de + +- prevent shifted start sect when resizing with unknown fs (#73008) + +------------------------------------------------------------------- +Mon Jan 17 11:04:06 CET 2005 - fehr@suse.de + +- fix typo in input_sector.patch +- update to new version 1.6.21 + +------------------------------------------------------------------- +Thu Jan 13 19:30:31 CET 2005 - fehr@suse.de + +- allow creation of partitions by exact sector number (#49276) + +------------------------------------------------------------------- +Tue Jan 11 15:55:35 CET 2005 - fehr@suse.de + +- update to new version 1.6.20 + +------------------------------------------------------------------- +Mon Nov 29 12:52:46 CET 2004 - fehr@suse.de + +- update to new version 1.6.19 +- add reiserfs to needforbuild + +------------------------------------------------------------------- +Mon Nov 22 13:04:06 CET 2004 - fehr@suse.de + +- update to new version 1.6.18 + +------------------------------------------------------------------- +Mon Nov 8 12:23:48 CET 2004 - fehr@suse.de + +- update to new version 1.6.16 + +------------------------------------------------------------------- +Tue Oct 26 17:34:49 CEST 2004 - fehr@suse.de + +- add patch by SGI for documentation of dvh-disklabel (#47611) + +------------------------------------------------------------------- +Wed Sep 29 12:49:24 CEST 2004 - fehr@suse.de + +- add support for ATA over ethernet +- add support for partitioning device-mapper devices (for dmraid) + +------------------------------------------------------------------- +Mon Sep 20 11:27:45 CEST 2004 - fehr@suse.de + +- update to new version 1.6.15 + +------------------------------------------------------------------- +Thu Sep 16 14:39:40 CEST 2004 - fehr@suse.de + +- greatly simplify always-resize-part.dif by using + ped_constraint_exact + +------------------------------------------------------------------- +Wed Sep 15 14:31:48 CEST 2004 - fehr@suse.de + +- prevent unwanted modifying of partition start and end due to + alignment constraints during resize (#45013, #44699) + +------------------------------------------------------------------- +Mon Sep 6 14:02:14 CEST 2004 - fehr@suse.de + +- update to new version 1.6.14 + +------------------------------------------------------------------- +Mon Sep 6 11:50:37 CEST 2004 - fehr@suse.de + +- update to new version 1.6.13 + +------------------------------------------------------------------- +Mon Aug 16 11:00:02 CEST 2004 - fehr@suse.de + +- update to new version 1.6.12 + +------------------------------------------------------------------- +Mon Apr 26 13:11:08 CEST 2004 - fehr@suse.de + +- update to new version 1.6.11 + +------------------------------------------------------------------- +Wed Mar 31 15:40:43 CEST 2004 - meissner@suse.de + +- Detect viodasd virtual disks on iSeries. #37521 + +------------------------------------------------------------------- +Sat Jan 10 15:37:29 CET 2004 - adrian@suse.de + +- add %run_ldconfig + +------------------------------------------------------------------- +Mon Oct 20 17:02:46 CEST 2003 - fehr@suse.de + +- fix printing of partitions larger than 1TB in size (#32319) + +------------------------------------------------------------------- +Fri Sep 12 10:02:43 CEST 2003 - fehr@suse.de + +- extend parted to handle User-mode virtual block devices (#30375) + +------------------------------------------------------------------- +Mon Sep 8 15:56:38 CEST 2003 - fehr@suse.de + +- do not warning about too new GPT version if running under YaST2 + and too new version is 0x00010200 (#29563) + +------------------------------------------------------------------- +Mon Jul 28 11:20:02 CEST 2003 - fehr@suse.de + +- update to new version 1.6.6 + +------------------------------------------------------------------- +Thu Jun 19 21:27:33 CEST 2003 - ro@suse.de + +- build with current gettext + +------------------------------------------------------------------- +Thu Jun 12 15:14:32 CEST 2003 - fehr@suse.de + +- add missing dir to filelist + +------------------------------------------------------------------- +Thu Apr 24 12:20:23 CEST 2003 - ro@suse.de + +- fix install_info --delete call and move from preun to postun + +------------------------------------------------------------------- +Thu Mar 20 16:21:20 CET 2003 - fehr@suse.de + +- display also partitions of type Apple_Free on Macintosh + +------------------------------------------------------------------- +Mon Feb 24 10:27:08 CET 2003 - fehr@suse.de + +- update to new version 1.6.5 + +------------------------------------------------------------------- +Mon Feb 17 12:21:05 CET 2003 - fehr@suse.de + +- Use env var YAST_IS_RUNNING instead if YAST2_RUNNING for checking + if parted is called by YAST2 + +------------------------------------------------------------------- +Fri Feb 7 15:19:46 CET 2003 - fehr@suse.de + +- Use %install_info macro + +------------------------------------------------------------------- +Mon Feb 3 14:35:20 CET 2003 - fehr@suse.de + +- disable check for string "FAT" in boot sector since it makes + parted fail on some IDE disks with TurboLinux installed (#19401) + +------------------------------------------------------------------- +Tue Dec 10 10:52:42 CET 2002 - fehr@suse.de + +- update to new version 1.6.4 + +------------------------------------------------------------------- +Mon Nov 18 16:38:27 CET 2002 - schwab@suse.de + +- Add AM_GNU_GETTEXT_VERSION. + +------------------------------------------------------------------- +Mon Sep 23 18:11:04 CEST 2002 - meissner@suse.de + +- recognize AIX IPL signatures in MSDOS labels and mark these labels + invalid. Also overwrite the AIX IPL signature on "mklabel" (#20039). + +------------------------------------------------------------------- +Mon Sep 2 15:44:17 CEST 2002 - fehr@suse.de + +- fix bug occuring sometimes when resizing reiserfs from YaST2 + (bug was in patch always-resize-part.dif) + +------------------------------------------------------------------- +Tue Aug 13 11:18:27 CEST 2002 - fehr@suse.de + +- update to parted 1.6.3 + +------------------------------------------------------------------- +Thu Aug 8 08:42:34 CEST 2002 - fehr@suse.de + +- add patch to ignore /proc/sys/kernel/real-root-dev and do a stat + on "/" instead. real-root-dev does not always contain a valid + entry + +------------------------------------------------------------------- +Tue Aug 6 14:08:43 CEST 2002 - meissner@suse.de + +- redid patch for partition ids on MAC with some API additions + to make it 64bit clean. + +------------------------------------------------------------------- +Thu Aug 1 11:57:35 CEST 2002 - fehr@suse.de + +- add patch by Marcus Meissner to show partition type on MACs + +------------------------------------------------------------------- +Thu Jul 25 19:06:20 CEST 2002 - fehr@suse.de + +- add patch by Marcus Meissner to show and set partition id on dos + label + +------------------------------------------------------------------- +Tue Jul 16 11:11:21 CEST 2002 - schwab@suse.de + +- Update to parted 1.6.2, needed for ia64. + +------------------------------------------------------------------- +Tue Jul 2 15:49:47 CEST 2002 - meissner@suse.de + +- rerun auto* tools + +------------------------------------------------------------------- +Thu Jun 27 11:18:53 CEST 2002 - fehr@suse.de + +- make setting flags lvm and raid to off work + +------------------------------------------------------------------- +Mon Jun 10 12:55:00 CEST 2002 - fehr@suse.de + +- add patch to resize also partitions with unkown fs under YaST2 + +------------------------------------------------------------------- +Tue May 7 13:04:28 CEST 2002 - fehr@suse.de + +- update to 1.4.24 +- add patch to be verbose when resizing fat under YaST2 + +------------------------------------------------------------------- +Tue May 7 12:53:46 CEST 2002 - ro@suse.de + +- fixed specfile: no macro allowed in Version: line + +------------------------------------------------------------------- +Fri Apr 26 13:34:03 CEST 2002 - coolo@suse.de + +- use %_libdir + +------------------------------------------------------------------- +Mon Sep 3 17:33:29 CEST 2001 - kkaempf@suse.de + +- update to 1.4.18 + compiles now with gcc 3.x and new autoconf/automake. + support for ext3. + lots of minor fixes, see ChangeLog in source. + +------------------------------------------------------------------- +Thu May 10 17:55:18 CEST 2001 - freitag@suse.de + +- Added documentation to filelist, Bug# 6115 + +------------------------------------------------------------------- +Thu May 10 01:02:44 CEST 2001 - mfabian@suse.de + +- bzip2 sources + +------------------------------------------------------------------- +Mon Apr 30 17:39:26 MEST 2001 - tom@suse.de + +- Change to new version 1.4.11 + Removed configure patch (not needed anymore) + Removed gettextize (doesn't build) + Changed shared libraries to new state in file list + +------------------------------------------------------------------- +Thu Apr 12 17:23:04 CEST 2001 - ro@suse.de + +- gettextize for new gettext + +------------------------------------------------------------------- +Wed Apr 4 16:19:29 CEST 2001 - kukuk@suse.de + +- Add shared libraries to filelist for intel + +------------------------------------------------------------------- +Fri Mar 23 15:16:38 CET 2001 - schwab@suse.de + +- Fix configure check for sizeof off_t. +- Enable shared libs for x86 now that llseek.c rubbish is not + needed any more. + +------------------------------------------------------------------- +Fri Feb 23 11:52:57 CET 2001 - uli@suse.de + +- enabled shared libs for non-x86 archs (see libparted/llseek.c for + explanation why this doesn't work for x86) + +------------------------------------------------------------------- +Fri Feb 23 00:10:25 CET 2001 - ro@suse.de + +- added readline/readline-devel to neededforbuild (split from bash) + +------------------------------------------------------------------- +Fri Jan 12 20:13:33 MET 2001 - tom@suse.de + +- update to version 1.4.6 + +------------------------------------------------------------------- +Wed Jan 3 20:11:02 MET 2001 - tom@suse.de + +- update to version 1.4.5 + +------------------------------------------------------------------- +Mon Dec 4 19:16:51 CET 2000 - schwab@suse.de + +- Add %suse_update_config. + +------------------------------------------------------------------- +Fri Dec 1 15:11:14 MET 2000 - tom@suse.de + +- update to version 1.4.4 + +------------------------------------------------------------------- +Tue Nov 21 14:20:36 CET 2000 - tom@suse.de + +- update to version 1.4.2 + +------------------------------------------------------------------- +Thu Nov 9 09:58:25 CET 2000 - ro@suse.de + +- fixed neededforbuild + +------------------------------------------------------------------- +Tue Oct 10 15:56:16 MEST 2000 - tom@suse.de + +- initial version, GNU parted 1.2.9 diff --git a/parted.keyring b/parted.keyring new file mode 100644 index 0000000..a50f205 --- /dev/null +++ b/parted.keyring @@ -0,0 +1,110 @@ +Release GPG keyring of parted group. + +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQENBEt+xXMBCACkA1ZtcO4H7ZUG/0aL4RlZIozsorXzFrrTAsJEHvdy+rHCH3xR +cFz6IMbfCOdV+oKxlDP7PS0vWKfqxwkenOUut5o9b32uDdFMW4IbFXEQ94AuSQpS +jo8PlVMm/51pmmRxdJzyPnr0YD38mVK6qUEYLI/4zXSgFk493GT8Y4m3N18O/+ye +PnOOItj7qbrCMASoBx1TG8Zdg8ufehMnfb85x4xxAebXkqJQpEVTjt4lj4p6BhrW +R+pIW/nBUrz3OsV7WwPKjSLjJtTJFxYX+RFSCqOdfusuysoOxpIHOx1WxjGUOB5j +fnhmq41nWXf8ozb58zSpjDrJ7jGQ9pdUpAtRABEBAAG0HkJyaWFuIEMuIExhbmUg +PGJjbEByZWRoYXQuY29tPokBVAQTAQoAPgIbAwIeAQIXgAULCQgHAwUVCgkICwUW +AgMBABYhBLTGtFHk+otCMsoZHhF+jBaO/jp/BQJiXuqeBQkYwVirAAoJEBF+jBaO +/jp/DvQIAIXTAkIG5yF/vunQMfuyn+BulksKJY/Tx8p0E/8Ls7Tct78U6NQgdNsK +UKaSpj8XwwyhcO1WuUvNf2oQAcAPmB3viEfApFF0C7XL+QM6jF9mMuvPYWpHpZ7i +DhhYiz4O2Y7t29ZxN0tUIPwxNvE/KM4FyspM4p0iGX/crWFbPYSE6VgVElW2fcyF +wuJbyZTPstrSk0M1UToci23JaEJfV/f/rSe3Uxf/N/EtC1Kf1FW9hijM+j1q6zHU +rvzeOyHu9RUlRhlNP3S+pAcXjYd6yRV5i1Aw3c92itzT2wEdnLtsMtx449DbMQVT +jOS/mHVVsKfyydhiJ1ry+ZdC3bM1tOqIRgQQEQIABgUCS37G6QAKCRAh+2P+lxLC +zbmrAJ9ENIweBGv/eRERFJAhU5vS+pzqQACfbUM8Bl4ayxWcznUVmIlnAkG1+f+J +AhwEEAEKAAYFAlVhGI8ACgkQ0phFpw9QF94AEBAAj9g/cR2fv6ognKbd3noTz7zt +8unMKD33s4evHaLQCaeqZLa26RPg2LDlPBmUbyAT75KMqEnAo5Mm5cLTrQY0k3mF +/Ngz3B4FzGisQeD73i0J5Pu9nNqp3h2j1cn/mm9FsbWmTSvxEKsIUIbmSC+vsTNg +Wte9Uw2QuRpFlxUPL8VkCgY94cHBtH1ths+ZdWP9c5FQm4C+f1ZFpWvxD5ISLLXH +YEChsB/wzZYsBtOu8PuHj7Po7jKjpKiG9tF1HK2naD2b2nTtwaJWzBgidfWjJGXn +wViwozEU+DrWH1XRaqiKtAgKQq8ggtduHsQ2SPjYC4FuQ+cwIUPJPB+Xox7e+S01 +2utBsK32tGkCa1ACjDrwePbs65c+/krz3oSRaPPzCTakboGUVL0qxk+nWNvjdxls +iL0SCFgRRS6bxokLrb4xBmBX3qiHP7TIcEDu4WYNBLwsGtV+g89Yh8gXquizDo9H +UU5/+/f4wJmXr6o86R/QqjGj5MAUOUZTHyBTPtEDOYnEOQSYPBnZfxAeH/zKVnLz +TbL6fsB4juddE084bY08gM0utYVuKNudkykHMFLzO5Iou2te3lMKGlePSau/eAi0 +xHpsy4s/Ykls+KBXHYWghBouZJ18RkPwbQ6WFH18B3frh6ge4lAJ+HprXAEPk6Ag +pJxRGbLxdozB6ZSOrsaJATgEEwECACIFAkt+xXMCGwMGCwkIBwMCBhUIAgkKCwQW +AgMBAh4BAheAAAoJEBF+jBaO/jp/XYAH/R4titTCnJi5A3klCF5FyAMNJwM5dlAx +i1hHQ6gIBcT+lGglbTiEQq+8+BAzkKMQ+5pHXpGx9luRnEzuIfDEAR2A/RJGOx/5 +UynIZRX7JmnzqAN2P7QyzyrvjiHx/TKp9jH+8DGBq51kkTSmILwuc5DIJIaD1Jkj +zx8gWm7HUvyoOWQH+N2nPzF2PVfDJOs6mwZY+kGKoydJwQ+r8KM6w0OYCbQ1C5kI +aNd8z5+JQSZfWCVY3IEQdlm84EmTpZ9A31dtknmouur56+TcmjiMOQfUC0jYTRGj +xbMBAyygrJ7PXZA7hhV+dvzLf4uyckr8ITAahxJT81psAh3mOOTPIAWJAT0EEwEK +ACcCGwMCHgECF4AFCwkIBwMFFQoJCAsFFgIDAQAFAlVYGtMFCQu6iNwACgkQEX6M +Fo7+On8IuggAj6souVSKFq26OaRPhV1L7kaKBI+1NO/s8G4tCNDu9x+M1dS1uGBP +K4L/ojAKiE8KTdrV8PIo/8O95TRMzVvBNXxtvwKkcL+/E8OCIEN/IDfQ16kj69iJ +5mpZ3cOjQ8QTqsqITXsNZseyKRd3Z1bUKmUXlROErH9zHgHu4u+t/HVxTq8dAqvy +vdq9B+KHdO8QuJWV889i92McrGGnzfV8m40tGXhxeaXpVRAdk7fl+Uy0vyv9gCyL ++Zc76i+Ol+18iG96sHNrAse2fcrPMQci9GBJ/zHyYImJzyNOdO3e6KDUAWm1kRth +tC2LbT91uLq5f2l1WF3taNy5rjmvjANFBIkBPQQTAQoAJwIbAwIeAQIXgAULCQgH +AwUVCgkICwUWAgMBAAUCVz5PnQUJDaC9pQAKCRARfowWjv46f6JrB/4oC8tTjYV+ +htspYII6nhAMyAhLq6ooaZthDAoekLOdXVv1m4+unn1fSHO3dptksuhAXlrcclDf +Da8itF625ZbkuN0tAaj6eeIRqV4cYd77UYrd8tF4DGIjJTn/4e6sM+ssRm03Lo2s +OPE5HFbv5q3X4K9+zxI3md3nepUenLZhVKFG1xKtpw+nxkgj/i7oaEknMDq59Jx/ +YgYswCozAHwN61S/XyFyh3DgVSVmZOi+ut/QJRio8vti+6KUwHAkD+s43oKF1I1m +EB455DZQqNs/z+ThIRfCCeftDtECB58o1n7KQ0OHf607Qina9OtPECufgIcXYFC4 +BhaF1E9XjkmmiQE9BBMBCgAnAhsDAh4BAheABQsJCAcDBRUKCQgLBRYCAwEABQJZ +JKWdBQkPjvyYAAoJEBF+jBaO/jp/XtcH/RrsPIyfUmQwRLMxCqy35yh0yePsE2zZ +WKocpZ4TaVe83hKCbDdFLEPclezY5v8j9hq1a2uYdlmQJHESfksNT9qTqLv6djWh +74UDVnzyyQ1zQ7mjrNwUu14zBt8pUJF/rJX5v6jqCWVwgWvWmbUDvn5faTqRdxoN +3sx2Z0/V/dKHXCa5+UxGYqm8KjM2+pcjYFNOh3XK4DWR6kiwkX3RnQwKs5Ptijqv +PXERCn4FRP8gP+UBTUUY/cE4dD5jxcz5LjDR7teqvYnPOKGVLjHMXLFV+QeAJyMZ +DNfqPdPxdcrfez1ncdVk8L0qkzTGd+UKu1y1AUH807kaEZOi+onJRPmJAT0EEwEK +ACcCGwMCHgECF4AFCwkIBwMFFQoJCAsFFgIDAQAFAlsAUi4FCRFcKLcACgkQEX6M +Fo7+On/cBAf/ewi1vMBCSuafD+OUQxidePAo9QvgGFMbIHgyVGm2kL2fxjIt4QAZ +XL+s4pm5hTMF1s+HcfQ/sa8oLfJD02CPz/aaDo2EEFQd6s4mJEtWJwsMHwktc1lm +Gt8IpwVYxC7EGsFgXXZQE6yNy6OhfxAcIHQopbBs7eQedoqIP/4LlOj2cjqjEAAS +XlhJgYAao72wAuglbRlBOhsYAmyhW19I+dzlslCvM082ui0S1ps/tMTbDyXrTGib +wlek733G+6h/09JDp1GzVPHwGigh9auB4W+5Emh6AtwnwAynbJr+QCcDft4PXZUW +ew9kgHk0lwawPXa6WsJ+MxZAx8QVYJduFYkBPgQTAQIAKAIbAwYLCQgHAwIGFQgC +CQoLBBYCAwECHgECF4AFAlVYFjwFCQu6hEUACgkQEX6MFo7+On/aogf/fiBGl5jN +UuY17p4sFlqfdNtKdbfubFPesQtE9BpRy2DNd0Y3QrDUnrLZr9UE7umN2lx8PrJJ +Y33hLj6DbcVuBvbxJxrhGD9hWgBzren4xzGW2dX1WqPLupg3zrmbNOeoUbR1iKUA +s+rO6/lsr+9j6hLWuCADDusOe4pSLfwvU3UDZEV3D11kE+5I9HLR1JEyuJpIp9cf +jFjKY55V/t/vO9UiNK9djSTGuwlBG5BbfQYSKqidvWcd5OswiZ0GRA4vjd5Hg50R +8bh8JpD8ILLYjpL4C2juDjSuiI84+SvC7eXJ+wuMDBvNe2btzuELgFElKmikgeK1 +fNT3G7eKXQq8kLkBDQRLfsVzAQgAvN5jr95pJthv2w9co9/7omhM5rAnr9WJfbML +LiUfPPUvpL24RGO6SKy03aiVTUjlaHc+cGqOciwnNKMCSt+noyG2kNnAESTDtCiv +psjonaFP8jA3TqL0QK+yzBRKJnMnLEY1nWE1FtkMRccXvzi0Z/XQVhiWQyTvDFoK +tepBFrH9UqWbNHyki22aighumUsW01pcPH2ogSj+HR01r7SfI/y2EkE6loHQfCDy +cHmlqYV+X6GZEvf1qu2+EHEQChsHIAxWyshsxM/ZPmx/8e5S3Xmjl7h/6E9wcsIp +vnf504sLX5j4Km9I5HgJSRxHxgRPpqJ2/XiClAJanO5gCw0RdQARAQABiQE8BBgB +CgAmAhsMFiEEtMa0UeT6i0IyyhkeEX6MFo7+On8FAmJe6roFCRjBWMcACgkQEX6M +Fo7+On+l/QgAj7fb/ps3vfhckw+Hb1kfnNiG/HyqCosCAm7O7aMfZ8luqpwHtDEj +f5Z3cu5XWMSbTskeG7N0kpOUQacWGzM9Vv6XT6GZ6wC1/+/Hzglsv4MHcVS9ZjeQ +euresDQbWuUUadccHHrGMI9B8E6SQEJ2gC11JJJi6GNaAs3hN0zMNCfXllnEmU89 +wm0De/DHGSwhyph/4tzwXF2ncdh+emTG6SfTpeHMNdVlwSJkC2/89WcHb+1AxC87 +I6gi8FVKJgQy0/9/nA582sq7+wRGWVnDpK5bpazytWZO16gRSNDch7bj9i4ESSms +vH9+p1Q/Kg/tNVPU8aRRI8tUE7WJ30EmLpkBDQRLfsVzAQgApANWbXDuB+2VBv9G +i+EZWSKM7KK18xa60wLCRB73cvqxwh98UXBc+iDG3wjnVfqCsZQz+z0tL1in6scJ +HpzlLreaPW99rg3RTFuCGxVxEPeALkkKUo6PD5VTJv+daZpkcXSc8j569GA9/JlS +uqlBGCyP+M10oBZOPdxk/GOJtzdfDv/snj5zjiLY+6m6wjAEqAcdUxvGXYPLn3oT +J32/OceMcQHm15KiUKRFU47eJY+KegYa1kfqSFv5wVK89zrFe1sDyo0i4ybUyRcW +F/kRUgqjnX7rLsrKDsaSBzsdVsYxlDgeY354ZquNZ1l3/KM2+fM0qYw6ye4xkPaX +VKQLUQARAQABtB5CcmlhbiBDLiBMYW5lIDxiY2xAcmVkaGF0LmNvbT6JAT0EEwEK +ACcCGwMCHgECF4AFCwkIBwMFFQoJCAsFFgIDAQAFAlVYGtMFCQu6iNwACgkQEX6M +Fo7+On8IuggAj6souVSKFq26OaRPhV1L7kaKBI+1NO/s8G4tCNDu9x+M1dS1uGBP +K4L/ojAKiE8KTdrV8PIo/8O95TRMzVvBNXxtvwKkcL+/E8OCIEN/IDfQ16kj69iJ +5mpZ3cOjQ8QTqsqITXsNZseyKRd3Z1bUKmUXlROErH9zHgHu4u+t/HVxTq8dAqvy +vdq9B+KHdO8QuJWV889i92McrGGnzfV8m40tGXhxeaXpVRAdk7fl+Uy0vyv9gCyL ++Zc76i+Ol+18iG96sHNrAse2fcrPMQci9GBJ/zHyYImJzyNOdO3e6KDUAWm1kRth +tC2LbT91uLq5f2l1WF3taNy5rjmvjANFBLkBDQRLfsVzAQgAvN5jr95pJthv2w9c +o9/7omhM5rAnr9WJfbMLLiUfPPUvpL24RGO6SKy03aiVTUjlaHc+cGqOciwnNKMC +St+noyG2kNnAESTDtCivpsjonaFP8jA3TqL0QK+yzBRKJnMnLEY1nWE1FtkMRccX +vzi0Z/XQVhiWQyTvDFoKtepBFrH9UqWbNHyki22aighumUsW01pcPH2ogSj+HR01 +r7SfI/y2EkE6loHQfCDycHmlqYV+X6GZEvf1qu2+EHEQChsHIAxWyshsxM/ZPmx/ +8e5S3Xmjl7h/6E9wcsIpvnf504sLX5j4Km9I5HgJSRxHxgRPpqJ2/XiClAJanO5g +Cw0RdQARAQABiQElBBgBAgAPAhsMBQJVWBYHBQkLuoQNAAoJEBF+jBaO/jp/S90H +/i/evVsbDpDexbwy2Smg/Kv1ymdqYDsRKhsXln7+nQJteryTwLtIQUHpe0255vTR +4rjvHKYK+JvyjTuuyg5XEEIarqokwlyNiSq3qi5PGCYRkUBzQXxs+lEFoitiRTWr +UH6H0kR9up567mQO3xy6Rw4NdiLwpGpBjofH8u69vkFMNXxWYwlscM70Ye3uCP6E +TFYYdlnD+KHlXtaCKqu4vh9QEVV9lx6qx3Gh4gNcKYQwsGBtNi+QcGlR+cQZnIfQ +yNDmEqwON6sW2LqKSrkBjwN18jK3kDSSTMXKAEIM4OTTayqD9jdoA+j6pJ3QF8m5 +MupQVzWmw8NNbNuPfGmsE/s= +=R7dX +-----END PGP PUBLIC KEY BLOCK----- diff --git a/parted.spec b/parted.spec new file mode 100644 index 0000000..395e9fe --- /dev/null +++ b/parted.spec @@ -0,0 +1,226 @@ +# +# spec file for package parted +# +# Copyright (c) 2022 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: parted +Version: 3.5 +Release: 0 +Summary: GNU partitioner +License: GPL-3.0-or-later +Group: System/Filesystems +URL: http://www.gnu.org/software/parted/ +Source0: ftp://ftp.gnu.org/gnu/parted/%{name}-%{version}.tar.xz +Source1: ftp://ftp.gnu.org/gnu/parted/%{name}-%{version}.tar.xz.sig +# Taken from https://savannah.gnu.org/project/release-gpgkeys.php?group=parted&download=1 +Source2: %{name}.keyring +Source3: baselibs.conf +Source4: fatresize-0.1.tar.bz2 +# Build patches +Patch1: parted-2.4-ncursesw6.patch + +# Other patches +Patch10: hfs_fix.dif +Patch11: parted-wipeaix.patch +Patch12: libparted-partition-naming.patch +#PATCH-FEATURE-SUSE more-reliable-informing-the-kernel.patch bnc#657360 petr.uzel@suse.cz +Patch13: more-reliable-informing-the-kernel.patch +Patch14: dummy-bootcode-only-for-x86.patch +Patch16: parted-mac.patch +Patch17: libparted-use-BLKRRPART-for-DASD.patch.patch +Patch18: libparted-make-BLKRRPART-more-robust.patch +Patch19: libparted-dasd-implicit-partition-disk-flag.patch +Patch21: libparted-avoid-libdevice-mapper-warnings.patch +# Patch31 dropped for bsc#1058667 +Patch22: libparted-open-the-device-RO-and-lazily-switch-to-RW.patch +Patch23: parted-implement-wipesignatures-option.patch +# bsc#982169 +Patch24: libparted-fix-nvme-partition-naming.patch +# fate#314888 +Patch25: libparted-dasd-improve-lvm-raid-flag-handling.patch +Patch26: parted-mkpart-set-a-swap-flag-if-available.patch +Patch27: libparted-dasd-add-swap-flag-handling-for-DASD-CDL.patch +Patch29: libparted-fix-NVDIMM-partition-naming.patch +Patch31: parted-add-ignore-busy-option.patch +Patch32: parted-fix-resizepart-and-rm-command.patch +Patch33: libparted-use-BLKRRPART-only-when-needed.patch +Patch34: libparted-canonicalize-dev-md-paths.patch +# bsc#1168756 +Patch36: libparted-linux-pmem-path.patch +# bsc#1164260 +Patch37: parted-print-max-partitions-for-yast.patch +Patch38: direct-handling-of-partition-type-id-and-uuid.patch +Patch39: type-command.patch +# bsc#1164907 +# Fatresize +Patch100: parted-fatresize-autoconf.patch +Patch101: fatresize-fix-getting-dev-name.patch +# Tests patches +Patch156: tests-add-helper-require_swap_.patch +Patch157: tests-add-dev-md-check-to-t6100.patch +Patch158: tests-disable.patch + +# SUSE tests patches +Patch200: tests-adapt-to-SUSE.patch + +BuildRequires: check-devel +BuildRequires: device-mapper-devel >= 1.02.33 +BuildRequires: libblkid-devel >= 2.17 +BuildRequires: libselinux-devel +BuildRequires: libsepol-devel +BuildRequires: libtool +BuildRequires: libuuid-devel +BuildRequires: makeinfo +BuildRequires: pkg-config +BuildRequires: python3-base +BuildRequires: readline-devel +PreReq: %install_info_prereq +BuildRoot: %{_tmppath}/%{name}-%{version}-build +# bug437293 +%ifarch ppc64 +Obsoletes: parted-64bit +%endif + +%description +GNU Parted is a program for creating, destroying, resizing, checking, +and copying partitions, and the file systems on them. + +%package -n libparted2 +Summary: Library for manipulating partitions +Group: System/Libraries +Obsoletes: libparted0 + +%description -n libparted2 +Libparted is a library for creating, destroying, resizing, checking +and copying partitions and the file systems on them. + +%package -n libparted-fs-resize0 +Summary: Library for manipulating partitions +Group: System/Libraries + +%description -n libparted-fs-resize0 +Libparted is a library for creating, destroying, resizing, checking +and copying partitions and the file systems on them. + +%package devel +Summary: Parted Include Files and Libraries necessary for Development +Group: Development/Libraries/C and C++ +Requires: device-mapper-devel >= 1.02.33 +Requires: libparted-fs-resize0 = %version +Requires: libparted2 = %version +# bug437293 +%ifarch ppc64 +Obsoletes: parted-devel-64bit +%endif + +%description devel +This package contains all necessary include files and libraries needed +to develop applications that require these. + +%lang_package + +%prep +%setup -a 4 +%patch1 -p1 +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 +%patch14 -p1 +%patch16 -p1 +%patch17 -p1 +%patch18 -p1 +%patch19 -p1 +%patch21 -p1 +%patch22 -p1 +%patch23 -p1 +%patch24 -p1 +%patch25 -p1 +%patch26 -p1 +%patch27 -p1 +%patch29 -p1 +%patch31 -p1 +%patch32 -p1 +%patch33 -p1 +%patch34 -p1 +%patch36 -p1 +%patch37 -p1 +%patch38 -p1 +%patch39 -p1 +%patch100 -p1 +%patch101 -p1 +%patch156 -p1 +%patch157 -p1 +%patch158 -p1 +%patch200 -p1 + +%build +export CFLAGS="%{optflags} `ncursesw6-config --cflags`" +export LIBS="`ncursesw6-config --libs`" +AUTOPOINT=true autoreconf --force --install +%configure --disable-static \ + --enable-device-mapper=yes \ + --enable-dynamic-loading=no \ + --enable-selinux \ + --disable-silent-rules +make %{?_smp_mflags} + +%check +make check + +%install +%make_install +rm %{buildroot}%{_libdir}/*.la +%find_lang %{name} + +%post +%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz + +%preun +%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz + +%post -n libparted2 -p /sbin/ldconfig +%postun -n libparted2 -p /sbin/ldconfig + +%post -n libparted-fs-resize0 -p /sbin/ldconfig +%postun -n libparted-fs-resize0 -p /sbin/ldconfig + +%files +%defattr(-,root,root) +%license COPYING +%doc AUTHORS BUGS ChangeLog NEWS README THANKS TODO +%{_sbindir}/* +%{_mandir}/man8/part*.8.gz +%doc %{_infodir}/*.info* + +%files devel +%defattr(-,root,root) +%doc doc/API doc/FAT +%{_includedir}/* +%{_libdir}/pkgconfig/libparted*.pc +%{_libdir}/*.so + +%files -n libparted2 +%defattr(-,root,root) +%{_libdir}/libparted.so.* + +%files -n libparted-fs-resize0 +%defattr(-,root,root) +%{_libdir}/libparted-fs-resize.so.* + +%files lang -f %{name}.lang + +%changelog diff --git a/tests-adapt-to-SUSE.patch b/tests-adapt-to-SUSE.patch new file mode 100644 index 0000000..ad99fbf --- /dev/null +++ b/tests-adapt-to-SUSE.patch @@ -0,0 +1,121 @@ +From: Sebastian Parschauer +Date: Wed Sep 13 11:14:42 2017 +0200 +Subject: tests: Adapt to SUSE parted +Patch-mainline: no, custom SUSE patch + +msdos type flag +Tests: t0283, t2200, t2310, t3200, t3300, t4100, t6002, t9042 +For: parted-type.patch + +Change dm partition name from 'pN' to '-partN' +Tests: t6001, t6002, t6004, t6005 +For: libparted-partition-naming.patch +--- +Index: parted-3.3/tests/t6001-psep.sh +=================================================================== +--- parted-3.3.orig/tests/t6001-psep.sh ++++ parted-3.3/tests/t6001-psep.sh +@@ -31,9 +31,9 @@ linear2_=plinear-$$foo + d1= d2= + f1= f2= + cleanup_fn_() { +- dmsetup remove ${linear_}p1 ++ dmsetup remove ${linear_}-part1 + dmsetup remove $linear_ +- dmsetup remove ${linear2_}1 ++ dmsetup remove ${linear2_}-part1 + dmsetup remove $linear2_ + test -n "$d1" && losetup -d "$d1" + test -n "$d2" && losetup -d "$d2" +@@ -56,7 +56,7 @@ parted -s $dev mklabel msdos mkpart prim + compare /dev/null out || fail=1 + + #make sure device name is correct +-wait_for_dev_to_appear_ ${dev}p1 || fail=1 ++wait_for_dev_to_appear_ ${dev}-part1 || fail=1 + + #repeat on name not ending in a digit + # setup: create a mapping +@@ -68,7 +68,7 @@ parted -s $dev mklabel msdos mkpart prim + compare /dev/null out || fail=1 + + #make sure device name is correct +-wait_for_dev_to_appear_ ${dev}1 || fail=1 ++wait_for_dev_to_appear_ ${dev}-part1 || fail=1 + + if [ -n "$fail" ]; then + ls /dev/mapper +Index: parted-3.3/tests/t6004-dm-many-partitions.sh +=================================================================== +--- parted-3.3.orig/tests/t6004-dm-many-partitions.sh ++++ parted-3.3/tests/t6004-dm-many-partitions.sh +@@ -50,10 +50,10 @@ parted -m -a min -s /dev/mapper/$dm_name + + # Make sure all the partitions appeared under /dev/mapper/ + for ((i=1; i<=$n_partitions; i+=1)); do +- wait_for_dev_to_appear_ "/dev/mapper/${dm_name}p$i" || { fail=1; break; } ++ wait_for_dev_to_appear_ "/dev/mapper/${dm_name}-part$i" || { fail=1; break; } + + # remove the partitions as we go, otherwise cleanup won't work. +- dmsetup remove /dev/mapper/${dm_name}p$i ++ dmsetup remove /dev/mapper/${dm_name}-part$i + done + + Exit $fail +Index: parted-3.3/tests/t6005-dm-uuid.sh +=================================================================== +--- parted-3.3.orig/tests/t6005-dm-uuid.sh ++++ parted-3.3/tests/t6005-dm-uuid.sh +@@ -47,14 +47,14 @@ for ((i=1; i<=$n_partitions; i+=1)); do + cmd="$cmd mkpart p$i ${s}s ${s}s" + done + parted -m -a min -s /dev/mapper/$dm_name mklabel gpt $cmd > /dev/null 2>&1 || fail=1 +-wait_for_dev_to_appear_ /dev/mapper/${dm_name}p${n_partitions} || fail=1 ++wait_for_dev_to_appear_ /dev/mapper/${dm_name}-part${n_partitions} || fail=1 + + # Make sure all the partitions have UUIDs + for ((i=1; i<=$n_partitions; i+=1)); do +- dmsetup info /dev/mapper/${dm_name}p$i | grep UUID || fail=1 ++ dmsetup info /dev/mapper/${dm_name}-part$i | grep UUID || fail=1 + + # remove the partitions as we go, otherwise cleanup won't work. +- dmsetup remove /dev/mapper/${dm_name}p$i ++ dmsetup remove /dev/mapper/${dm_name}-part$i + done + + Exit $fail +Index: parted-3.3/tests/t6002-dm-busy.sh +=================================================================== +--- parted-3.3.orig/tests/t6002-dm-busy.sh ++++ parted-3.3/tests/t6002-dm-busy.sh +@@ -35,9 +35,9 @@ d1= + f1= + dev= + cleanup_fn_() { +- umount "${dev}p2" > /dev/null 2>&1 +- dmsetup remove ${linear_}p1 +- dmsetup remove ${linear_}p2 ++ umount "${dev}-part2" > /dev/null 2>&1 ++ dmsetup remove ${linear_}-part1 ++ dmsetup remove ${linear_}-part2 + dmsetup remove $linear_ + test -n "$d1" && losetup -d "$d1" + rm -f "$f1" +@@ -62,14 +62,14 @@ parted -s $dev -a none mkpart primary fa + compare /dev/null out || fail=1 + + # wait for new partition device to appear +-wait_for_dev_to_appear_ ${dev}p2 || fail_ ${dev}p2 did not appear ++wait_for_dev_to_appear_ ${dev}-part2 || fail_ ${dev}-part2 did not appear + +-mkfs.vfat -F 32 ${dev}p2 || fail_ mkfs.vfat failed ++mkfs.vfat -F 32 ${dev}-part2 || fail_ mkfs.vfat failed + + mount_point=$(pwd)/mnt + + mkdir $mount_point || fail=1 +-mount "${dev}p2" "$mount_point" || fail=1 ++mount "${dev}-part2" "$mount_point" || fail=1 + + # Removal of unmounted partition must succeed. + parted -s "$dev" rm 1 > /dev/null 2>&1 || fail=1 diff --git a/tests-add-dev-md-check-to-t6100.patch b/tests-add-dev-md-check-to-t6100.patch new file mode 100644 index 0000000..be5f25b --- /dev/null +++ b/tests-add-dev-md-check-to-t6100.patch @@ -0,0 +1,118 @@ +From: Sebastian Parschauer +Date: Tue, 20 Feb 2018 12:16:26 +0100 +Subject: tests: Add /dev/md/ check to t6100 +For: libparted-canonicalize-dev-md-paths.patch +References: bsc#1078820 +Patch-mainline: submitted, 2018-02-20 + +The test t6100 checks creating two partitions with /dev/md99 and +a gpt disk label. But using an md name with the symlink in /dev/md/ +is not tested. That path might not be canonicalized and the BLKPG* +handling cannot find the existing partitions in /sys/block/$dev/. +That can be observed when creating the second partition while the +first one is in use. + +So move common code to new functions create_mddev() and +remove_mdparts(), check if the swap tools are available, retest with +/dev/md/pedtest99, msdos disk label, and the first partition as swap. + +Signed-off-by: Sebastian Parschauer +--- + tests/t6100-mdraid-partitions.sh | 62 +++++++++++++++++++++++++++++++++++----- + 1 file changed, 55 insertions(+), 7 deletions(-) + +Index: parted-3.3/tests/t6100-mdraid-partitions.sh +=================================================================== +--- parted-3.3.orig/tests/t6100-mdraid-partitions.sh ++++ parted-3.3/tests/t6100-mdraid-partitions.sh +@@ -21,6 +21,7 @@ + require_root_ + require_scsi_debug_module_ + require_mdadm_ ++require_swap_ + + # create memory-backed device + scsi_debug_setup_ dev_size_mb=10 > dev-name || +@@ -40,14 +41,28 @@ parted -s "$scsi_dev" mklabel gpt \ + compare /dev/null out || fail=1 + wait_for_dev_to_appear_ ${scsi_dev}2 || { fail=1; cat /proc/partitions; } + ++create_mddev() { ++ # create mdraid on top of both partitions ++ mdadm -C $md_dev -e0 --force -R -l1 -n2 "${scsi_dev}1" "${scsi_dev}2" ++ wait_for_dev_to_appear_ ${md_dev} || { fail=1; cat /proc/partitions; } ++} ++ + cleanup_fn_() { + # stop mdraid array + mdadm -S $md_dev || warn_ "Failed to stop MD array, $md_dev" + } + +-# create mdraid on top of both partitions with v0.90 metadata +-mdadm -C $md_dev -e0 --force -R -l1 -n2 "${scsi_dev}1" "${scsi_dev}2" +-wait_for_dev_to_appear_ ${md_dev} || { fail=1; cat /proc/partitions; } ++remove_mdparts() { ++ # Remove partitions from the raid device. ++ parted -s $md_dev rm 2 rm 1 > out 2>&1 || fail=1 ++ compare /dev/null out || fail=1 ++ ++ # Verify that kernel has been informed about those removals. ++ wait_for_dev_to_disappear_ ${md_dev}p1 2 || { fail=1; cat /proc/partitions; } ++ wait_for_dev_to_disappear_ ${md_dev}p2 2 || { fail=1; cat /proc/partitions; } ++} ++ ++create_mddev + + # create gpt and two partitions on the raid device + parted -s $md_dev mklabel gpt \ +@@ -58,12 +73,45 @@ compare /dev/null out || fail=1 + # Verify that kernel has been informed about the second device. + wait_for_dev_to_appear_ ${md_dev}p2 || { fail=1; cat /proc/partitions; } + +-# Remove partitions from the raid device. +-parted -s $md_dev rm 2 rm 1 > out 2>&1 || fail=1 ++remove_mdparts ++ ++######################################################################## ++# Second part with /dev/md/ symlink, msdos label and busy swap partition ++ ++cleanup_fn_ ++ ++# Arbitrary name, not likely to be used already ++md_name=pedtest99 ++md_dev=/dev/md/$md_name ++ ++test -b $md_dev && skip_ "$md_dev already exists" ++ ++create_mddev ++ ++# create msdos and one partition on the raid device ++parted -s $md_dev mklabel msdos \ ++ mkpart primary ext2 1M 2M > out 2>&1 || fail=1 ++compare /dev/null out || fail=1 ++ ++# Verify that kernel has been informed about the device. ++wait_for_dev_to_appear_ ${md_dev}p1 || { fail=1; cat /proc/partitions; } ++ ++# Create swap filesystem ++mkswap -f ${md_dev}p1 || fail=1 ++ ++# Use as swap to make it busy ++swapon ${md_dev}p1 || fail=1 ++ ++# create msdos and one partition on the raid device ++parted -s $md_dev mkpart primary ext2 2M 3M > out 2>&1 || fail=1 + compare /dev/null out || fail=1 + +-# Verify that kernel has been informed about those removals. +-wait_for_dev_to_disappear_ ${md_dev}p1 2 || { fail=1; cat /proc/partitions; } +-wait_for_dev_to_disappear_ ${md_dev}p2 2 || { fail=1; cat /proc/partitions; } ++# Verify that kernel has been informed about the second device. ++wait_for_dev_to_appear_ ${md_dev}p2 || { fail=1; cat /proc/partitions; } ++ ++# Disable swap again ++swapoff ${md_dev}p1 || warn_ "Failed to disable swap on ${md_dev}p1" ++ ++remove_mdparts + + Exit $fail diff --git a/tests-add-helper-require_swap_.patch b/tests-add-helper-require_swap_.patch new file mode 100644 index 0000000..8d305b2 --- /dev/null +++ b/tests-add-helper-require_swap_.patch @@ -0,0 +1,32 @@ +From: Sebastian Parschauer +Date: Tue, 20 Feb 2018 12:30:23 +0100 +Subject: tests: Add helper 'require_swap_' +For: libparted-canonicalize-dev-md-paths.patch +References: bsc#1078820 +Patch-mainline: submitted, 2018-02-20 + +To achieve that a partition is busy, it is easiest to use it as swap +partition. So check if mkswap, swapon, and swapoff are available. + +Signed-off-by: Sebastian Parschauer +--- + tests/t-lib-helpers.sh | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/tests/t-lib-helpers.sh b/tests/t-lib-helpers.sh +index 9312343..962b4f1 100644 +--- a/tests/t-lib-helpers.sh ++++ b/tests/t-lib-helpers.sh +@@ -362,6 +362,12 @@ require_xfs_() + mkfs.xfs -V || skip_ "this test requires XFS support" + } + ++require_swap_() ++{ ++ mkswap -V && swapon -V && swapoff -V || \ ++ skip_ "this test requires swap support" ++} ++ + require_dvhtool_() + { + dvhtool --help \ diff --git a/tests-disable.patch b/tests-disable.patch new file mode 100644 index 0000000..8154233 --- /dev/null +++ b/tests-disable.patch @@ -0,0 +1,25 @@ +diff --git a/libparted/tests/Makefile.am b/libparted/tests/Makefile.am +index c92a3a3..915bbc4 100644 +--- a/libparted/tests/Makefile.am ++++ b/libparted/tests/Makefile.am +@@ -3,7 +3,7 @@ + # + # This file may be modified and/or distributed without restriction. + +-TESTS = t1000-label.sh t2000-disk.sh t2100-zerolen.sh t3000-symlink.sh t4000-volser.sh ++TESTS = t1000-label.sh t2000-disk.sh t2100-zerolen.sh t3000-symlink.sh + EXTRA_DIST = $(TESTS) + check_PROGRAMS = label disk zerolen symlink volser + AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS) +diff --git a/tests/Makefile.am b/tests/Makefile.am +index f9340aa..9d0d08f 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -60,7 +60,6 @@ TESTS = \ + t3200-type-change.sh \ + t3210-gpt-type-change.sh \ + t3300-palo-prep.sh \ +- t3310-flags.sh \ + t3400-whole-disk-FAT-partition.sh \ + t4000-sun-raid-type.sh \ + t4001-sun-vtoc.sh \ diff --git a/type-command.patch b/type-command.patch new file mode 100644 index 0000000..ce807fa --- /dev/null +++ b/type-command.patch @@ -0,0 +1,117 @@ +--- a/parted/parted.c 2022-05-18 09:11:33.731616339 +0200 ++++ b/parted/parted.c 2022-05-18 09:16:40.517372633 +0200 +@@ -187,6 +187,8 @@ + static const char* name_msg = N_("NAME is any word you want\n"); + static const char* type_id_msg = N_("TYPE_ID is a value between 0x01 and 0xff\n"); + static const char* type_uuid_msg = N_("TYPE_UUID is a non-null uuid\n"); ++static const char* type_msg = N_("TYPE_ID is a value between 0x01 and 0xff, " ++ "TYPE_UUID is a UUID\n"); + + static const char* copyright_msg = N_( + "Copyright (C) 1998 - 2006 Free Software Foundation, Inc.\n" +@@ -1090,6 +1092,90 @@ + return 0; + } + ++static int ++do_type (PedDevice** dev, PedDisk** diskp) ++{ ++ if (!*diskp) ++ *diskp = ped_disk_new (*dev); ++ if (!*diskp) ++ goto error; ++ ++ bool has_type_id = ped_disk_type_check_feature ((*diskp)->type, ++ PED_DISK_TYPE_PARTITION_TYPE_ID); ++ bool has_type_uuid = ped_disk_type_check_feature ((*diskp)->type, ++ PED_DISK_TYPE_PARTITION_TYPE_UUID); ++ ++ PED_ASSERT (!(has_type_id && has_type_uuid)); ++ ++ if (!has_type_id && !has_type_uuid) { ++ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL, ++ _("%s disk labels do not support partition type."), ++ (*diskp)->type->name); ++ goto error; ++ } ++ ++ PedPartition* part = NULL; ++ if (!command_line_get_partition (_("Partition number?"), *diskp, &part)) ++ goto error; ++ ++ char* input = NULL; ++ ++ if (has_type_id) { ++ uint8_t type_id = ped_partition_get_type_id (part); ++ static char buf[8]; ++ snprintf(buf, 8, "0x%02x", type_id); ++ ++ input = command_line_get_word (_("Partition type-id?"), buf, NULL, 0); ++ if (!input) ++ goto error; ++ ++ unsigned int tmp = strtol (input, (char**) NULL, 16); ++ if (tmp < 0x01 || tmp > 0xff) { ++ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL, ++ _("Invalid type-id.")); ++ goto error_free_input; ++ } ++ ++ if (!ped_partition_set_type_id (part, tmp)) ++ goto error_free_input; ++ } ++ ++ if (has_type_uuid) { ++ uint8_t* type_uuid = ped_partition_get_type_uuid (part); ++ static char buf[UUID_STR_LEN]; ++ uuid_unparse_lower (type_uuid, buf); ++ free (type_uuid); ++ ++ input = command_line_get_word (_("Partition type-uuid?"), buf, NULL, 0); ++ if (!input) ++ goto error; ++ ++ uuid_t tmp; ++ if (uuid_parse (input, tmp) != 0 || uuid_is_null (tmp)) { ++ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL, ++ _("Invalid type-uuid.")); ++ goto error_free_input; ++ } ++ ++ if (!ped_partition_set_type_uuid (part, tmp)) ++ goto error_free_input; ++ } ++ ++ free (input); ++ ++ // Reset the fs_type based on the filesystem, if it exists ++ part->fs_type = ped_file_system_probe (&part->geom); ++ ++ if (!ped_disk_commit (*diskp)) ++ goto error; ++ return 1; ++ ++error_free_input: ++ free (input); ++error: ++ return 0; ++} ++ + static char* + partition_print_flags (PedPartition const *part) + { +@@ -2581,6 +2667,14 @@ + str_list_create (_(number_msg), flag_msg, NULL), 1)); + + command_register (commands, command_create ( ++ str_list_create_unique ("type", _("type"), NULL), ++ do_type, ++ str_list_create ( ++_("type NUMBER TYPE-ID or TYPE-UUID type set TYPE-ID or TYPE-UUID of partition NUMBER"), ++NULL), ++ str_list_create (_(number_msg), _(type_msg), NULL), 1)); ++ ++command_register (commands, command_create ( + str_list_create_unique ("unit", _("unit"), NULL), + do_unit, + str_list_create (