Changeset View
Changeset View
Standalone View
Standalone View
stand/efi/loader/main.c
Show All 30 Lines | |||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include <stand.h> | #include <stand.h> | ||||
#include <sys/disk.h> | #include <sys/disk.h> | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/reboot.h> | #include <sys/reboot.h> | ||||
#include <sys/boot.h> | #include <sys/boot.h> | ||||
#include <sys/zfs_bootenv.h> | |||||
#include <paths.h> | #include <paths.h> | ||||
#include <stdint.h> | #include <stdint.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include <setjmp.h> | #include <setjmp.h> | ||||
#include <disk.h> | #include <disk.h> | ||||
#include <efi.h> | #include <efi.h> | ||||
#include <efilib.h> | #include <efilib.h> | ||||
▲ Show 20 Lines • Show All 223 Lines • ▼ Show 20 Lines | probe_zfs_currdev(uint64_t guid) | ||||
set_currdev_devdesc((struct devdesc *)&currdev); | set_currdev_devdesc((struct devdesc *)&currdev); | ||||
devname = efi_fmtdev(&currdev); | devname = efi_fmtdev(&currdev); | ||||
init_zfs_boot_options(devname); | init_zfs_boot_options(devname); | ||||
rv = sanity_check_currdev(); | rv = sanity_check_currdev(); | ||||
if (rv) { | if (rv) { | ||||
buf = malloc(VDEV_PAD_SIZE); | buf = malloc(VDEV_PAD_SIZE); | ||||
if (buf != NULL) { | if (buf != NULL) { | ||||
if (zfs_nextboot(&currdev, buf, VDEV_PAD_SIZE) == 0) { | if (zfs_get_bootonce(&currdev, OS_BOOTONCE, buf, | ||||
printf("zfs nextboot: %s\n", buf); | VDEV_PAD_SIZE) == 0) { | ||||
printf("zfs bootonce: %s\n", buf); | |||||
set_currdev(buf); | set_currdev(buf); | ||||
setenv("zfs-bootonce", buf, 1); | |||||
} | } | ||||
free(buf); | free(buf); | ||||
(void) zfs_attach_nvstore(&currdev); | |||||
} | } | ||||
} | } | ||||
return (rv); | return (rv); | ||||
} | } | ||||
#endif | #endif | ||||
static bool | static bool | ||||
try_as_currdev(pdinfo_t *hd, pdinfo_t *pp) | try_as_currdev(pdinfo_t *hd, pdinfo_t *pp) | ||||
▲ Show 20 Lines • Show All 1,298 Lines • Show Last 20 Lines |