Author: ian
Date: Tue Nov 27 16:16:38 2018
New Revision: 341071
URL: https://svnweb.freebsd.org/changeset/base/341071

Log:
  Restore the ability to override the disk unit/partition at the boot: prompt
  in gptboot.
  
  When arch-independent geli support was added, a new static 'gdsk' struct
  was added, but there was still a static 'dsk' struct, and when you typed
  in an alternate disk/partition, the string was parsed into that struct,
  which was then never used for anything.  Now the string gets parsed into
  gdsk.dsk, the struct that's actually used.
  
  X-MFC after:  3 days

Modified:
  head/stand/i386/gptboot/gptboot.c

Modified: head/stand/i386/gptboot/gptboot.c
==============================================================================
--- head/stand/i386/gptboot/gptboot.c   Tue Nov 27 16:13:56 2018        
(r341070)
+++ head/stand/i386/gptboot/gptboot.c   Tue Nov 27 16:16:38 2018        
(r341071)
@@ -81,7 +81,6 @@ uint32_t opts;
 static const char *const dev_nm[NDEV] = {"ad", "da", "fd"};
 static const unsigned char dev_maj[NDEV] = {30, 4, 2};
 
-static struct dsk dsk;
 static char kname[1024];
 static int comspeed = SIOSPD;
 static struct bootinfo bootinfo;
@@ -569,22 +568,22 @@ parse_cmds(char *cmdstr, int *dskupdated)
                                    arg[1] != dev_nm[i][1]; i++)
                                        if (i == NDEV - 1)
                                                return (-1);
-                               dsk.type = i;
+                               gdsk.dsk.type = i;
                                arg += 3;
-                               dsk.unit = *arg - '0';
-                               if (arg[1] != 'p' || dsk.unit > 9)
+                               gdsk.dsk.unit = *arg - '0';
+                               if (arg[1] != 'p' || gdsk.dsk.unit > 9)
                                        return (-1);
                                arg += 2;
-                               dsk.part = *arg - '0';
-                               if (dsk.part < 1 || dsk.part > 9)
+                               gdsk.dsk.part = *arg - '0';
+                               if (gdsk.dsk.part < 1 || gdsk.dsk.part > 9)
                                        return (-1);
                                arg++;
                                if (arg[0] != ')')
                                        return (-1);
                                arg++;
                                if (drv == -1)
-                                       drv = dsk.unit;
-                               dsk.drive = (dsk.type <= TYPE_MAXHARD
+                                       drv = gdsk.dsk.unit;
+                               gdsk.dsk.drive = (gdsk.dsk.type <= TYPE_MAXHARD
                                    ? DRV_HARD : 0) + drv;
                                *dskupdated = 1;
                        }
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to