Changeset View
Changeset View
Standalone View
Standalone View
stand/userboot/userboot/main.c
Show First 20 Lines • Show All 260 Lines • ▼ Show 20 Lines | if (userboot_zfs_found) { | ||||
zdev.dd.d_dev = &zfs_dev; | zdev.dd.d_dev = &zfs_dev; | ||||
init_zfs_boot_options(devformat(&zdev.dd)); | init_zfs_boot_options(devformat(&zdev.dd)); | ||||
dd = &zdev.dd; | dd = &zdev.dd; | ||||
} else | } else | ||||
#endif | #endif | ||||
if (userboot_disk_maxunit > 0) { | if (userboot_disk_maxunit > 0) { | ||||
struct open_file f = { 0 }; | |||||
dev.dd.d_dev = &userboot_disk; | dev.dd.d_dev = &userboot_disk; | ||||
dev.dd.d_unit = 0; | dev.dd.d_unit = 0; | ||||
dev.d_slice = D_SLICEWILD; | dev.d_slice = D_SLICEWILD; | ||||
dev.d_partition = D_PARTWILD; | dev.d_partition = D_PARTWILD; | ||||
f.f_devdata = &dev; | |||||
/* | /* | ||||
* If we cannot auto-detect the partition type then | * If we cannot auto-detect the partition type then | ||||
* access the disk as a raw device. | * access the disk as a raw device. | ||||
*/ | */ | ||||
if (dev.dd.d_dev->dv_open(NULL, &dev)) { | if (dev.dd.d_dev->dv_open(&f)) { | ||||
dev.d_slice = D_SLICENONE; | dev.d_slice = D_SLICENONE; | ||||
dev.d_partition = D_PARTNONE; | dev.d_partition = D_PARTNONE; | ||||
} | } | ||||
dd = &dev.dd; | dd = &dev.dd; | ||||
} else { | } else { | ||||
dev.dd.d_dev = &host_dev; | dev.dd.d_dev = &host_dev; | ||||
dev.dd.d_unit = 0; | dev.dd.d_unit = 0; | ||||
dd = &dev.dd; | dd = &dev.dd; | ||||
▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines |