From patchwork Tue Oct 18 21:52:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Fix netboot on POWER5 From: Anton Blanchard X-Patchwork-Id: 120527 Message-Id: <20111019085241.2998b8d2@kryten> To: yaboot-devel@lists.ozlabs.org Date: Wed, 19 Oct 2011 08:52:41 +1100 We weren't specifying any network parameters on POWER5 so firmware would BOOTP for everything when we asked it to load a file. This fails on a network without a local BOOTP server. This patch fixes the issue by adding the parameters that the POWER5 tftp package understands. Thanks to Tony for the idea. Signed-off-by: Anton Blanchard --- Index: yaboot/second/fs_of.c =================================================================== --- yaboot.orig/second/fs_of.c 2011-10-19 08:46:20.711411958 +1100 +++ yaboot/second/fs_of.c 2011-10-19 08:46:26.503512279 +1100 @@ -168,18 +168,19 @@ of_net_open(struct boot_file_t* file, new_tftp = (prom_finddevice("/packages/cas") != PROM_INVALID_HANDLE); DEBUG_F("Using %s tftp style\n", (new_tftp? "new": "old")); - if (new_tftp) { - strcat(buffer, fspec->siaddr); - strcat(buffer, ","); + strcat(buffer, fspec->siaddr); + strcat(buffer, ","); - if (fspec->is_ipv6 && (strstr(filename, "filename=") == NULL)) - strcat(buffer, "filename="); + if (fspec->is_ipv6 && (strstr(filename, "filename=") == NULL)) + strcat(buffer, "filename="); - strcat(buffer, filename); - strcat(buffer, ","); - strcat(buffer, fspec->ciaddr); - strcat(buffer, ","); - strcat(buffer, fspec->giaddr); + strcat(buffer, filename); + strcat(buffer, ","); + strcat(buffer, fspec->ciaddr); + strcat(buffer, ","); + strcat(buffer, fspec->giaddr); + + if (new_tftp) { strcat(buffer, ","); strcat(buffer, fspec->bootp_retries); strcat(buffer, ","); @@ -188,9 +189,6 @@ of_net_open(struct boot_file_t* file, strcat(buffer, fspec->subnetmask); strcat(buffer, ","); strcat(buffer, fspec->addl_params); - } else { - strcat(buffer, ","); - strcat(buffer, filename); } DEBUG_F("Opening: \"%s\"\n", buffer);