Just like some time ago in search_fs_uuid() the search_fs() function of search also needs to be caseless when comparing UUIDs, for some reason GRUB2 didn't find my UUID although I entered it as reported by blkid. To be on the safe side, just use strncasecmp. :) Patch against git master and ChangeLog attached. I await your feedback. :-)
--
Mierswa, Daniel
If you still don't like it, that's ok: that's why I'm boss. I simply
know better than you do.
--- Linus Torvalds, comp.os.linux.advocacy, 1996/07/22
2009-07-06 Daniel Mierswa <[email protected]> * commands/search.c (search_fs): use `strcasecmp' for UUID comparsion.
From 02d806fe1e7603c38f2c885680007b6d14edeefa Mon Sep 17 00:00:00 2001 From: Daniel Mierswa <[email protected]> Date: Mon, 6 Jul 2009 09:35:17 +0200 Subject: [PATCH] ignore case for uuid comparison in search --- commands/search.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/commands/search.c b/commands/search.c index 647f408..52b5fd6 100644 --- a/commands/search.c +++ b/commands/search.c @@ -70,6 +70,13 @@ search_fs (const char *key, const char *var, int no_floppy, int is_uuid) fs = grub_fs_probe (dev); + int (*compare_fn)(const char *s1, const char *s2); + if (is_uuid) { + compare_fn = grub_strcasecmp; + } else { + compare_fn = grub_strcmp; + } + #define QUID(x) (is_uuid ? (x)->uuid : (x)->label) if (fs && QUID(fs)) @@ -79,7 +86,7 @@ search_fs (const char *key, const char *var, int no_floppy, int is_uuid) (QUID(fs)) (dev, &quid); if (grub_errno == GRUB_ERR_NONE && quid) { - if (grub_strcmp (quid, key) == 0) + if (compare_fn (quid, key) == 0) { /* Found! */ count++; -- 1.6.3.3
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Grub-devel mailing list [email protected] http://lists.gnu.org/mailman/listinfo/grub-devel
