summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2019-07-16 20:22:04 +0300
committerToomas Soome <tsoome@me.com>2019-08-12 22:03:48 +0300
commit4f7f1d0fa878cb07e58af9d4f2abea08273b07c7 (patch)
treef9482aabe460fc61ce106db1a24c087ec7658e64 /usr/src
parentefe51d0cc2398b9ac179568b63a44e4bf295b8e2 (diff)
downloadillumos-joyent-4f7f1d0fa878cb07e58af9d4f2abea08273b07c7.tar.gz
11475 gptzfsboot: update parsing the option switches
Reviewed by: Andy Fiddaman <andy@omniosce.org> Reviewed by: Robert Mustacchi <robert.mustacchi@joyent.com> Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/boot/Makefile.version2
-rw-r--r--usr/src/boot/sys/boot/i386/gptzfsboot/zfsboot.c34
-rw-r--r--usr/src/man/man5/gptzfsboot.538
3 files changed, 60 insertions, 14 deletions
diff --git a/usr/src/boot/Makefile.version b/usr/src/boot/Makefile.version
index 06fa2d3ef9..50fbef1c79 100644
--- a/usr/src/boot/Makefile.version
+++ b/usr/src/boot/Makefile.version
@@ -33,4 +33,4 @@ LOADER_VERSION = 1.1
# Use date like formatting here, YYYY.MM.DD.XX, without leading zeroes.
# The version is processed from left to right, the version number can only
# be increased.
-BOOT_VERSION = $(LOADER_VERSION)-2019.08.04.1
+BOOT_VERSION = $(LOADER_VERSION)-2019.08.07.1
diff --git a/usr/src/boot/sys/boot/i386/gptzfsboot/zfsboot.c b/usr/src/boot/sys/boot/i386/gptzfsboot/zfsboot.c
index c19debdeb7..cb088969dd 100644
--- a/usr/src/boot/sys/boot/i386/gptzfsboot/zfsboot.c
+++ b/usr/src/boot/sys/boot/i386/gptzfsboot/zfsboot.c
@@ -471,18 +471,22 @@ parse_cmd(void)
char *ep, *p, *q;
const char *cp;
char line[80];
- int c, i, j;
+ int c, i;
while ((c = *arg++)) {
- if (c == ' ' || c == '\t' || c == '\n')
+ if (isspace(c))
continue;
- for (p = arg; *p && *p != '\n' && *p != ' ' && *p != '\t'; p++)
+
+ for (p = arg; *p != '\0' && !isspace(*p); p++)
;
ep = p;
- if (*p)
- *p++ = 0;
+ if (*p != '\0')
+ *p++ = '\0';
if (c == '-') {
while ((c = *arg++)) {
+ if (isspace(c))
+ break;
+
if (c == 'P') {
if (*(uint8_t *)PTOV(0x496) & 0x10) {
cp = "yes";
@@ -494,14 +498,22 @@ parse_cmd(void)
printf("Keyboard: %s\n", cp);
continue;
} else if (c == 'S') {
- j = 0;
- while ((unsigned int)
- (i = *arg++ - '0') <= 9)
- j = j * 10 + i;
- if (j > 0 && i == -'0') {
- comspeed = j;
+ char *end;
+
+ errno = 0;
+ i = strtol(arg, &end, 10);
+ if (errno == 0 &&
+ *arg != '\0' &&
+ *end == '\0' &&
+ i > 0 &&
+ i <= 115200) {
+ comspeed = i;
break;
+ } else {
+ printf("warning: bad value for "
+ "speed: %s\n", arg);
}
+ arg = end;
/*
* Fall through to error below
* ('S' not in optstr[]).
diff --git a/usr/src/man/man5/gptzfsboot.5 b/usr/src/man/man5/gptzfsboot.5
index 09892b1324..7127b3d961 100644
--- a/usr/src/man/man5/gptzfsboot.5
+++ b/usr/src/man/man5/gptzfsboot.5
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd July 20, 2018
+.Dd July 17, 2019
.Dt GPTZFSBOOT 5
.Os
.Sh NAME
@@ -126,6 +126,41 @@ stored in the
variable, and also set as the initial value of the
.Cm currdev
variable.
+.Sh OPTIONS
+The following options are supported by
+.Nm
+and
+.Xr loader 5 :
+.Bl -tag -width indent
+.It Fl D
+Dual console.
+Use both text and serial console with
+.Nm
+and
+.Xr loader 5 .
+.It Fl P
+Probe for keyboard.
+If there is no keyboard, switch on the dual console and serial console.
+.It Fl S Ns Ar speed
+Set serial port speed.
+.It Fl h
+Set serial console.
+.It Fl q
+Keep the
+.Nm
+console quiet.
+.It Fl t
+Keep the VGA text mode for
+.Xr loader 5 .
+.El
+.Pp
+The following options will be passed to the kernel:
+.Bl -tag -width indent
+.It Fl s
+Single user
+.It Fl v
+Verbose boot
+.El
.Sh FILES
.Bl -tag -width /boot/gptzfsboot -compact
.It Pa /boot/config
@@ -153,5 +188,4 @@ installboot /boot/pmbr /boot/gptzfsboot /dev/rdsk/c0t0d0s0
.Sh SEE ALSO
.Xr installboot 1M ,
.Xr zpool 1M ,
-.Xr loader 5 ,
.Xr loader 5