diff options
Diffstat (limited to 'usr/src/cmd/halt/halt.c')
| -rw-r--r-- | usr/src/cmd/halt/halt.c | 17 |
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 */ |
