svn commit: r295310 - user/ngie/stable-10-libnv/sys/boot/ia64/efi
Garrett Cooper
ngie at FreeBSD.org
Fri Feb 5 08:25:22 UTC 2016
Author: ngie
Date: Fri Feb 5 08:25:20 2016
New Revision: 295310
URL: https://svnweb.freebsd.org/changeset/base/295310
Log:
First attempt at unbreaking the ia64 EFI bootloader by
MFstable/10 @ r294999 and slightly tweak the support to add
ZFS support to the EFI bootloader by smh
Requested by: gjb, peter
Modified:
user/ngie/stable-10-libnv/sys/boot/ia64/efi/main.c
Modified: user/ngie/stable-10-libnv/sys/boot/ia64/efi/main.c
==============================================================================
--- user/ngie/stable-10-libnv/sys/boot/ia64/efi/main.c Fri Feb 5 07:29:11 2016 (r295309)
+++ user/ngie/stable-10-libnv/sys/boot/ia64/efi/main.c Fri Feb 5 08:25:20 2016 (r295310)
@@ -144,6 +144,7 @@ main(int argc, CHAR16 *argv[])
EFI_LOADED_IMAGE *img;
char *dev;
int i;
+ uint64_t pool_guid;
/*
* XXX Chicken-and-egg problem; we want to have console output
@@ -179,15 +180,44 @@ main(int argc, CHAR16 *argv[])
BS->HandleProtocol(IH, &imgid, (VOID**)&img);
bzero(&currdev, sizeof(currdev));
- efi_handle_lookup(img->DeviceHandle, &currdev.d_dev, &currdev.d_unit);
- currdev.d_type = currdev.d_dev->dv_type;
-
- env_setenv("loaddev", EV_VOLATILE, ia64_fmtdev(&currdev), env_noset,
- env_nounset);
-
- dev = get_dev_option(argc, argv);
- if (dev == NULL)
- dev = ia64_fmtdev(&currdev);
+ if (efi_handle_lookup(img->DeviceHandle, &dev, &unit, &pool_guid) != 0)
+ return (EFI_NOT_FOUND);
+ switch (dev->dv_type) {
+#ifdef EFI_ZFS_BOOT
+ case DEVT_ZFS: {
+ struct zfs_devdesc currdev;
+
+ currdev.d_dev = dev;
+ currdev.d_unit = unit;
+ currdev.d_type = currdev.d_dev->dv_type;
+ currdev.d_opendata = NULL;
+ currdev.pool_guid = pool_guid;
+ currdev.root_guid = 0;
+ env_setenv("currdev", EV_VOLATILE, efi_fmtdev(&currdev),
+ efi_setcurrdev, env_nounset);
+ env_setenv("loaddev", EV_VOLATILE, efi_fmtdev(&currdev), env_noset,
+ env_nounset);
+ break;
+ }
+#endif
+ default: {
+ struct devdesc currdev;
+
+ dev = get_dev_option(argc, argv);
+ if (dev == NULL)
+ dev = ia64_fmtdev(&currdev);
+
+ currdev.d_dev = dev;
+ currdev.d_unit = unit;
+ currdev.d_opendata = NULL;
+ currdev.d_type = currdev.d_dev->dv_type;
+ env_setenv("currdev", EV_VOLATILE, efi_fmtdev(&currdev),
+ efi_setcurrdev, env_nounset);
+ env_setenv("loaddev", EV_VOLATILE, efi_fmtdev(&currdev), env_noset,
+ env_nounset);
+ break;
+ }
+ }
env_setenv("currdev", EV_VOLATILE, dev, ia64_setcurrdev, env_nounset);
More information about the svn-src-user
mailing list