summaryrefslogtreecommitdiff
path: root/usr/src/cmd/halt
diff options
context:
space:
mode:
authorSherry Moore <Sherry.Moore@Sun.COM>2008-09-29 16:34:09 -0700
committerSherry Moore <Sherry.Moore@Sun.COM>2008-09-29 16:34:09 -0700
commit6bc8bc6a97518e9ec3d440de43fc1a30a7db825f (patch)
tree67ce182d960ecb408831cb4ff20e5464b7d0667a /usr/src/cmd/halt
parent9c2c14ab194d42014417b385d6bf226ba1a37995 (diff)
downloadillumos-joyent-6bc8bc6a97518e9ec3d440de43fc1a30a7db825f.tar.gz
6752679 Remove leading " " from boot arguments
6752682 Fast reboot should be able to handle randomly large boot archives
Diffstat (limited to 'usr/src/cmd/halt')
-rw-r--r--usr/src/cmd/halt/halt.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/usr/src/cmd/halt/halt.c b/usr/src/cmd/halt/halt.c
index 7c3aa679b1..fd603605f9 100644
--- a/usr/src/cmd/halt/halt.c
+++ b/usr/src/cmd/halt/halt.c
@@ -1084,16 +1084,25 @@ parse_fastboot_args(char *bootargs_buf, int *is_dryrun, const char *bename,
/* Not a valid unix file */
return (EINVAL);
} else {
+ int space = 0;
/*
* Construct boot argument.
*/
unixlen = strlen(unixfile);
- bcopy(unixfile, bootargs_buf, mplen);
- (void) strcat(bootargs_buf, " ");
- bcopy(&unixfile[mplen], &bootargs_buf[mplen + 1],
+
+ /*
+ * mdep cannot start with space because bootadm
+ * creates bogus menu entries if it does.
+ */
+ if (mplen > 0) {
+ bcopy(unixfile, bootargs_buf, mplen);
+ (void) strcat(bootargs_buf, " ");
+ space = 1;
+ }
+ bcopy(&unixfile[mplen], &bootargs_buf[mplen + space],
unixlen - mplen);
(void) strcat(bootargs_buf, " ");
- off += unixlen + 2;
+ off += unixlen + space + 1;
}
} else {
/* Check to see if root is zfs */