merge with mainline

This commit is contained in:
BVK Chaitanya 2010-05-28 16:23:07 +05:30
commit 64c10cde57
6 changed files with 44 additions and 7 deletions

View file

@ -1,3 +1,31 @@
2010-05-27 Colin Watson <cjwatson@ubuntu.com>
* util/grub-script-check.c (main): Ensure defined behaviour on empty
input files (in which case exit zero).
2010-05-27 Colin Watson <cjwatson@ubuntu.com>
* kern/emu/misc.c (canonicalize_file_name): realpath can still
return NULL for various reasons even if it has a maximum-length
buffer: for example, there might be a symlink loop, or the path
might exceed PATH_MAX. If this happens, return NULL.
2010-05-27 Robert Millan <rmh@gnu.org>
* util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Insert
partmap module to handle cross-partmap setups.
Reported by Orestes Mas. Gràcies!
2010-05-27 Colin Watson <cjwatson@ubuntu.com>
* util/grub-mkrescue.in: Initialise override_dir rather than
assuming that it's unset or empty in the environment.
2010-05-26 Grégoire Sutre <gregoire.sutre@gmail.com>
* kern/emu/hostdisk.c (find_partition_start) [__NetBSD__]: Renamed
variable index into p_index to suppress a warning with -Wshadow.
2010-05-25 BVK Chaitanya <bvk.groups@gmail.com> 2010-05-25 BVK Chaitanya <bvk.groups@gmail.com>
* INSTALL: Added flex >= 2.5.35 requirement. * INSTALL: Added flex >= 2.5.35 requirement.

View file

@ -338,7 +338,7 @@ find_partition_start (const char *dev)
struct hd_geometry hdg; struct hd_geometry hdg;
# else /* defined(__NetBSD__) */ # else /* defined(__NetBSD__) */
struct disklabel label; struct disklabel label;
int index; int p_index;
# endif /* !defined(__NetBSD__) */ # endif /* !defined(__NetBSD__) */
# ifdef HAVE_DEVICE_MAPPER # ifdef HAVE_DEVICE_MAPPER
@ -435,15 +435,15 @@ devmapper_fail:
# if !defined(__NetBSD__) # if !defined(__NetBSD__)
return hdg.start; return hdg.start;
# else /* defined(__NetBSD__) */ # else /* defined(__NetBSD__) */
index = dev[strlen(dev) - 1] - 'a'; p_index = dev[strlen(dev) - 1] - 'a';
if (index >= label.d_npartitions) if (p_index >= label.d_npartitions)
{ {
grub_error (GRUB_ERR_BAD_DEVICE, grub_error (GRUB_ERR_BAD_DEVICE,
"no disk label entry for `%s'", dev); "no disk label entry for `%s'", dev);
return 0; return 0;
} }
return (grub_disk_addr_t) label.d_partitions[index].p_offset; return (grub_disk_addr_t) label.d_partitions[p_index].p_offset;
# endif /* !defined(__NetBSD__) */ # endif /* !defined(__NetBSD__) */
} }
#endif /* __linux__ || __CYGWIN__ */ #endif /* __linux__ || __CYGWIN__ */

View file

@ -185,7 +185,8 @@ canonicalize_file_name (const char *path)
char *ret; char *ret;
#ifdef PATH_MAX #ifdef PATH_MAX
ret = xmalloc (PATH_MAX); ret = xmalloc (PATH_MAX);
(void) realpath (path, ret); if (!realpath (path, ret))
return NULL;
#else #else
ret = realpath (path, NULL); ret = realpath (path, NULL);
#endif #endif

View file

@ -105,6 +105,11 @@ prepare_grub_to_access_device ()
echo "insmod ${module}" echo "insmod ${module}"
done done
partmap="`${grub_probe} --device ${device} --target=partmap`"
for module in ${partmap} ; do
echo "insmod ${module}"
done
fs="`${grub_probe} --device ${device} --target=fs`" fs="`${grub_probe} --device ${device} --target=fs`"
for module in ${fs} ; do for module in ${fs} ; do
echo "insmod ${module}" echo "insmod ${module}"

View file

@ -37,6 +37,7 @@ pc_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-pc
efi32_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-efi efi32_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-efi
efi64_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/x86_64-efi efi64_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/x86_64-efi
rom_directory= rom_directory=
override_dir=
grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}` grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}`
# Usage: usage # Usage: usage

View file

@ -145,7 +145,8 @@ main (int argc, char *argv[])
char *input; char *input;
FILE *file = 0; FILE *file = 0;
int verbose = 0; int verbose = 0;
struct grub_script *script; int found_input = 0;
struct grub_script *script = NULL;
auto grub_err_t get_config_line (char **line, int cont); auto grub_err_t get_config_line (char **line, int cont);
grub_err_t get_config_line (char **line, int cont __attribute__ ((unused))) grub_err_t get_config_line (char **line, int cont __attribute__ ((unused)))
@ -247,6 +248,7 @@ main (int argc, char *argv[])
get_config_line(&input, 0); get_config_line(&input, 0);
if (! input) if (! input)
break; break;
found_input = 1;
script = grub_script_parse (input, get_config_line); script = grub_script_parse (input, get_config_line);
if (script) if (script)
@ -262,5 +264,5 @@ main (int argc, char *argv[])
grub_fini_all (); grub_fini_all ();
if (file) fclose (file); if (file) fclose (file);
return (script == 0); return (found_input && script == 0);
} }