2010-07-30 Robert Millan <rmh@gnu.org>
Enable `grub-probe -t device' resolution on ZFS. * configure.ac: Check for getfsstat(), libzfs and libnvpair. * include/grub/util/libnvpair.h: New file. * include/grub/util/libzfs.h: New file. * kern/emu/getroot.c: Include `<assert.h>' and `<error.h>'. [HAVE_LIBZFS && HAVE_LIBNVPAIR]: Include `<grub/util/libzfs.h>' and `<grub/util/libnvpair.h>'. [HAVE_GETFSSTAT]: Include `<sys/mount.h>'. (find_mount_point_from_dir): New static function. [HAVE_LIBZFS && HAVE_LIBNVPAIR] (find_root_device_from_libzfs): New function. [HAVE_LIBZFS && HAVE_LIBNVPAIR] (grub_guess_root_device): Use find_root_device_from_libzfs() before ressorting to find_root_device(). * include/grub/util/misc.h (grub_util_init_libzfs): New function prototype. * util/misc.c: Include `<grub/util/libzfs.h>'. (grub_util_init_libzfs): New function. [HAVE_LIBZFS] (libzfs_handle): New global variable. [HAVE_LIBZFS] (fini_libzfs): New static function. (grub_util_init_libzfs): New function. * util/grub-probe.c (main): Call grub_util_init_libzfs().
This commit is contained in:
parent
f7790cdd5d
commit
a184f9c801
8 changed files with 285 additions and 1 deletions
11
configure.ac
11
configure.ac
|
@ -247,7 +247,7 @@ else
|
|||
fi
|
||||
|
||||
# Check for functions.
|
||||
AC_CHECK_FUNCS(posix_memalign memalign asprintf vasprintf)
|
||||
AC_CHECK_FUNCS(posix_memalign memalign asprintf vasprintf getfsstat)
|
||||
|
||||
# For opendisk() and getrawpartition() on NetBSD.
|
||||
# Used in util/deviceiter.c and in util/hostdisk.c.
|
||||
|
@ -799,6 +799,15 @@ if test x"$device_mapper_excuse" = x ; then
|
|||
[device_mapper_excuse="need devmapper library"])
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB([zfs], [libzfs_init],
|
||||
[LDFLAGS="$LDFLAGS -lzfs"
|
||||
AC_DEFINE([HAVE_LIBZFS], [1],
|
||||
[Define to 1 if you have the ZFS library.])],)
|
||||
AC_CHECK_LIB([nvpair], [nvlist_print],
|
||||
[LDFLAGS="$LDFLAGS -lnvpair"
|
||||
AC_DEFINE([HAVE_LIBNVPAIR], [1],
|
||||
[Define to 1 if you have the NVPAIR library.])],)
|
||||
|
||||
AC_SUBST(ASFLAGS)
|
||||
|
||||
# Output files.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue