Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.2:PowerPC
parted
do-not-create-dm-nodes.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File do-not-create-dm-nodes.patch of Package parted
Index: parted-2.4/libparted/arch/linux.c =================================================================== --- parted-2.4.orig/libparted/arch/linux.c +++ parted-2.4/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> @@ -2770,29 +2771,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
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor