Changeset View
Changeset View
Standalone View
Standalone View
stand/efi/loader/main.c
Show First 20 Lines • Show All 197 Lines • ▼ Show 20 Lines | env_setenv("loaddev", EV_VOLATILE | EV_NOHOOK, devname, env_noset, | ||||
env_nounset); | env_nounset); | ||||
} | } | ||||
static void | static void | ||||
set_currdev_devdesc(struct devdesc *currdev) | set_currdev_devdesc(struct devdesc *currdev) | ||||
{ | { | ||||
const char *devname; | const char *devname; | ||||
devname = efi_fmtdev(currdev); | devname = devformat(currdev); | ||||
printf("Setting currdev to %s\n", devname); | printf("Setting currdev to %s\n", devname); | ||||
set_currdev(devname); | set_currdev(devname); | ||||
} | } | ||||
static void | static void | ||||
set_currdev_devsw(struct devsw *dev, int unit) | set_currdev_devsw(struct devsw *dev, int unit) | ||||
{ | { | ||||
struct devdesc currdev; | struct devdesc currdev; | ||||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | probe_zfs_currdev(uint64_t guid) | ||||
char *buf = NULL; | char *buf = NULL; | ||||
bool rv; | bool rv; | ||||
currdev.dd.d_dev = &zfs_dev; | currdev.dd.d_dev = &zfs_dev; | ||||
currdev.dd.d_unit = 0; | currdev.dd.d_unit = 0; | ||||
currdev.pool_guid = guid; | currdev.pool_guid = guid; | ||||
currdev.root_guid = 0; | currdev.root_guid = 0; | ||||
set_currdev_devdesc((struct devdesc *)&currdev); | set_currdev_devdesc((struct devdesc *)&currdev); | ||||
devname = efi_fmtdev(&currdev); | devname = devformat(&currdev.dd); | ||||
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_get_bootonce(&currdev, OS_BOOTONCE, buf, | if (zfs_get_bootonce(&currdev, OS_BOOTONCE, buf, | ||||
VDEV_PAD_SIZE) == 0) { | VDEV_PAD_SIZE) == 0) { | ||||
▲ Show 20 Lines • Show All 1,431 Lines • Show Last 20 Lines |