]> git.ozlabs.org Git - tonyb-yaboot.git/commitdiff
Save arguments as well as image name for CAS reboot
authorPaul Mackerras <paulus@samba.org>
Thu, 13 Oct 2011 18:01:12 +0000 (18:01 +0000)
committerTony Breeds <tony@bakeyournoodle.com>
Tue, 18 Oct 2011 04:11:10 +0000 (15:11 +1100)
We were saving the image name that the user had typed (or had been
selected by default) in the "boot-last-label" property, but we were
losing any extra arguments that the user had typed after the image
name.  On a pSeries machine, if the firmware decides to do a reboot
at the client-architecture-support call, we were then rebooting to
the right image but without any extra arguments that the user typed.

This fixes the problem by saving the arguments in boot-last-label,
separated from the image name by a space.  When we use the value
of boot-last-label, we now call word_split to separate it into the
image name and arguments again.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
second/yaboot.c

index b7b9280b7577dc7ea8606ade10f002c64bc5d0fb..1f3f1518845aa67b0a81847f226a775a2ea9c34d 100644 (file)
@@ -709,9 +709,10 @@ int get_params(struct boot_param_t* params)
          if (!imagename) {
               if (bootoncelabel[0] != 0)
                    imagename = bootoncelabel;
-              else if (bootlastlabel[0] != 0)
-                         imagename = bootlastlabel;
-               else
+              else if (bootlastlabel[0] != 0) {
+                   imagename = bootlastlabel;
+                   word_split(&imagename, &params->args);
+              } else
                    imagename = cfg_get_default();
          }
          if (imagename)
@@ -773,7 +774,13 @@ int get_params(struct boot_param_t* params)
          imagename = cfg_get_default();
 
      /* write the imagename out so it can be reused on reboot if necessary */
-     prom_set_options("boot-last-label", imagename, strlen(imagename));
+     strcpy(bootlastlabel, imagename);
+     if (params->args && params->args[0]) {
+         strcat(bootlastlabel, " ");
+         strcat(bootlastlabel, params->args);
+     }
+     prom_set_options("boot-last-label", bootlastlabel,
+                     strlen(bootlastlabel) + 1);
 
      label = 0;
      defdevice = boot.dev;