Print this page
Revert "Revert "6602 lofi should support labeled devices""
This reverts commit 21386c8bd8477810b291eee22e08f1382e70cdf3.
Revert "6602 lofi should support labeled devices"
This reverts commit 406fc5100dac8d225a315a6def6be8d628f34e24.
Adding AoE support to nza-kernel
@@ -4484,10 +4484,11 @@
#if defined(__x86)
extern int hvmboot_rootconf();
#endif /* __x86 */
+extern char *aoepath_prop;
extern ib_boot_prop_t *iscsiboot_prop;
int
rootconf()
{
@@ -4526,51 +4527,61 @@
return (ENXIO);
}
VFS_INIT(rootvfs, &vsw->vsw_vfsops, 0);
VFS_HOLD(rootvfs);
- /* always mount readonly first */
+ /* Always mount readonly first */
rootvfs->vfs_flag |= VFS_RDONLY;
pm_init();
- if (netboot && iscsiboot_prop) {
- cmn_err(CE_WARN, "NFS boot and iSCSI boot"
- " shouldn't happen in the same time");
+ if ((aoepath_prop != NULL && (iscsiboot_prop != NULL || netboot)) ||
+ (iscsiboot_prop != NULL && (aoepath_prop != NULL || netboot)) ||
+ (netboot && (aoepath_prop != NULL || iscsiboot_prop != NULL))) {
+ cmn_err(CE_WARN, "Only one of AoE, iSCSI or NFS boot "
+ "can be specified at time");
return (EINVAL);
}
- if (netboot || iscsiboot_prop) {
+ if (aoepath_prop != NULL || iscsiboot_prop != NULL || netboot) {
ret = strplumb();
if (ret != 0) {
cmn_err(CE_WARN, "Cannot plumb network device %d", ret);
return (EFAULT);
}
}
- if ((ret == 0) && iscsiboot_prop) {
- ret = modload("drv", "iscsi");
- /* -1 indicates fail */
- if (ret == -1) {
+ if (aoepath_prop != NULL) {
+ if (modload("drv", "aoe") == -1 ||
+ modload("drv", "aoeblk") == -1) {
+ cmn_err(CE_WARN, "Failed to load aoe modules");
+ return (EINVAL);
+ }
+ if (i_ddi_attach_pseudo_node("aoe") == 0) {
+ cmn_err(CE_WARN, "Failed to attach aoe driver");
+ return (ENODEV);
+ }
+ }
+
+ if (iscsiboot_prop != NULL) {
+ if (modload("drv", "iscsi") == -1) {
cmn_err(CE_WARN, "Failed to load iscsi module");
iscsi_boot_prop_free();
return (EINVAL);
- } else {
- if (!i_ddi_attach_pseudo_node("iscsi")) {
- cmn_err(CE_WARN,
- "Failed to attach iscsi driver");
+ }
+ if (i_ddi_attach_pseudo_node("iscsi") == 0) {
+ cmn_err(CE_WARN, "Failed to attach iscsi driver");
iscsi_boot_prop_free();
return (ENODEV);
}
}
- }
error = VFS_MOUNTROOT(rootvfs, ROOT_INIT);
vfs_unrefvfssw(vsw);
rootdev = rootvfs->vfs_dev;
- if (error)
+ if (error != 0)
cmn_err(CE_CONT, "Cannot mount root on %s fstype %s\n",
rootfs.bo_name, fstyp);
else
cmn_err(CE_CONT, "?root on %s fstype %s\n",
rootfs.bo_name, fstyp);