mirror of
https://git.proxmox.com/git/grub2
synced 2025-05-28 07:03:27 +00:00
2010-08-09 Robert Millan <rmh@gnu.org>
* kern/emu/misc.c (grub_make_system_path_relative_to_its_root): Filter out unused variables on non-ZFS build.
This commit is contained in:
parent
346c207240
commit
07f360e92d
@ -1,3 +1,8 @@
|
||||
2010-08-09 Robert Millan <rmh@gnu.org>
|
||||
|
||||
* kern/emu/misc.c (grub_make_system_path_relative_to_its_root): Filter
|
||||
out unused variables on non-ZFS build.
|
||||
|
||||
2010-08-08 Robert Millan <rmh@gnu.org>
|
||||
|
||||
Fix path generation for sub-filesystems in ZFS.
|
||||
|
@ -307,12 +307,15 @@ char *
|
||||
grub_make_system_path_relative_to_its_root (const char *path)
|
||||
{
|
||||
struct stat st;
|
||||
char *p, *buf, *buf2, *buf3;
|
||||
char *poolname = NULL, *poolfs = NULL, *ret;
|
||||
char *p, *buf, *buf2, *buf3, *ret;
|
||||
uintptr_t offset = 0;
|
||||
dev_t num;
|
||||
size_t len;
|
||||
|
||||
#if defined(HAVE_LIBZFS) && defined(HAVE_LIBNVPAIR)
|
||||
char *poolfs = NULL;
|
||||
#endif
|
||||
|
||||
/* canonicalize. */
|
||||
p = canonicalize_file_name (path);
|
||||
if (p == NULL)
|
||||
@ -320,7 +323,10 @@ grub_make_system_path_relative_to_its_root (const char *path)
|
||||
|
||||
#if defined(HAVE_LIBZFS) && defined(HAVE_LIBNVPAIR)
|
||||
/* For ZFS sub-pool filesystems, could be extended to others (btrfs?). */
|
||||
grub_find_zpool_from_dir (p, &poolname, &poolfs);
|
||||
{
|
||||
char *dummy;
|
||||
grub_find_zpool_from_dir (p, &dummy, &poolfs);
|
||||
}
|
||||
#endif
|
||||
|
||||
len = strlen (p) + 1;
|
||||
@ -401,12 +407,14 @@ grub_make_system_path_relative_to_its_root (const char *path)
|
||||
len--;
|
||||
}
|
||||
|
||||
#if defined(HAVE_LIBZFS) && defined(HAVE_LIBNVPAIR)
|
||||
if (poolfs)
|
||||
{
|
||||
ret = xasprintf ("/%s/@%s", poolfs, buf3);
|
||||
free (buf3);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
ret = buf3;
|
||||
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user