Patchwork Fix netboot on POWER5

login
register
mail settings
Submitter Anton Blanchard
Date Oct. 18, 2011, 9:52 p.m.
Message ID <20111019085241.2998b8d2@kryten>
Download mbox | patch
Permalink /patch/120527/
State Under Review
Headers show

Comments

Anton Blanchard - Oct. 18, 2011, 9:52 p.m.
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 <anton@samba.org>
---
Tony Breeds - Oct. 19, 2011, 12:30 a.m.
On Wed, Oct 19, 2011 at 08:52:41AM +1100, Anton Blanchard wrote:
> 
> 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.

It's hardly a new idea  commit a9e02f948a7e3f8ada87e07a0c1a382805ad15c6
is more or less the inverse of this patch.  It was introduced to make
some POWER5 systems work.

So we're flip flopping between 2 implemnations. It looks like we have 3
clases of pSeries

1) Really old/lame that fail when given any IP options to the open call
2) old that can cope with IP options but none of the *_retries options
3) New that take all manner of options.

We can distinguish between 2 and 3 by looking at /packages/cas we just
need to find the check that tells us is we have 1 or 2.

I'll see if I can find any power5 systems that are type 1.

Yours Tony

Patch

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);