From: Dan A. <da...@gm...> - 2004-02-14 12:34:48
|
On Sat, Feb 14, 2004 at 02:07:13PM +0200, Dan Aloni wrote: > On Sat, Feb 14, 2004 at 10:40:25PM +1000, Ian Latter wrote: > > > > > >Yes you can get to a cmd prompt without init. Change the boot > > > >parameters in the default xml file such that "init=/bin/sh". > > > > > > > I tried that. It didn't work. It just went ahead and ran init anyway > > > and booted up all the way. > > > > If this is the case then you may have the wrong version of coLinux -- > > Dan said that he was going to fix that up -- I dunno if he did (hadn't > > retested that yet). > > I did implement it, but somehow it takes only the first paramter. Will > be fixed for the next version. Turns out that mxml splited the space separated text parameter line to nodes. Here's a fix. --- colinux-20040210/src/colinux/user/config.c 2004-02-08 00:38:21.000000000 +0200 +++ main/src/colinux/user/config.c 2004-02-14 14:27:41.000000000 +0200 @@ -95,16 +95,39 @@ if (strcmp(name, "block_device") == 0) { co_load_config_blockdev(out_config, &walk->value.element); } else if (strcmp(name, "bootparams") == 0) { + char *param_line; + unsigned long param_line_size_left; + unsigned long index; + mxml_node_t *text_node; + if (walk->child == NULL) continue; - walk = walk->child; - if (walk->type != MXML_TEXT) - continue; + param_line = out_config->boot_parameters_line; + param_line_size_left = sizeof(out_config->boot_parameters_line); + + bzero(param_line, param_line_size_left); + + text_node = walk->child; + index = 0; + + while (text_node && text_node->type == MXML_TEXT) { + if (index != 0) { + int param_size = strlen(param_line); + param_line += param_size; + param_line_size_left -= param_size; + } + + snprintf(param_line, + param_line_size_left, + index == 0 ? "%s" : " %s", + text_node->value.text.string); + + index++; + text_node = text_node->next; + } - snprintf(out_config->boot_parameters_line, - sizeof(out_config->boot_parameters_line), - "%s", walk->value.text.string); + printf("%s\n", out_config->boot_parameters_line); } else if (strcmp(name, "image") == 0) { co_load_config_image(out_config, &walk->value.element); } -- Dan Aloni da...@gm... |