Commit graph

2 commits

Author SHA1 Message Date
Robert Millan
3169f4c76a 2010-07-31 Robert Millan <rmh@gnu.org>
* configure.ac: Check for `libzfs.h' and `libnvpair.h'.
	
	* include/grub/util/libnvpair.h: Include `<config.h>'.
	[HAVE_LIBNVPAIR_H]: Include `<libnvpair.h>' instead of
	declaring libnvpair prototypes ourselves.
	* include/grub/util/libzfs.h: Include `<config.h>'.
	[HAVE_LIBZFS_H]: Include `<libzfs.h>' instead of
	declaring libzfs prototypes ourselves.
	
	(libzfs_handle): Moved to ...
	* include/grub/util/misc.h (libzfs_handle): ... here.
	Include `<grub/util/libzfs.h>'.
2010-07-31 12:22:01 +02:00
Robert Millan
a184f9c801 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().
2010-07-30 21:43:12 +02:00