+ }
+ if (have_root_path == FALSE) {
+ have_root_path = get_root_path(root_path);
+ }
+ if (have_root_path) {
+ const char * server_name = NULL;
+ char * mount_point = NULL;
+ char * image_path = NULL;
+ struct in_addr server_ip;
+
+ if (parse_image_path(root_path, &server_ip, &server_name,
+ &mount_point, &image_path)) {
+ info->image_type = kNetBootImageTypeNFS;
+ info->server_ip = server_ip;
+ info->server_name_length = strlen(server_name) + 1;
+ info->server_name = kheap_alloc(KHEAP_DATA_BUFFERS,
+ info->server_name_length, Z_WAITOK);
+ info->mount_point_length = strlen(mount_point) + 1;
+ info->mount_point = kheap_alloc(KHEAP_DATA_BUFFERS,
+ info->mount_point_length, Z_WAITOK);
+ strlcpy(info->server_name, server_name, info->server_name_length);
+ strlcpy(info->mount_point, mount_point, info->mount_point_length);
+
+ printf("netboot: NFS Server %s Mount %s",
+ server_name, info->mount_point);
+ if (image_path != NULL) {
+ boolean_t needs_slash = FALSE;
+
+ info->image_path_length = strlen(image_path) + 1;
+ if (image_path[0] != '/') {
+ needs_slash = TRUE;
+ info->image_path_length++;
+ }
+ info->image_path = kheap_alloc(KHEAP_DATA_BUFFERS,
+ info->image_path_length, Z_WAITOK);
+ if (needs_slash) {
+ info->image_path[0] = '/';
+ strlcpy(info->image_path + 1, image_path,
+ info->image_path_length - 1);
+ } else {
+ strlcpy(info->image_path, image_path,
+ info->image_path_length);
+ }
+ printf(" Image %s", info->image_path);
+ }
+ printf("\n");
+ } else if (strncmp(root_path, kNetBootRootPathPrefixHTTP,
+ strlen(kNetBootRootPathPrefixHTTP)) == 0) {
+ info->image_type = kNetBootImageTypeHTTP;
+ save_path(&info->image_path, &info->image_path_length,
+ root_path);
+ printf("netboot: HTTP URL %s\n", info->image_path);
+ } else {
+ printf("netboot: root path uses unrecognized format\n");
+ }
+
+ /* check for image-within-image */
+ if (info->image_path != NULL) {
+ if (PE_parse_boot_argn(IMAGEBOOT_ROOT_ARG, root_path, MAXPATHLEN)
+ || PE_parse_boot_argn("rp1", root_path, MAXPATHLEN)) {
+ /* rp1/root-dmg is the second-level image */
+ save_path(&info->second_image_path, &info->second_image_path_length,
+ root_path);
+ }