kobj_bootflags.c revision 193974072f41a843678abf5f61979c748687e66b
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <sys/bootconf.h>
#include <sys/kobj_impl.h>
#include <util/getoptstr.h>
/*
* Parse the boot line to determine boot flags.
*/
void
{
struct gos_params params;
char *cp;
int c;
char scratch[BOOTARGS_MAX];
boothowto |= RB_ASKNAME;
return;
}
cp = kern_bootargs;
#if defined(_OBP)
/*
* name to the boot arguments. (And beware making it do so: if the
* run-kernel command returns, it will loop, and you will end up with
* multiple copies of the kernel name.)
*/
if (cp[0] != '-') {
/* if user booted kadb or kmdb, load kmdb */
}
#endif
#if defined(_OBP)
/* skip bootblk args */
#else
#endif
switch (c) {
case 'a':
boothowto |= RB_ASKNAME;
break;
case 'b':
boothowto |= RB_NOBOOTRC;
break;
case 'c':
break;
case 'd':
break;
#if defined(_OBP)
case 'D':
case 'F':
break;
#endif
case 'g':
break;
case 'G':
break;
case 'h':
break;
#if defined(_OBP)
case 'H':
break;
#endif
case 'i':
"Ignoring.\n");
} else {
}
break;
case 'k':
break;
case 'm':
sizeof (initargs)) {
"unix: init options too long. "
"Ignoring -m.\n");
break;
}
/* gos_optargp is not null terminated */
sizeof (initargs));
break;
#if defined(_OBP)
/* Ignore argument meant for wanboot standalone */
case 'o':
break;
#endif
case 'O': {
if (++num_O_opt > (sizeof (kobj_kmdb_argv) /
sizeof (char *)) - 1) {
"options - ignoring option #%d.\n",
continue;
}
break;
}
case 'r':
"long. Ignoring -r.\n");
break;
}
boothowto |= RB_RECONFIG;
break;
case 's':
"long. Ignoring -s.\n");
break;
}
break;
case 'v':
"long. Ignoring -v.\n");
break;
}
boothowto |= RB_VERBOSE;
break;
#if defined(_OBP)
case 'V':
break;
case 'Z':
break;
#endif
case 'w':
boothowto |= RB_WRITABLE;
break;
case 'x':
break;
case '?':
switch (params.gos_last_opt) {
case 'i':
"for -i flag missing. Ignoring.\n");
break;
default:
"kernel option -%c.\n",
}
break;
default:
"option -%c.\n", c);
}
}
boothowto &= ~RB_DEBUGENTER;
}
/* Unused arguments. */
/*EMPTY*/
/* Lousy install arguments. Silently ignore. */
} else {
}
}
}