Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Nov 2018 16:09:16 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r341069 - stable/12/stand/i386/gptboot
Message-ID:  <201811271609.wARG9GM0018221@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ian
Date: Tue Nov 27 16:09:16 2018
New Revision: 341069
URL: https://svnweb.freebsd.org/changeset/base/341069

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:
  stable/12/stand/i386/gptboot/gptboot.c

Modified: stable/12/stand/i386/gptboot/gptboot.c
==============================================================================
--- stable/12/stand/i386/gptboot/gptboot.c	Tue Nov 27 15:12:34 2018	(r341068)
+++ stable/12/stand/i386/gptboot/gptboot.c	Tue Nov 27 16:09:16 2018	(r341069)
@@ -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;
 			}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201811271609.wARG9GM0018221>