loader doesn't support arguments except from /proc/cmdline.
This gets rid of all the argument parsing code in init, loader support for
reading args in some sort of test mode, and hopefully the last of the bogl
support.
---
loader/init.c | 14 -------
loader/loader.c | 103 ++++++++++---------------------------------------------
2 files changed, 18 insertions(+), 99 deletions(-)
diff --git a/loader/init.c b/loader/init.c
index 53d46a0..0c441e9 100644
--- a/loader/init.c
+++ b/loader/init.c
@@ -76,8 +76,6 @@ static int getSyslog(gchar **, gchar **);
static int onQEMU(void);
struct termios ts;
printf("anaconda installer init version %s starting
", VERSION);
- cmdline = readvars_parse_file("/proc/cmdline");
-
- /* check for development mode early */
- if (g_hash_table_lookup_extended(cmdline, "devel", NULL, &value)) {
- printf("Enabling development mode - cores will be dumped
");
- isDevelMode = TRUE;
- }
-
/* these args are only for testing from commandline */
for (i = 1; i < argc; i++) {
if (!strcmp (argv[i], "serial")) {
@@ -552,10 +542,6 @@ int main(int argc, char **argv) {
*argvp++ = console;
}
-/* parses /proc/cmdline for any arguments which are important to us.
- * NOTE: in test mode, can specify a cmdline with --cmdline
- */
-static void parseCmdLineFlags(struct loaderData_s * loaderData,
- char * cmdLine) {
+/* parses /proc/cmdline for any arguments which are important to us. */
+static void parseCmdLineFlags(struct loaderData_s * loaderData) {
int numExtraArgs = 0;
- GHashTable *args = NULL;
GHashTableIter iter;
gpointer key = NULL, value = NULL;
/* we want to default to graphical and allow override with 'text' */
flags |= LOADER_FLAGS_GRAPHICAL;
- /* if we have any explicit cmdline (probably test mode), we don't want
- * to parse /proc/cmdline */
- if (!cmdLine) {
- args = readvars_parse_file("/proc/cmdline");
- } else {
- args = readvars_parse_string(cmdLine);
- }
-
- if (args == NULL) {
+ if (cmdline == NULL) {
logMessage(INFO, "kernel command line was empty");
return;
}
- /* get possible devel mode flag very early */
- for (i = 1; i < argc; i++) {
- if (!strcmp(argv[i], "--devel")) {
- isDevelMode++;
- break;
- }
+ /* check for development mode early */
+ if (g_hash_table_lookup_extended(cmdline, "devel", NULL, NULL)) {
+ printf("Enabling development mode - cores will be dumped
");
+ isDevelMode = 1;
}
/* get init PID if we have it */
@@ -1839,32 +1808,11 @@ int main(int argc, char ** argv) {
signal(SIGUSR2, loaderUsrXHandler);
/* Make sure sort order is right. */
- setenv ("LC_COLLATE", "C", 1);
+ setenv ("LC_COLLATE", "C", 1);
/* Very first thing, set up tracebacks and debug features. */
rc = anaconda_trace_init(isDevelMode);
logMessage(INFO, "anaconda version %s on %s starting", VERSION, getProductArch());
@@ -2096,13 +2030,12 @@ int main(int argc, char ** argv) {
/* JKFIXME: loaderData->ksFile is set to the arg from the command line,
* and then getKickstartFile() changes it and sets FL_KICKSTART.
* kind of weird. */
- if (loaderData.ksFile || ksFile) {
+ if (loaderData.ksFile) {
logMessage(INFO, "getting kickstart file");
- if (!ksFile)
- getKickstartFile(&loaderData);
+ getKickstartFile(&loaderData);
if (FL_KICKSTART(flags))
- outputKSFile = runKickstart(&loaderData, (ksFile)?ksFile:loaderData.ksFile);
+ outputKSFile = runKickstart(&loaderData, loaderData.ksFile);
}
if (FL_EARLY_NETWORKING(flags)) {
@@ -2237,10 +2170,12 @@ int main(int argc, char ** argv) {
else if (FL_SELINUX(flags))
*argptr++ = "--selinux";