parted/parted-type.patch

165 lines
5.8 KiB
Diff
Raw Normal View History

From: Petr Uzel <petr.uzel@suse.cz>
Subject: parted: Introduce a type flag
Patch-mainline: no, required by YaST
YaST requires a type flag in order to check the current partition
type for msdos partition tables.
---
include/parted/disk.in.h | 5 ++-
libparted/disk.c | 2 +
libparted/labels/dos.c | 8 ++++++
Accepting request 303792 from home:puzel:branches:Base:System - 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). OBS-URL: https://build.opensuse.org/request/show/303792 OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=109
2015-04-24 17:49:30 +02:00
parted/parted.c | 61 ++++++++++++++++++++++++++++++-----------------
parted/ui.c | 3 ++
Accepting request 303792 from home:puzel:branches:Base:System - 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). OBS-URL: https://build.opensuse.org/request/show/303792 OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=109
2015-04-24 17:49:30 +02:00
5 files changed, 56 insertions(+), 23 deletions(-)
Accepting request 760713 from home:anicka:branches:Base:System - fix crash in do_resizepart + parted-fix-end_input-usage.patch: Fix end_input usage in do_resizepart - 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 OBS-URL: https://build.opensuse.org/request/show/760713 OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=144
2020-01-12 14:40:37 +01:00
Index: parted-3.3/include/parted/disk.in.h
===================================================================
Accepting request 760713 from home:anicka:branches:Base:System - fix crash in do_resizepart + parted-fix-end_input-usage.patch: Fix end_input usage in do_resizepart - 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 OBS-URL: https://build.opensuse.org/request/show/760713 OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=144
2020-01-12 14:40:37 +01:00
--- parted-3.3.orig/include/parted/disk.in.h
+++ parted-3.3/include/parted/disk.in.h
@@ -78,10 +78,11 @@
Accepting request 303792 from home:puzel:branches:Base:System - 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). OBS-URL: https://build.opensuse.org/request/show/303792 OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=109
2015-04-24 17:49:30 +02:00
PED_PARTITION_IRST=17,
PED_PARTITION_ESP=18,
PED_PARTITION_CHROMEOS_KERNEL=19,
- PED_PARTITION_BLS_BOOT=20
+ PED_PARTITION_BLS_BOOT=20,
+ PED_PARTITION_TYPE=21
};
#define PED_PARTITION_FIRST_FLAG PED_PARTITION_BOOT
-#define PED_PARTITION_LAST_FLAG PED_PARTITION_BLS_BOOT
+#define PED_PARTITION_LAST_FLAG PED_PARTITION_TYPE
enum _PedDiskTypeFeature {
PED_DISK_TYPE_EXTENDED=1, /**< supports extended partitions */
Accepting request 760713 from home:anicka:branches:Base:System - fix crash in do_resizepart + parted-fix-end_input-usage.patch: Fix end_input usage in do_resizepart - 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 OBS-URL: https://build.opensuse.org/request/show/760713 OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=144
2020-01-12 14:40:37 +01:00
Index: parted-3.3/libparted/disk.c
===================================================================
Accepting request 760713 from home:anicka:branches:Base:System - fix crash in do_resizepart + parted-fix-end_input-usage.patch: Fix end_input usage in do_resizepart - 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 OBS-URL: https://build.opensuse.org/request/show/760713 OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=144
2020-01-12 14:40:37 +01:00
--- parted-3.3.orig/libparted/disk.c
+++ parted-3.3/libparted/disk.c
@@ -2389,6 +2389,8 @@ ped_partition_flag_get_name (PedPartitio
return N_("lba");
case PED_PARTITION_HPSERVICE:
return N_("hp-service");
+ case PED_PARTITION_TYPE:
+ return N_("type");
case PED_PARTITION_PALO:
return N_("palo");
case PED_PARTITION_PREP:
Accepting request 760713 from home:anicka:branches:Base:System - fix crash in do_resizepart + parted-fix-end_input-usage.patch: Fix end_input usage in do_resizepart - 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 OBS-URL: https://build.opensuse.org/request/show/760713 OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=144
2020-01-12 14:40:37 +01:00
Index: parted-3.3/libparted/labels/dos.c
===================================================================
Accepting request 760713 from home:anicka:branches:Base:System - fix crash in do_resizepart + parted-fix-end_input-usage.patch: Fix end_input usage in do_resizepart - 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 OBS-URL: https://build.opensuse.org/request/show/760713 OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=144
2020-01-12 14:40:37 +01:00
--- parted-3.3.orig/libparted/labels/dos.c
+++ parted-3.3/libparted/labels/dos.c
@@ -1565,6 +1565,10 @@ msdos_partition_set_flag (PedPartition*
disk = part->disk;
switch (flag) {
+ case PED_PARTITION_TYPE:
+ dos_data->system = state;
+ return 1;
+
case PED_PARTITION_HIDDEN:
if (part->type == PED_PARTITION_EXTENDED) {
ped_exception_throw (
Accepting request 760713 from home:anicka:branches:Base:System - fix crash in do_resizepart + parted-fix-end_input-usage.patch: Fix end_input usage in do_resizepart - 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 OBS-URL: https://build.opensuse.org/request/show/760713 OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=144
2020-01-12 14:40:37 +01:00
@@ -1690,6 +1694,9 @@ msdos_partition_get_flag (const PedParti
case PED_PARTITION_LBA:
return dos_data->lba;
+ case PED_PARTITION_TYPE:
+ return dos_data->system;
+
case PED_PARTITION_PALO:
return dos_data->palo;
Accepting request 760713 from home:anicka:branches:Base:System - fix crash in do_resizepart + parted-fix-end_input-usage.patch: Fix end_input usage in do_resizepart - 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 OBS-URL: https://build.opensuse.org/request/show/760713 OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=144
2020-01-12 14:40:37 +01:00
@@ -1728,6 +1735,7 @@ msdos_partition_is_flag_available (const
case PED_PARTITION_RAID:
case PED_PARTITION_LVM:
case PED_PARTITION_LBA:
+ case PED_PARTITION_TYPE:
case PED_PARTITION_PALO:
case PED_PARTITION_PREP:
Accepting request 303792 from home:puzel:branches:Base:System - 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). OBS-URL: https://build.opensuse.org/request/show/303792 OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=109
2015-04-24 17:49:30 +02:00
case PED_PARTITION_IRST:
Accepting request 760713 from home:anicka:branches:Base:System - fix crash in do_resizepart + parted-fix-end_input-usage.patch: Fix end_input usage in do_resizepart - 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 OBS-URL: https://build.opensuse.org/request/show/760713 OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=144
2020-01-12 14:40:37 +01:00
Index: parted-3.3/parted/parted.c
===================================================================
Accepting request 760713 from home:anicka:branches:Base:System - fix crash in do_resizepart + parted-fix-end_input-usage.patch: Fix end_input usage in do_resizepart - 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 OBS-URL: https://build.opensuse.org/request/show/760713 OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=144
2020-01-12 14:40:37 +01:00
--- parted-3.3.orig/parted/parted.c
+++ parted-3.3/parted/parted.c
@@ -928,28 +928,40 @@ error:
static char*
partition_print_flags (PedPartition const *part)
{
- char *res = xstrdup ("");
- if (!part)
- return res;
-
- PedPartitionFlag flag;
- size_t res_buf_len = 1;
- char const *sep = "";
- for (flag = ped_partition_flag_next (0); flag;
- flag = ped_partition_flag_next (flag))
- {
- if (ped_partition_get_flag (part, flag))
+ int xtype;
+ char *res = xstrdup ("");
+ if (!part)
+ return res;
+
+ PedPartitionFlag flag;
+ size_t res_buf_len = 1;
+ char const *sep = "";
+ for (flag = ped_partition_flag_next (0); flag;
+ flag = ped_partition_flag_next (flag))
{
- const char *name = _(ped_partition_flag_get_name (flag));
- size_t new_len = res_buf_len + strlen (sep) + strlen (name);
- res = xrealloc (res, new_len);
- stpcpy (stpcpy (res + res_buf_len - 1, sep), name);
- res_buf_len = new_len;
- sep = ", ";
+ if (xtype = ped_partition_get_flag (part, flag))
+ {
+ if (flag == PED_PARTITION_TYPE) {
+ char tmpstr[21];
+ int len = snprintf(tmpstr, sizeof(tmpstr) - 1, "type=%02x", xtype);
+ 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 = ", ";
+ }
+ else {
+ const char *name = _(ped_partition_flag_get_name (flag));
+ size_t new_len = res_buf_len + strlen (sep) + strlen (name);
+ res = xrealloc (res, new_len);
+ stpcpy (stpcpy (res + res_buf_len - 1, sep), name);
+ res_buf_len = new_len;
+ sep = ", ";
+ }
+ }
}
- }
- return res;
+ return res;
}
static int
Accepting request 760713 from home:anicka:branches:Base:System - fix crash in do_resizepart + parted-fix-end_input-usage.patch: Fix end_input usage in do_resizepart - 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 OBS-URL: https://build.opensuse.org/request/show/760713 OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=144
2020-01-12 14:40:37 +01:00
@@ -1808,12 +1820,19 @@ do_set (PedDevice** dev, PedDisk **diskp
Accepting request 303792 from home:puzel:branches:Base:System - 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). OBS-URL: https://build.opensuse.org/request/show/303792 OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=109
2015-04-24 17:49:30 +02:00
goto error;
if (!command_line_get_part_flag (_("Flag to Invert?"), part, &flag))
Accepting request 303792 from home:puzel:branches:Base:System - 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). OBS-URL: https://build.opensuse.org/request/show/303792 OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=109
2015-04-24 17:49:30 +02:00
goto error;
- state = (ped_partition_get_flag (part, flag) == 0 ? 1 : 0);
+ if( flag == PED_PARTITION_TYPE )
+ state = ped_partition_get_flag (part, flag);
+ else
+ state = (ped_partition_get_flag (part, flag) == 0 ? 1 : 0);
- if (!is_toggle_mode) {
+ if (!is_toggle_mode && flag != PED_PARTITION_TYPE ) {
if (!command_line_get_state (_("New state?"), &state))
Accepting request 303792 from home:puzel:branches:Base:System - 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). OBS-URL: https://build.opensuse.org/request/show/303792 OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=109
2015-04-24 17:49:30 +02:00
goto error;
}
Accepting request 303792 from home:puzel:branches:Base:System - 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). OBS-URL: https://build.opensuse.org/request/show/303792 OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=109
2015-04-24 17:49:30 +02:00
+ else if( flag == PED_PARTITION_TYPE ) {
+ if (!command_line_get_integer (_("New type?"), &state))
+ goto error;
+ }
if (!ped_partition_set_flag (part, flag, state))
Accepting request 303792 from home:puzel:branches:Base:System - 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). OBS-URL: https://build.opensuse.org/request/show/303792 OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=109
2015-04-24 17:49:30 +02:00
goto error;