checked in (request 43319) OBS-URL: https://build.opensuse.org/request/show/43319 OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=27
68 lines
2.6 KiB
Plaintext
68 lines
2.6 KiB
Plaintext
---
|
|
parted/parted.c | 24 +++++++++++++++++++++---
|
|
1 file changed, 21 insertions(+), 3 deletions(-)
|
|
|
|
Index: parted/parted.c
|
|
===================================================================
|
|
--- parted/parted.c.orig 2010-02-02 11:28:07.000000000 +0100
|
|
+++ parted/parted.c 2010-02-02 11:31:00.000000000 +0100
|
|
@@ -1853,7 +1853,7 @@ do_resize (PedDevice** dev)
|
|
issue_fs_op_warning ("resize");
|
|
PedDisk *disk;
|
|
PedPartition *part = NULL;
|
|
- PedFileSystem *fs;
|
|
+ PedFileSystem *fs = NULL;
|
|
PedConstraint *constraint;
|
|
PedSector start, end;
|
|
PedGeometry *range_start = NULL, *range_end = NULL;
|
|
@@ -1890,22 +1890,39 @@ do_resize (PedDevice** dev)
|
|
goto error_destroy_constraint;
|
|
ped_partition_set_system (part, NULL);
|
|
} else {
|
|
+ int always_resize = getenv( "YAST_IS_RUNNING" ) != NULL;
|
|
+ const char* fsname = "";
|
|
+ if( always_resize )
|
|
+ {
|
|
+ PedFileSystemType* fst = ped_file_system_probe( &part->geom );
|
|
+ if( fst )
|
|
+ fsname = fst->name;
|
|
+ }
|
|
fs = ped_file_system_open (&part->geom);
|
|
- if (!fs)
|
|
+ if (!fs && (!always_resize || strncmp(fsname,"fat",3)==0) )
|
|
goto error_destroy_disk;
|
|
+ if (fs)
|
|
constraint = constraint_intersect_and_destroy (
|
|
ped_file_system_get_resize_constraint (fs),
|
|
constraint_from_start_end (
|
|
*dev, range_start, range_end));
|
|
+ else
|
|
+ {
|
|
+ new_geom.start = part->geom.start;
|
|
+ constraint = ped_constraint_exact(&new_geom);
|
|
+ }
|
|
if (!ped_disk_set_partition_geom (disk, part, constraint,
|
|
new_geom.start, new_geom.end))
|
|
goto error_close_fs;
|
|
- if (!ped_file_system_resize (fs, &part->geom, g_timer))
|
|
+ if(fs)
|
|
+ {
|
|
+ if (!ped_file_system_resize (fs, &part->geom, g_timer) && !always_resize )
|
|
goto error_close_fs;
|
|
/* may have changed... eg fat16 -> fat32 */
|
|
ped_partition_set_system (part, fs->type);
|
|
ped_file_system_close (fs);
|
|
}
|
|
+ }
|
|
|
|
ped_disk_commit (disk);
|
|
ped_constraint_destroy (constraint);
|
|
@@ -1921,6 +1938,7 @@ do_resize (PedDevice** dev)
|
|
return 1;
|
|
|
|
error_close_fs:
|
|
+ if (fs)
|
|
ped_file_system_close (fs);
|
|
error_destroy_constraint:
|
|
ped_constraint_destroy (constraint);
|