Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP2:GA
grub2.16181
grub2-use-stat-instead-of-udevadm-for-partition...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File grub2-use-stat-instead-of-udevadm-for-partition-lookup.patch of Package grub2.16181
From: Jeff Mahoney <jeffm@suse.com> Subject: grub2: use stat instead of udevadm for partition lookup References: bnc#883635 sysfs_partition_path calls udevadm to resolve the sysfs path for a block device. That can be accomplished by stating the device node and using the major/minor to follow the symlinks in /sys/dev/block/. This cuts the execution time of grub2-mkconfig from 10s to 2s on my system. Signed-off-by: Jeff Mahoney <jeffm@suse.com> --- grub-core/osdep/linux/hostdisk.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) --- a/grub-core/osdep/linux/hostdisk.c +++ b/grub-core/osdep/linux/hostdisk.c @@ -105,6 +106,13 @@ sysfs_partition_path (const char *dev, c char *buf = NULL; size_t len = 0; char *path = NULL; + struct stat st; + int ret; + + ret = stat(dev, &st); + if (ret == 0 && S_ISBLK(st.st_mode)) + return xasprintf ("/sys/dev/block/%u:%u/%s", + major (st.st_rdev), minor (st.st_rdev), entry); argv[0] = "udevadm"; argv[1] = "info";
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