SHA256
1
0
forked from pool/grub2

Accepting request 238220 from Base:System

1

OBS-URL: https://build.opensuse.org/request/show/238220
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/grub2?expand=0&rev=91
This commit is contained in:
Stephan Kulow 2014-06-24 13:15:46 +00:00 committed by Git OBS Bridge
parent fa5d347542
commit a0fcee561c
3 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,32 @@
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";

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Jun 20 19:50:28 UTC 2014 - jeffm@suse.com
- grub2: use stat instead of udevadm for partition lookup (bnc#883635)
* Added grub2-use-stat-instead-of-udevadm-for-partition-lookup.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Apr 15 08:36:46 UTC 2014 - tchvatal@suse.com Tue Apr 15 08:36:46 UTC 2014 - tchvatal@suse.com

View File

@ -173,6 +173,7 @@ Patch223: grub2-ppc64le-23-grub-segfaults-if-initrd-is-specified-before-sp
Patch224: grub2-ppc64-build-ppc64-32bit.patch Patch224: grub2-ppc64-build-ppc64-32bit.patch
Patch225: grub2-ppc64-qemu.patch Patch225: grub2-ppc64-qemu.patch
Patch226: grub2-ppc64le-timeout.patch Patch226: grub2-ppc64le-timeout.patch
Patch227: grub2-use-stat-instead-of-udevadm-for-partition-lookup.patch
Requires: gettext-runtime Requires: gettext-runtime
%if 0%{?suse_version} >= 1140 %if 0%{?suse_version} >= 1140
@ -362,6 +363,7 @@ mv po/grub.pot po/%{name}.pot
%patch224 -p1 %patch224 -p1
%patch225 -p1 %patch225 -p1
%patch226 -p1 %patch226 -p1
%patch227 -p1
# Generate po/LINGUAS for message catalogs ... # Generate po/LINGUAS for message catalogs ...
./linguas.sh ./linguas.sh