- 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 OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=79
74 lines
1.9 KiB
Diff
74 lines
1.9 KiB
Diff
---
|
|
libparted/arch/linux.c | 45 ++++++++++++++++++++++++++++-----------------
|
|
1 file changed, 28 insertions(+), 17 deletions(-)
|
|
|
|
Index: parted-3.1/libparted/arch/linux.c
|
|
===================================================================
|
|
--- parted-3.1.orig/libparted/arch/linux.c
|
|
+++ parted-3.1/libparted/arch/linux.c
|
|
@@ -33,6 +33,7 @@
|
|
#include <stdio.h>
|
|
#include <syscall.h>
|
|
#include <unistd.h>
|
|
+#include <stdlib.h>
|
|
#include <stdbool.h>
|
|
#include <dirent.h>
|
|
#include <sys/ioctl.h>
|
|
@@ -2858,29 +2859,39 @@ err:
|
|
static int
|
|
_dm_reread_part_table (PedDisk* disk)
|
|
{
|
|
- int largest_partnum = ped_disk_get_last_partition_num (disk);
|
|
- if (largest_partnum <= 0)
|
|
- return 1;
|
|
-
|
|
- int rc = 1;
|
|
- int last = PED_MIN (largest_partnum, 16);
|
|
- int i;
|
|
+ int dev_minor;
|
|
+ int dev_major;
|
|
+ struct stat dev_stat;
|
|
+ char name_buf[40];
|
|
+ FILE* f;
|
|
|
|
sync();
|
|
- if (!_dm_remove_parts(disk->dev))
|
|
- rc = 0;
|
|
|
|
- for (i = 1; i <= last; i++) {
|
|
- PedPartition* part;
|
|
+ /* Issue uevent for the device */
|
|
+ if (!_device_stat (disk->dev, &dev_stat))
|
|
+ return 0;
|
|
|
|
- part = ped_disk_get_partition (disk, i);
|
|
- if (!part)
|
|
- continue;
|
|
+ dev_major = major (dev_stat.st_rdev);
|
|
+ dev_minor = minor (dev_stat.st_rdev);
|
|
|
|
- if (!_dm_add_partition (disk, part))
|
|
- rc = 0;
|
|
+ snprintf (name_buf, sizeof (name_buf),
|
|
+ "/sys/dev/block/%d:%d/uevent", dev_major, dev_minor);
|
|
+
|
|
+ if ((f = fopen (name_buf, "w")) == NULL)
|
|
+ return 0;
|
|
+
|
|
+ if (fputs ("change", f) == EOF)
|
|
+ return 0;
|
|
+
|
|
+ fclose(f);
|
|
+
|
|
+ /* Wait for udev to finish */
|
|
+ if (system ("/sbin/udevadm settle --timeout=20") != 0) {
|
|
+ /* udevadm settle failed - let's sleep for a while */
|
|
+ sleep (2);
|
|
}
|
|
- return rc;
|
|
+
|
|
+ return 1;
|
|
}
|
|
#endif
|
|
|