[OpenBIOS] [commit] r723 - in trunk/openbios-devel: config/examples include/libopenbios libopenbios packages
repository service
svn at openbios.org
Fri Apr 2 11:18:52 CEST 2010
Author: mcayland
Date: Fri Apr 2 11:18:51 2010
New Revision: 723
URL: http://tracker.coreboot.org/trac/openbios/changeset/723
Log:
Move the bootinfo loader into libopenbios, refactoring and adding the new CONFIG_LOADER_BOOTINFO as appropriate.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at siriusit.co.uk>
Added:
trunk/openbios-devel/include/libopenbios/bootinfo_load.h
trunk/openbios-devel/libopenbios/bootinfo_load.c
Modified:
trunk/openbios-devel/config/examples/amd64_config.xml
trunk/openbios-devel/config/examples/cross-ppc_config.xml
trunk/openbios-devel/config/examples/cross-sparc32_config.xml
trunk/openbios-devel/config/examples/cross-sparc64_config.xml
trunk/openbios-devel/config/examples/cross-x86_config.xml
trunk/openbios-devel/config/examples/ppc_config.xml
trunk/openbios-devel/config/examples/sparc32_config.xml
trunk/openbios-devel/config/examples/sparc64_config.xml
trunk/openbios-devel/config/examples/x86_config.xml
trunk/openbios-devel/libopenbios/build.xml
trunk/openbios-devel/packages/bootinfo-loader.c
trunk/openbios-devel/packages/build.xml
Modified: trunk/openbios-devel/config/examples/amd64_config.xml
==============================================================================
--- trunk/openbios-devel/config/examples/amd64_config.xml Fri Apr 2 10:33:07 2010 (r722)
+++ trunk/openbios-devel/config/examples/amd64_config.xml Fri Apr 2 11:18:51 2010 (r723)
@@ -36,6 +36,7 @@
<option name="CONFIG_FONT_8X8" type="boolean" value="true"/>
<option name="CONFIG_FONT_8X16" type="boolean" value="false"/>
<option name="CONFIG_LOADER_AOUT" type="boolean" value="false"/>
+ <option name="CONFIG_LOADER_BOOTINFO" type="boolean" value="false"/>
<option name="CONFIG_LOADER_ELF" type="boolean" value="true"/>
<option name="CONFIG_LOADER_FCODE" type="boolean" value="false"/>
<option name="CONFIG_LOADER_FORTH" type="boolean" value="false"/>
Modified: trunk/openbios-devel/config/examples/cross-ppc_config.xml
==============================================================================
--- trunk/openbios-devel/config/examples/cross-ppc_config.xml Fri Apr 2 10:33:07 2010 (r722)
+++ trunk/openbios-devel/config/examples/cross-ppc_config.xml Fri Apr 2 11:18:51 2010 (r723)
@@ -41,6 +41,7 @@
<option name="CONFIG_VGA_HEIGHT" type="integer" value="600"/>
<option name="CONFIG_VGA_DEPTH" type="integer" value="8"/>
<option name="CONFIG_LOADER_AOUT" type="boolean" value="false"/>
+ <option name="CONFIG_LOADER_BOOTINFO" type="boolean" value="true"/>
<option name="CONFIG_LOADER_ELF" type="boolean" value="false"/>
<option name="CONFIG_LOADER_FCODE" type="boolean" value="false"/>
<option name="CONFIG_LOADER_FORTH" type="boolean" value="false"/>
Modified: trunk/openbios-devel/config/examples/cross-sparc32_config.xml
==============================================================================
--- trunk/openbios-devel/config/examples/cross-sparc32_config.xml Fri Apr 2 10:33:07 2010 (r722)
+++ trunk/openbios-devel/config/examples/cross-sparc32_config.xml Fri Apr 2 11:18:51 2010 (r723)
@@ -42,6 +42,7 @@
<option name="CONFIG_FONT_8X8" type="boolean" value="true"/>
<option name="CONFIG_FONT_8X16" type="boolean" value="false"/>
<option name="CONFIG_LOADER_AOUT" type="boolean" value="true"/>
+ <option name="CONFIG_LOADER_BOOTINFO" type="boolean" value="false"/>
<option name="CONFIG_LOADER_ELF" type="boolean" value="true"/>
<option name="CONFIG_LOADER_FCODE" type="boolean" value="false"/>
<option name="CONFIG_LOADER_FORTH" type="boolean" value="false"/>
Modified: trunk/openbios-devel/config/examples/cross-sparc64_config.xml
==============================================================================
--- trunk/openbios-devel/config/examples/cross-sparc64_config.xml Fri Apr 2 10:33:07 2010 (r722)
+++ trunk/openbios-devel/config/examples/cross-sparc64_config.xml Fri Apr 2 11:18:51 2010 (r723)
@@ -42,6 +42,7 @@
<option name="CONFIG_OFMEM" type="boolean" value="true"/>
<option name="CONFIG_OFMEM_MALLOC_ALIGN" type="integer" value="8"/>
<option name="CONFIG_LOADER_AOUT" type="boolean" value="true"/>
+ <option name="CONFIG_LOADER_BOOTINFO" type="boolean" value="false"/>
<option name="CONFIG_LOADER_ELF" type="boolean" value="true"/>
<option name="CONFIG_LOADER_FCODE" type="boolean" value="true"/>
<option name="CONFIG_LOADER_FORTH" type="boolean" value="false"/>
Modified: trunk/openbios-devel/config/examples/cross-x86_config.xml
==============================================================================
--- trunk/openbios-devel/config/examples/cross-x86_config.xml Fri Apr 2 10:33:07 2010 (r722)
+++ trunk/openbios-devel/config/examples/cross-x86_config.xml Fri Apr 2 11:18:51 2010 (r723)
@@ -37,6 +37,7 @@
<option name="CONFIG_FONT_8X8" type="boolean" value="true"/>
<option name="CONFIG_FONT_8X16" type="boolean" value="false"/>
<option name="CONFIG_LOADER_AOUT" type="boolean" value="false"/>
+ <option name="CONFIG_LOADER_BOOTINFO" type="boolean" value="false"/>
<option name="CONFIG_LOADER_ELF" type="boolean" value="true"/>
<option name="CONFIG_LOADER_FCODE" type="boolean" value="false"/>
<option name="CONFIG_LOADER_FORTH" type="boolean" value="true"/>
Modified: trunk/openbios-devel/config/examples/ppc_config.xml
==============================================================================
--- trunk/openbios-devel/config/examples/ppc_config.xml Fri Apr 2 10:33:07 2010 (r722)
+++ trunk/openbios-devel/config/examples/ppc_config.xml Fri Apr 2 11:18:51 2010 (r723)
@@ -41,6 +41,7 @@
<option name="CONFIG_VGA_HEIGHT" type="integer" value="600"/>
<option name="CONFIG_VGA_DEPTH" type="integer" value="8"/>
<option name="CONFIG_LOADER_AOUT" type="boolean" value="false"/>
+ <option name="CONFIG_LOADER_BOOTINFO" type="boolean" value="true"/>
<option name="CONFIG_LOADER_ELF" type="boolean" value="false"/>
<option name="CONFIG_LOADER_FCODE" type="boolean" value="false"/>
<option name="CONFIG_LOADER_FORTH" type="boolean" value="false"/>
Modified: trunk/openbios-devel/config/examples/sparc32_config.xml
==============================================================================
--- trunk/openbios-devel/config/examples/sparc32_config.xml Fri Apr 2 10:33:07 2010 (r722)
+++ trunk/openbios-devel/config/examples/sparc32_config.xml Fri Apr 2 11:18:51 2010 (r723)
@@ -42,6 +42,7 @@
<option name="CONFIG_FONT_8X8" type="boolean" value="true"/>
<option name="CONFIG_FONT_8X16" type="boolean" value="false"/>
<option name="CONFIG_LOADER_AOUT" type="boolean" value="true"/>
+ <option name="CONFIG_LOADER_BOOTINFO" type="boolean" value="false"/>
<option name="CONFIG_LOADER_ELF" type="boolean" value="true"/>
<option name="CONFIG_LOADER_FCODE" type="boolean" value="false"/>
<option name="CONFIG_LOADER_FORTH" type="boolean" value="false"/>
Modified: trunk/openbios-devel/config/examples/sparc64_config.xml
==============================================================================
--- trunk/openbios-devel/config/examples/sparc64_config.xml Fri Apr 2 10:33:07 2010 (r722)
+++ trunk/openbios-devel/config/examples/sparc64_config.xml Fri Apr 2 11:18:51 2010 (r723)
@@ -42,6 +42,7 @@
<option name="CONFIG_OFMEM" type="boolean" value="true"/>
<option name="CONFIG_OFMEM_MALLOC_ALIGN" type="integer" value="8"/>
<option name="CONFIG_LOADER_AOUT" type="boolean" value="true"/>
+ <option name="CONFIG_LOADER_BOOTINFO" type="boolean" value="false"/>
<option name="CONFIG_LOADER_ELF" type="boolean" value="true"/>
<option name="CONFIG_LOADER_FCODE" type="boolean" value="true"/>
<option name="CONFIG_LOADER_FORTH" type="boolean" value="false"/>
Modified: trunk/openbios-devel/config/examples/x86_config.xml
==============================================================================
--- trunk/openbios-devel/config/examples/x86_config.xml Fri Apr 2 10:33:07 2010 (r722)
+++ trunk/openbios-devel/config/examples/x86_config.xml Fri Apr 2 11:18:51 2010 (r723)
@@ -37,6 +37,7 @@
<option name="CONFIG_FONT_8X8" type="boolean" value="true"/>
<option name="CONFIG_FONT_8X16" type="boolean" value="false"/>
<option name="CONFIG_LOADER_AOUT" type="boolean" value="false"/>
+ <option name="CONFIG_LOADER_BOOTINFO" type="boolean" value="false"/>
<option name="CONFIG_LOADER_ELF" type="boolean" value="true"/>
<option name="CONFIG_LOADER_FCODE" type="boolean" value="false"/>
<option name="CONFIG_LOADER_FORTH" type="boolean" value="true"/>
Added: trunk/openbios-devel/include/libopenbios/bootinfo_load.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/openbios-devel/include/libopenbios/bootinfo_load.h Fri Apr 2 11:18:51 2010 (r723)
@@ -0,0 +1,26 @@
+/*
+ * Creation Date: <2010/03/22 18:00:00 mcayland>
+ * Time-stamp: <2010/03/22 18:00:00 mcayland>
+ *
+ * <bootinfo_load.h>
+ *
+ * CHRP boot info loader
+ *
+ * Copyright (C) 2010 Mark Cave-Ayland (mark.cave-ayland at siriusit.co.uk)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation
+ *
+ */
+
+#ifndef _H_BOOTINFOLOAD
+#define _H_BOOTINFOLOAD
+
+#include "libopenbios/sys_info.h"
+
+extern int is_bootinfo(char *bootinfo);
+extern int bootinfo_load(struct sys_info *info, const char *filename);
+extern void bootinfo_init_program(void);
+
+#endif /* _H_BOOTINFOLOAD */
Added: trunk/openbios-devel/libopenbios/bootinfo_load.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/openbios-devel/libopenbios/bootinfo_load.c Fri Apr 2 11:18:51 2010 (r723)
@@ -0,0 +1,252 @@
+/*
+ *
+ * <bootinfo_load.c>
+ *
+ * bootinfo file loader
+ *
+ * Copyright (C) 2009 Laurent Vivier (Laurent at vivier.eu)
+ *
+ * Original XML parser by Blue Swirl <blauwirbel at gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2
+ *
+ */
+
+#include "config.h"
+#include "libopenbios/bindings.h"
+#include "libopenbios/bootinfo_load.h"
+#include "libopenbios/ofmem.h"
+#include "libc/vsprintf.h"
+
+//#define DEBUG_BOOTINFO
+
+#ifdef DEBUG_BOOTINFO
+#define DPRINTF(fmt, args...) \
+ do { printk("%s: " fmt, __func__ , ##args); } while (0)
+#else
+#define DPRINTF(fmt, args...) \
+ do { } while (0)
+#endif
+
+static char *
+get_device( const char *path )
+{
+ int i;
+ static char buf[1024];
+
+ for (i = 0; i < sizeof(buf) && path[i] && path[i] != ':'; i++)
+ buf[i] = path[i];
+ buf[i] = 0;
+
+ return buf;
+}
+
+static int
+get_partition( const char *path )
+{
+ while ( *path && *path != ':' )
+ path++;
+
+ if (!*path)
+ return -1;
+ path++;
+
+ if (!strchr(path, ',')) /* check if there is a ',' */
+ return -1;
+
+ return atol(path);
+}
+
+static char *
+get_filename( const char * path , char **dirname)
+{
+ static char buf[1024];
+ char *filename;
+
+ while ( *path && *path != ':' )
+ path++;
+
+ if (!*path) {
+ *dirname = NULL;
+ return NULL;
+ }
+ path++;
+
+ while ( *path && isdigit(*path) )
+ path++;
+
+ if (*path == ',')
+ path++;
+
+ strncpy(buf, path, sizeof(buf));
+ buf[sizeof(buf) - 1] = 0;
+
+ filename = strrchr(buf, '\\');
+ if (filename) {
+ *dirname = buf;
+ (*filename++) = 0;
+ } else {
+ *dirname = NULL;
+ filename = buf;
+ }
+
+ return filename;
+}
+
+int
+is_bootinfo(char *bootinfo)
+{
+ return (strncasecmp(bootinfo, "<chrp-boot", 10) ? 0 : -1);
+}
+
+int
+bootinfo_load(struct sys_info *info, const char *filename)
+{
+ // Currently not implemented
+ return LOADER_NOT_SUPPORT;
+}
+
+/*
+ Parse SGML structure like:
+ <chrp-boot>
+ <description>Debian/GNU Linux Installation on IBM CHRP hardware</description>
+ <os-name>Debian/GNU Linux for PowerPC</os-name>
+ <boot-script>boot &device;:\install\yaboot</boot-script>
+ <icon size=64,64 color-space=3,3,2>
+
+ CHRP system bindings are described at:
+ http://playground.sun.com/1275/bindings/chrp/chrp1_7a.ps
+*/
+
+void
+bootinfo_init_program(void)
+{
+ char *base;
+ int proplen;
+ phandle_t chosen;
+ int tag, taglen, script, scriptlen, entity, chrp;
+ char tagbuf[128], c;
+ char *device, *filename, *directory;
+ int partition;
+ int current, size;
+ char *bootscript;
+ char *tmp;
+ char bootpath[1024];
+
+ feval("0 state-valid !");
+
+ chosen = find_dev("/chosen");
+ tmp = get_property(chosen, "bootpath", &proplen);
+ memcpy(bootpath, tmp, proplen);
+ bootpath[proplen] = 0;
+
+ DPRINTF("bootpath %s\n", bootpath);
+
+ device = get_device(bootpath);
+ partition = get_partition(bootpath);
+ filename = get_filename(bootpath, &directory);
+
+ feval("load-base");
+ base = (char*)POP();
+
+ feval("load-size");
+ size = POP();
+
+ bootscript = malloc(size);
+ if (bootscript == NULL) {
+ DPRINTF("Can't malloc %d bytes\n", size);
+ return;
+ }
+
+ if (!is_bootinfo(base)) {
+ DPRINTF("Not a valid bootinfo memory image\n");
+ return;
+ }
+
+ chrp = 0;
+ tag = 0;
+ taglen = 0;
+ script = 0;
+ scriptlen = 0;
+ entity = 0;
+ current = 0;
+ while (current < size) {
+
+ c = base[current++];
+
+ if (c == '<') {
+ script = 0;
+ tag = 1;
+ taglen = 0;
+ } else if (c == '>') {
+ tag = 0;
+ tagbuf[taglen] = '\0';
+ if (strncasecmp(tagbuf, "chrp-boot", 9) == 0) {
+ chrp = 1;
+ } else if (chrp == 1) {
+ if (strncasecmp(tagbuf, "boot-script", 11) == 0) {
+ script = 1;
+ scriptlen = 0;
+ } else if (strncasecmp(tagbuf, "/boot-script", 12) == 0) {
+
+ script = 0;
+ bootscript[scriptlen] = '\0';
+
+ DPRINTF("got bootscript %s\n",
+ bootscript);
+
+ feval("-1 state-valid !");
+
+ break;
+ } else if (strncasecmp(tagbuf, "/chrp-boot", 10) == 0)
+ break;
+ }
+ } else if (tag && taglen < sizeof(tagbuf)) {
+ tagbuf[taglen++] = c;
+ } else if (script && c == '&') {
+ entity = 1;
+ taglen = 0;
+ } else if (entity && c ==';') {
+ entity = 0;
+ tagbuf[taglen] = '\0';
+ if (strncasecmp(tagbuf, "lt", 2) == 0) {
+ bootscript[scriptlen++] = '<';
+ } else if (strncasecmp(tagbuf, "gt", 2) == 0) {
+ bootscript[scriptlen++] = '>';
+ } else if (strncasecmp(tagbuf, "device", 6) == 0) {
+ strcpy(bootscript + scriptlen, device);
+ scriptlen += strlen(device);
+ } else if (strncasecmp(tagbuf, "partition", 9) == 0) {
+ if (partition != -1)
+ sprintf(bootscript + scriptlen, "%d", partition);
+ else
+ *(bootscript + scriptlen) = 0;
+ scriptlen = strlen(bootscript);
+ } else if (strncasecmp(tagbuf, "directory", 9) == 0) {
+ strcpy(bootscript + scriptlen, directory);
+ scriptlen += strlen(directory);
+ } else if (strncasecmp(tagbuf, "filename", 8) == 0) {
+ strcpy(bootscript + scriptlen, filename);
+ scriptlen += strlen(filename);
+ } else if (strncasecmp(tagbuf, "full-path", 9) == 0) {
+ strcpy(bootscript + scriptlen, bootpath);
+ scriptlen += strlen(bootpath);
+ } else { /* unknown, keep it */
+ bootscript[scriptlen] = '&';
+ strcpy(bootscript + scriptlen + 1, tagbuf);
+ scriptlen += taglen + 1;
+ bootscript[scriptlen] = ';';
+ scriptlen++;
+ }
+ } else if (entity && taglen < sizeof(tagbuf)) {
+ tagbuf[taglen++] = c;
+ } else if (script && scriptlen < size) {
+ bootscript[scriptlen++] = c;
+ }
+ }
+ /* FIXME: should initialize saved-program-state. */
+ push_str(bootscript);
+ feval("bootinfo-size ! bootinfo-entry !");
+}
Modified: trunk/openbios-devel/libopenbios/build.xml
==============================================================================
--- trunk/openbios-devel/libopenbios/build.xml Fri Apr 2 10:33:07 2010 (r722)
+++ trunk/openbios-devel/libopenbios/build.xml Fri Apr 2 11:18:51 2010 (r723)
@@ -3,6 +3,7 @@
<library name="openbios" type="static" target="target">
<object source="aout_load.c" condition="LOADER_AOUT"/>
<object source="bindings.c"/>
+ <object source="bootinfo_load.c" condition="LOADER_BOOTINFO"/>
<object source="client.c"/>
<object source="console_common.c"/>
<object source="elf_info.c" />
Modified: trunk/openbios-devel/packages/bootinfo-loader.c
==============================================================================
--- trunk/openbios-devel/packages/bootinfo-loader.c Fri Apr 2 10:33:07 2010 (r722)
+++ trunk/openbios-devel/packages/bootinfo-loader.c Fri Apr 2 11:18:51 2010 (r723)
@@ -6,8 +6,6 @@
*
* Copyright (C) 2009 Laurent Vivier (Laurent at vivier.eu)
*
- * Original XML parser by Blue Swirl <blauwirbel at gmail.com>
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2
@@ -16,227 +14,13 @@
#include "config.h"
#include "libopenbios/bindings.h"
+#include "libopenbios/bootinfo_load.h"
#include "packages.h"
-#include "libopenbios/ofmem.h"
-#include "libc/vsprintf.h"
-
-//#define DEBUG_BOOTINFO
-
-#ifdef DEBUG_BOOTINFO
-#define DPRINTF(fmt, args...) \
- do { printk("%s: " fmt, __func__ , ##args); } while (0)
-#else
-#define DPRINTF(fmt, args...) \
- do { } while (0)
-#endif
DECLARE_NODE(bootinfo_loader, INSTALL_OPEN, 0, "+/packages/bootinfo-loader" );
-static char *
-get_device( const char *path )
-{
- int i;
- static char buf[1024];
-
- for (i = 0; i < sizeof(buf) && path[i] && path[i] != ':'; i++)
- buf[i] = path[i];
- buf[i] = 0;
-
- return buf;
-}
-
-static int
-get_partition( const char *path )
-{
- while ( *path && *path != ':' )
- path++;
-
- if (!*path)
- return -1;
- path++;
-
- if (!strchr(path, ',')) /* check if there is a ',' */
- return -1;
-
- return atol(path);
-}
-
-static char *
-get_filename( const char * path , char **dirname)
-{
- static char buf[1024];
- char *filename;
-
- while ( *path && *path != ':' )
- path++;
-
- if (!*path) {
- *dirname = NULL;
- return NULL;
- }
- path++;
-
- while ( *path && isdigit(*path) )
- path++;
-
- if (*path == ',')
- path++;
-
- strncpy(buf, path, sizeof(buf));
- buf[sizeof(buf) - 1] = 0;
-
- filename = strrchr(buf, '\\');
- if (filename) {
- *dirname = buf;
- (*filename++) = 0;
- } else {
- *dirname = NULL;
- filename = buf;
- }
-
- return filename;
-}
-
-/*
- Parse SGML structure like:
- <chrp-boot>
- <description>Debian/GNU Linux Installation on IBM CHRP hardware</description>
- <os-name>Debian/GNU Linux for PowerPC</os-name>
- <boot-script>boot &device;:\install\yaboot</boot-script>
- <icon size=64,64 color-space=3,3,2>
-
- CHRP system bindings are described at:
- http://playground.sun.com/1275/bindings/chrp/chrp1_7a.ps
-*/
-
-static void
-bootinfo_loader_init_program( void *dummy )
-{
- char *base;
- int proplen;
- phandle_t chosen;
- int tag, taglen, script, scriptlen, entity, chrp;
- char tagbuf[128], c;
- char *device, *filename, *directory;
- int partition;
- int current, size;
- char *bootscript;
- char *tmp;
- char bootpath[1024];
-
- feval("0 state-valid !");
-
- chosen = find_dev("/chosen");
- tmp = get_property(chosen, "bootpath", &proplen);
- memcpy(bootpath, tmp, proplen);
- bootpath[proplen] = 0;
-
- DPRINTF("bootpath %s\n", bootpath);
-
- device = get_device(bootpath);
- partition = get_partition(bootpath);
- filename = get_filename(bootpath, &directory);
-
- feval("load-base");
- base = (char*)POP();
-
- feval("load-size");
- size = POP();
-
- bootscript = malloc(size);
- if (bootscript == NULL) {
- DPRINTF("Can't malloc %d bytes\n", size);
- return;
- }
-
- chrp = 0;
- tag = 0;
- taglen = 0;
- script = 0;
- scriptlen = 0;
- entity = 0;
- current = 0;
- while (current < size) {
-
- c = base[current++];
-
- if (c == '<') {
- script = 0;
- tag = 1;
- taglen = 0;
- } else if (c == '>') {
- tag = 0;
- tagbuf[taglen] = '\0';
- if (strncasecmp(tagbuf, "chrp-boot", 9) == 0) {
- chrp = 1;
- } else if (chrp == 1) {
- if (strncasecmp(tagbuf, "boot-script", 11) == 0) {
- script = 1;
- scriptlen = 0;
- } else if (strncasecmp(tagbuf, "/boot-script", 12) == 0) {
-
- script = 0;
- bootscript[scriptlen] = '\0';
-
- DPRINTF("got bootscript %s\n",
- bootscript);
-
- feval("-1 state-valid !");
-
- break;
- } else if (strncasecmp(tagbuf, "/chrp-boot", 10) == 0)
- break;
- }
- } else if (tag && taglen < sizeof(tagbuf)) {
- tagbuf[taglen++] = c;
- } else if (script && c == '&') {
- entity = 1;
- taglen = 0;
- } else if (entity && c ==';') {
- entity = 0;
- tagbuf[taglen] = '\0';
- if (strncasecmp(tagbuf, "lt", 2) == 0) {
- bootscript[scriptlen++] = '<';
- } else if (strncasecmp(tagbuf, "gt", 2) == 0) {
- bootscript[scriptlen++] = '>';
- } else if (strncasecmp(tagbuf, "device", 6) == 0) {
- strcpy(bootscript + scriptlen, device);
- scriptlen += strlen(device);
- } else if (strncasecmp(tagbuf, "partition", 9) == 0) {
- if (partition != -1)
- sprintf(bootscript + scriptlen, "%d", partition);
- else
- *(bootscript + scriptlen) = 0;
- scriptlen = strlen(bootscript);
- } else if (strncasecmp(tagbuf, "directory", 9) == 0) {
- strcpy(bootscript + scriptlen, directory);
- scriptlen += strlen(directory);
- } else if (strncasecmp(tagbuf, "filename", 8) == 0) {
- strcpy(bootscript + scriptlen, filename);
- scriptlen += strlen(filename);
- } else if (strncasecmp(tagbuf, "full-path", 9) == 0) {
- strcpy(bootscript + scriptlen, bootpath);
- scriptlen += strlen(bootpath);
- } else { /* unknown, keep it */
- bootscript[scriptlen] = '&';
- strcpy(bootscript + scriptlen + 1, tagbuf);
- scriptlen += taglen + 1;
- bootscript[scriptlen] = ';';
- scriptlen++;
- }
- } else if (entity && taglen < sizeof(tagbuf)) {
- tagbuf[taglen++] = c;
- } else if (script && scriptlen < size) {
- bootscript[scriptlen++] = c;
- }
- }
- /* FIXME: should initialize saved-program-state. */
- push_str(bootscript);
- feval("bootinfo-size ! bootinfo-entry !");
-}
-
NODE_METHODS( bootinfo_loader ) = {
- { "init-program", bootinfo_loader_init_program },
+ { "init-program", bootinfo_init_program },
};
void bootinfo_loader_init( void )
Modified: trunk/openbios-devel/packages/build.xml
==============================================================================
--- trunk/openbios-devel/packages/build.xml Fri Apr 2 10:33:07 2010 (r722)
+++ trunk/openbios-devel/packages/build.xml Fri Apr 2 11:18:51 2010 (r723)
@@ -1,7 +1,7 @@
<build>
<library name="packages" type="static" target="target">
- <object source="bootinfo-loader.c" condition="PPC"/>
+ <object source="bootinfo-loader.c" condition="LOADER_BOOTINFO"/>
<object source="cmdline.c" condition="CMDLINE"/>
<object source="deblocker.c" condition="DEBLOCKER"/>
<object source="disk-label.c" condition="DISK_LABEL"/>
More information about the OpenBIOS
mailing list