Merge commit 'refs/remotes/origin/linux-have-libefi' into HEAD

This commit is contained in:
Brian Behlendorf 2009-06-26 14:34:22 -07:00
commit a3521786e6
4 changed files with 16 additions and 19 deletions

View File

@ -1,3 +1 @@
gcc-branch zfs-branch
fix-branch
feature-branch

17
.topmsg
View File

@ -1,19 +1,6 @@
From: Brian Behlendorf <behlendorf1@llnl.gov> From: Brian Behlendorf <behlendorf1@llnl.gov>
Subject: [PATCH] zfs branch Subject: [PATCH] linux have libefi
Merged result of all changes which are relevant to both Solaris Use libefi if HAVE_LIBEFI defined
and Linux builds of the ZFS code. These are changes where there
is a reasonable chance they will be accepted upstream.
Additionally, since this is effectively the root of the linux
ZFS tree the core linux build system is added here. This
includes autogen.sh, configure.ac, m4 macros, some scripts/*,
and makefiles for all the core ZFS components. Linux-only
features which require tweaks to the build system should appear
on the relevant topic branches. All autotools products which
result from autogen.sh are commited to the linux-configure-branch.
This branch also contains the META, ChangeLog, AUTHORS, TODO,
and README, files.
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>

View File

@ -360,6 +360,7 @@ check_file(const char *file, boolean_t force, boolean_t isspare)
static boolean_t static boolean_t
is_whole_disk(const char *arg) is_whole_disk(const char *arg)
{ {
#ifdef HAVE_LIBEFI
struct dk_gpt *label; struct dk_gpt *label;
int fd; int fd;
char path[MAXPATHLEN]; char path[MAXPATHLEN];
@ -375,6 +376,9 @@ is_whole_disk(const char *arg)
efi_free(label); efi_free(label);
(void) close(fd); (void) close(fd);
return (B_TRUE); return (B_TRUE);
#else
return (B_FALSE);
#endif
} }
/* /*
@ -884,6 +888,7 @@ check_replication(nvlist_t *config, nvlist_t *newroot)
static int static int
make_disks(zpool_handle_t *zhp, nvlist_t *nv) make_disks(zpool_handle_t *zhp, nvlist_t *nv)
{ {
#ifdef HAVE_LIBEFI
nvlist_t **child; nvlist_t **child;
uint_t c, children; uint_t c, children;
char *type, *path, *diskname; char *type, *path, *diskname;
@ -971,7 +976,7 @@ make_disks(zpool_handle_t *zhp, nvlist_t *nv)
for (c = 0; c < children; c++) for (c = 0; c < children; c++)
if ((ret = make_disks(zhp, child[c])) != 0) if ((ret = make_disks(zhp, child[c])) != 0)
return (ret); return (ret);
#endif
return (0); return (0);
} }

View File

@ -46,8 +46,11 @@
#include "zfs_namecheck.h" #include "zfs_namecheck.h"
#include "zfs_prop.h" #include "zfs_prop.h"
#include "libzfs_impl.h" #include "libzfs_impl.h"
#include "zfs_config.h"
#ifdef HAVE_LIBEFI
static int read_efi_label(nvlist_t *config, diskaddr_t *sb); static int read_efi_label(nvlist_t *config, diskaddr_t *sb);
#endif
#if defined(__i386) || defined(__amd64) #if defined(__i386) || defined(__amd64)
#define BOOTCMD "installgrub(1M)" #define BOOTCMD "installgrub(1M)"
@ -338,6 +341,7 @@ bootfs_name_valid(const char *pool, char *bootfs)
static boolean_t static boolean_t
pool_uses_efi(nvlist_t *config) pool_uses_efi(nvlist_t *config)
{ {
#ifdef HAVE_LIBEFI
nvlist_t **child; nvlist_t **child;
uint_t c, children; uint_t c, children;
@ -349,6 +353,7 @@ pool_uses_efi(nvlist_t *config)
if (pool_uses_efi(child[c])) if (pool_uses_efi(child[c]))
return (B_TRUE); return (B_TRUE);
} }
#endif
return (B_FALSE); return (B_FALSE);
} }
@ -2818,6 +2823,7 @@ zpool_obj_to_path(zpool_handle_t *zhp, uint64_t dsobj, uint64_t obj,
*/ */
#define NEW_START_BLOCK 256 #define NEW_START_BLOCK 256
#ifdef HAVE_LIBEFI
/* /*
* Read the EFI label from the config, if a label does not exist then * Read the EFI label from the config, if a label does not exist then
* pass back the error to the caller. If the caller has passed a non-NULL * pass back the error to the caller. If the caller has passed a non-NULL
@ -3106,3 +3112,4 @@ out:
libzfs_fini(hdl); libzfs_fini(hdl);
return (ret); return (ret);
} }
#endif /* HAVE_LIBEFI */