2009-11-04 Felix Zielcke <fzielcke@z-51.de>

* util//grub-mkconfig_lib.in (bindir): New variable.
	(grub_mkrelpath): Likewise.
	Properly set path variable.  Use ${grub_mkrelpath} instead of
	calling it directly.

2009-11-02  Felix Zielcke  <fzielcke@z-51.de>

	* util/probe.c (probe): Make the file path relative to its root.
	Change a info message to use the GRUB path.  Enable again the
	check if we can read the file with GRUB facilities.

2009-11-01  Felix Zielcke  <fzielcke@z-51.de>

	* util/grub-mkrelpath.c: New file.
	* conf/common.rmk (bin_UTILITIES): Add grub-mkrelpath.
	(grub_mkrelpath_SOURCES): New variable.
	* include/grub/util/misc.h: New function prototype.
	* util/misc.c (make_system_path_relative_to_its_root): New function.

	* util/grub-mkconfig_lib.in (make_system_path_relative_to_its_root):
	Use grub-mkrelpath.
This commit is contained in:
Felix Zielcke 2009-11-08 01:49:15 +01:00
parent c926e1d585
commit 50ceeb7cb5
7 changed files with 219 additions and 50 deletions

View file

@ -235,9 +235,6 @@ probe (const char *path, char *device_name)
if (print == PRINT_FS)
{
/* FIXME: `path' can't be used to read a file via GRUB facilities,
because it's not relative to its root. */
#if 0
struct stat st;
stat (path, &st);
@ -247,11 +244,14 @@ probe (const char *path, char *device_name)
/* Regular file. Verify that we can read it properly. */
grub_file_t file;
char *rel_path;
grub_util_info ("reading %s via OS facilities", path);
filebuf_via_sys = grub_util_read_image (path);
grub_util_info ("reading %s via GRUB facilities", path);
asprintf (&grub_path, "(%s)%s", drive_name, path);
rel_path = make_system_path_relative_to_its_root (path);
asprintf (&grub_path, "(%s)%s", drive_name, rel_path);
free (rel_path);
grub_util_info ("reading %s via GRUB facilities", grub_path);
file = grub_file_open (grub_path);
filebuf_via_grub = xmalloc (file->size);
grub_file_read (file, filebuf_via_grub, file->size);
@ -261,7 +261,6 @@ probe (const char *path, char *device_name)
if (memcmp (filebuf_via_grub, filebuf_via_sys, file->size))
grub_util_error ("files differ");
}
#endif
printf ("%s\n", fs->name);
}