New Bazaar snapshot (mipsel build fix, LVM-on-RAID probing fix).

This commit is contained in:
Colin Watson 2010-11-26 12:57:41 +00:00
commit c54ea3a641
8 changed files with 86 additions and 45 deletions

View File

@ -1,3 +1,35 @@
2010-11-26 Colin Watson <cjwatson@ubuntu.com>
Fix LVM-on-RAID probing.
* util/grub-probe.c (probe): Remember which disk was detected as
RAID (perhaps an LVM physical volume). Use that disk's raidname
rather than that of the top-level disk.
2010-11-25 BVK Chaitanya <bvk.groups@gmail.com>
Fix cmdline argument quotes for setparams command of menuentry
definitions.
* grub-core/commands/menuentry.c (setparams_prefix): Use single
quotes for arguments.
* grub-core/lib/legacy_parse.c (grub_legacy_escape): Use
grub_strchrsub function instead.
* include/grub/misc.h (grub_strchrsub): New function.
2010-11-24 Colin Watson <cjwatson@ubuntu.com>
* util/deviceiter.c (grub_util_iterate_devices): Save a bit of
effort by skipping "." and ".." entries up-front.
Suggested by: Michael Lazarev.
2010-11-24 Colin Watson <cjwatson@ubuntu.com>
* grub-core/Makefile.core.def (xz_decompress): Move -lgcc from
ldflags to ldadd, to fix link line ordering.
(none_decompress): Likewise.
2010-11-24 Colin Watson <cjwatson@ubuntu.com> 2010-11-24 Colin Watson <cjwatson@ubuntu.com>
* grub-core/Makefile.core.def (kernel): Add kern/emu/cache.S for emu * grub-core/Makefile.core.def (kernel): Add kern/emu/cache.S for emu

3
debian/changelog vendored
View File

@ -1,5 +1,6 @@
grub2 (1.99~20101124-2) UNRELEASED; urgency=low grub2 (1.99~20101126-1) UNRELEASED; urgency=low
* New Bazaar snapshot (mipsel build fix, LVM-on-RAID probing fix).
* Fix comma-separation in handling of grub-pc/install_devices. * Fix comma-separation in handling of grub-pc/install_devices.
-- Colin Watson <cjwatson@debian.org> Fri, 26 Nov 2010 12:23:06 +0000 -- Colin Watson <cjwatson@debian.org> Fri, 26 Nov 2010 12:23:06 +0000

View File

@ -300,7 +300,8 @@ image = {
mips_cppflags = '-I$(srcdir)/lib/posix_wrap -I$(srcdir)/lib/xzembed -DGRUB_EMBED_DECOMPRESSOR=1 -DGRUB_MACHINE_LINK_ADDR=0x80200000'; mips_cppflags = '-I$(srcdir)/lib/posix_wrap -I$(srcdir)/lib/xzembed -DGRUB_EMBED_DECOMPRESSOR=1 -DGRUB_MACHINE_LINK_ADDR=0x80200000';
objcopyflags = '-O binary'; objcopyflags = '-O binary';
ldflags = '-lgcc -static-libgcc -Wl,-Ttext,0x80100000'; ldflags = '-static-libgcc -Wl,-Ttext,0x80100000';
ldadd = '-lgcc';
cflags = '-static-libgcc'; cflags = '-static-libgcc';
enable = mips; enable = mips;
}; };
@ -313,7 +314,8 @@ image = {
mips_cppflags = '-DGRUB_EMBED_DECOMPRESSOR=1 -DGRUB_MACHINE_LINK_ADDR=0x80200000'; mips_cppflags = '-DGRUB_EMBED_DECOMPRESSOR=1 -DGRUB_MACHINE_LINK_ADDR=0x80200000';
objcopyflags = '-O binary'; objcopyflags = '-O binary';
ldflags = '-lgcc -static-libgcc -Wl,-Ttext,0x80100000'; ldflags = '-static-libgcc -Wl,-Ttext,0x80100000';
ldadd = '-lgcc';
cflags = '-static-libgcc'; cflags = '-static-libgcc';
enable = mips; enable = mips;
}; };

View File

@ -206,20 +206,6 @@ setparams_prefix (int argc, char **args)
char *p; char *p;
char *result; char *result;
grub_size_t len = 10; grub_size_t len = 10;
static const char *escape_characters = "\"\\";
auto char *strescpy (char *, const char *, const char *);
char * strescpy (char *d, const char *s, const char *escapes)
{
while (*s)
{
if (grub_strchr (escapes, *s))
*d++ = '\\';
*d++ = *s++;
}
*d = '\0';
return d;
}
/* Count resulting string length */ /* Count resulting string length */
for (i = 0; i < argc; i++) for (i = 0; i < argc; i++)
@ -227,7 +213,7 @@ setparams_prefix (int argc, char **args)
len += 3; /* 3 = 1 space + 2 quotes */ len += 3; /* 3 = 1 space + 2 quotes */
p = args[i]; p = args[i];
while (*p) while (*p)
len += grub_strchr (escape_characters, *p++) ? 2 : 1; len += (*p++ == '\'' ? 3 : 1);
} }
result = grub_malloc (len + 2); result = grub_malloc (len + 2);
@ -235,17 +221,17 @@ setparams_prefix (int argc, char **args)
return 0; return 0;
grub_strcpy (result, "setparams"); grub_strcpy (result, "setparams");
i = 9; p = result + 9;
for (j = 0; j < argc; j++) for (j = 0; j < argc; j++)
{ {
result[i++] = ' '; *p++ = ' ';
result[i++] = '"'; *p++ = '\'';
i = strescpy (result + i, args[j], escape_characters) - result; p = grub_strchrsub (p, args[j], '\'', "'\\''");
result[i++] = '"'; *p++ = '\'';
} }
result[i++] = '\n'; *p++ = '\n';
result[i] = '\0'; *p = '\0';
return result; return result;
} }

View File

@ -322,30 +322,23 @@ struct legacy_command legacy_commands[] =
char * char *
grub_legacy_escape (const char *in, grub_size_t len) grub_legacy_escape (const char *in, grub_size_t len)
{ {
const char *ptr; char *ptr;
char *ret, *outptr; char *ret;
char saved;
int overhead = 0; int overhead = 0;
for (ptr = in; ptr < in + len && *ptr; ptr++)
for (ptr = (char*)in; ptr < in + len && *ptr; ptr++)
if (*ptr == '\'') if (*ptr == '\'')
overhead += 3; overhead += 3;
ret = grub_malloc (ptr - in + overhead + 1); ret = grub_malloc (ptr - in + overhead + 1);
if (!ret) if (!ret)
return NULL; return NULL;
outptr = ret;
for (ptr = in; ptr < in + len && *ptr; ptr++)
{
if (*ptr == '\'')
{
*outptr++ = '\'';
*outptr++ = '\\';
*outptr++ = '\'';
*outptr++ = '\'';
continue;
}
*outptr++ = *ptr; ptr = (char*)in;
} saved = ptr[len];
*outptr++ = 0; ptr[len] = '\0';
grub_strchrsub (ret, ptr, '\'', "'\\''");
ptr[len] = saved;
return ret; return ret;
} }

View File

@ -193,6 +193,26 @@ grub_strncasecmp (const char *s1, const char *s2, grub_size_t n)
return (int) grub_tolower (*s1) - (int) grub_tolower (*s2); return (int) grub_tolower (*s1) - (int) grub_tolower (*s2);
} }
/* Replace all `ch' characters of `input' with `with' and copy the
result into `output'; return EOS address of `output'. */
static inline char *
grub_strchrsub (char *output, const char *input, char ch, const char *with)
{
grub_size_t grub_strlen (const char *s);
while (*input)
{
if (*input == ch)
{
grub_strcpy (output, with);
output += grub_strlen (with);
input++;
continue;
}
*output++ = *input++;
}
*output = '\0';
return output;
}
unsigned long EXPORT_FUNC(grub_strtoul) (const char *str, char **end, int base); unsigned long EXPORT_FUNC(grub_strtoul) (const char *str, char **end, int base);
unsigned long long EXPORT_FUNC(grub_strtoull) (const char *str, char **end, int base); unsigned long long EXPORT_FUNC(grub_strtoull) (const char *str, char **end, int base);

View File

@ -536,6 +536,10 @@ grub_util_iterate_devices (int NESTED_FUNC_ATTR (*hook) (const char *, int),
necessary. */ necessary. */
for (entry = readdir (dir); entry; entry = readdir (dir)) for (entry = readdir (dir); entry; entry = readdir (dir))
{ {
/* Skip current and parent directory entries. */
if (strcmp (entry->d_name, ".") == 0 ||
strcmp (entry->d_name, "..") == 0)
continue;
/* Skip partition entries. */ /* Skip partition entries. */
if (strstr (entry->d_name, "-part")) if (strstr (entry->d_name, "-part"))
continue; continue;

View File

@ -142,6 +142,7 @@ probe (const char *path, char *device_name)
int is_raid5 = 0; int is_raid5 = 0;
int is_raid6 = 0; int is_raid6 = 0;
int raid_level; int raid_level;
grub_disk_t raid_disk;
raid_level = probe_raid_level (dev->disk); raid_level = probe_raid_level (dev->disk);
if (raid_level >= 0) if (raid_level >= 0)
@ -149,6 +150,7 @@ probe (const char *path, char *device_name)
is_raid = 1; is_raid = 1;
is_raid5 |= (raid_level == 5); is_raid5 |= (raid_level == 5);
is_raid6 |= (raid_level == 6); is_raid6 |= (raid_level == 6);
raid_disk = dev->disk;
} }
if ((is_lvm) && (dev->disk->dev->memberlist)) if ((is_lvm) && (dev->disk->dev->memberlist))
@ -161,6 +163,7 @@ probe (const char *path, char *device_name)
is_raid = 1; is_raid = 1;
is_raid5 |= (raid_level == 5); is_raid5 |= (raid_level == 5);
is_raid6 |= (raid_level == 6); is_raid6 |= (raid_level == 6);
raid_disk = list->disk;
} }
tmp = list->next; tmp = list->next;
@ -175,8 +178,8 @@ probe (const char *path, char *device_name)
printf ("raid5rec "); printf ("raid5rec ");
if (is_raid6) if (is_raid6)
printf ("raid6rec "); printf ("raid6rec ");
if (dev->disk->dev->raidname) if (raid_disk->dev->raidname)
printf ("%s ", dev->disk->dev->raidname (dev->disk)); printf ("%s ", raid_disk->dev->raidname (raid_disk));
} }
if (is_lvm) if (is_lvm)