parted/parted-1.9.0-entiredisk-rh533328.patch
Hans de Goede ce6563fae4 - Allow partitioning of loopback devices (#546622)
- Add libparted function to query maximum partition length and start
    addresses for a given disk (#533417)
- Add per disk flags functions from upstream, this is the way upstream has
    implemented the disable cylinder alignment functionality
- Add --align cmdline option to specify how to align new partitions see the
    parted man page for details (#361951)
- Make the default alignment for new partitions optimal (#361951)
- When cylinder alignment is disabled, allow use of the last (incomplete)
    cylinder of the disk (#533328)
- Don't crash when printing partition tables in Russian (#543029)
- Make parted work correctly with new lvm (#525095)
2009-12-18 09:42:14 +00:00

53 lines
2.0 KiB
Diff

diff -up parted-1.9.0/libparted/disk.c.entiredisk parted-1.9.0/libparted/disk.c
--- parted-1.9.0/libparted/disk.c.entiredisk 2009-12-15 19:22:01.000000000 +0100
+++ parted-1.9.0/libparted/disk.c 2009-12-15 20:19:30.000000000 +0100
@@ -785,10 +785,15 @@ ped_disk_max_partition_start_sector (con
int
ped_disk_set_flag(PedDisk *disk, PedDiskFlag flag, int state)
{
+ int ret;
+
PED_ASSERT (disk != NULL, return 0);
PedDiskOps *ops = disk->type->ops;
+ if (!_disk_push_update_mode(disk))
+ return 0;
+
if (!ped_disk_is_flag_available(disk, flag)) {
ped_exception_throw (
PED_EXCEPTION_ERROR,
@@ -796,10 +801,16 @@ ped_disk_set_flag(PedDisk *disk, PedDisk
"The flag '%s' is not available for %s disk labels.",
ped_disk_flag_get_name(flag),
disk->type->name);
+ _disk_pop_update_mode(disk);
return 0;
}
- return ops->disk_set_flag(disk, flag, state);
+ ret = ops->disk_set_flag(disk, flag, state);
+
+ if (!_disk_pop_update_mode (disk))
+ return 0;
+
+ return ret;
}
/**
diff -up parted-1.9.0/libparted/labels/dos.c.entiredisk parted-1.9.0/libparted/labels/dos.c
--- parted-1.9.0/libparted/labels/dos.c.entiredisk 2009-12-15 19:22:01.000000000 +0100
+++ parted-1.9.0/libparted/labels/dos.c 2009-12-15 20:19:38.000000000 +0100
@@ -2242,7 +2242,10 @@ add_startend_metadata (PedDisk* disk)
else
init_end = PED_MIN (dev->bios_geom.sectors - 1, init_end - 1);
- if (!get_end_last_nonfree_part(disk, &final_start))
+ DosDiskData *disk_specific = disk->disk_specific;
+ if (!disk_specific->cylinder_alignment)
+ final_start = dev->length - 1;
+ else if (!get_end_last_nonfree_part(disk, &final_start))
final_start = ped_round_down_to (dev->length, cyl_size);
else
final_start = PED_MAX (final_start + 1,