- struct netboot_info * info;
- char * root_path = NULL;
- boolean_t use_hdix = TRUE;
- char * vndevice = NULL;
-
- MALLOC_ZONE(vndevice, caddr_t, MAXPATHLEN, M_NAMEI, M_WAITOK);
- if (vndevice == NULL)
- panic("netboot_info_init: M_NAMEI zone exhausted");
- if (PE_parse_boot_argn("vndevice", vndevice, MAXPATHLEN) == TRUE) {
- use_hdix = FALSE;
- }
- FREE_ZONE(vndevice, MAXPATHLEN, M_NAMEI);
-
- info = (struct netboot_info *)kalloc(sizeof(*info));
- bzero(info, sizeof(*info));
- info->client_ip = iaddr;
- info->image_type = kNetBootImageTypeUnknown;
- info->use_hdix = use_hdix;
-
- /* check for a booter-specified path then a NetBoot path */
- MALLOC_ZONE(root_path, caddr_t, MAXPATHLEN, M_NAMEI, M_WAITOK);
- if (root_path == NULL)
- panic("netboot_info_init: M_NAMEI zone exhausted");
- if (PE_parse_boot_argn("rp", root_path, MAXPATHLEN) == TRUE
- || PE_parse_boot_argn("rootpath", root_path, MAXPATHLEN) == TRUE
- || get_root_path(root_path) == TRUE) {
- 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 = (char *)kalloc(info->server_name_length);
- info->mount_point_length = strlen(mount_point) + 1;
- info->mount_point = (char *)kalloc(info->mount_point_length);
- strlcpy(info->server_name, server_name, info->server_name_length);
- strlcpy(info->mount_point, mount_point, info->mount_point_length);
-
- printf("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++;
+ boolean_t have_root_path = FALSE;
+ struct netboot_info * info = NULL;
+ char * root_path = NULL;
+
+ info = (struct netboot_info *)kalloc(sizeof(*info));
+ bzero(info, sizeof(*info));
+ info->client_ip = iaddr;
+ info->image_type = kNetBootImageTypeUnknown;
+
+ /* check for a booter-specified path then a NetBoot path */
+ root_path = zalloc(ZV_NAMEI);
+
+ if (PE_parse_boot_argn("rp0", root_path, MAXPATHLEN) == TRUE
+ || PE_parse_boot_argn("rp", root_path, MAXPATHLEN) == TRUE
+ || PE_parse_boot_argn("rootpath", root_path, MAXPATHLEN) == TRUE) {
+ if (imageboot_format_is_valid(root_path)) {
+ printf("netboot_info_init: rp0='%s' isn't a network path,"
+ " ignoring\n", root_path);
+ } else {
+ have_root_path = TRUE;