Author: laurent Date: 2009-02-18 14:58:35 +0100 (Wed, 18 Feb 2009) New Revision: 456
Modified: openbios-devel/arch/ppc/qemu/main.c Log: Extract "bootargs" from "boot" command line.
It is needed to boot Fedora-10 as we must specify the path to the yaboot.conf.
To boot Fedora:
boot cd: conf=cd:,\ppc\ppc32\yaboot.conf
so "bootpath" is "cd:", and "bootargs" is "conf=cd:,\ppc\ppc32\yaboot.conf"
Modified: openbios-devel/arch/ppc/qemu/main.c =================================================================== --- openbios-devel/arch/ppc/qemu/main.c 2009-02-17 22:45:41 UTC (rev 455) +++ openbios-devel/arch/ppc/qemu/main.c 2009-02-18 13:58:35 UTC (rev 456) @@ -182,7 +182,8 @@
ELF_DPRINTF("bootpath %s bootargs %s\n", path, args); set_property( chosen_ph, "bootpath", path, strlen(spec)+1 ); - set_property( chosen_ph, "bootargs", args, strlen(args)+1 ); + if (args) + set_property( chosen_ph, "bootargs", args, strlen(args)+1 ); }
/************************************************************************/ @@ -224,7 +225,7 @@ http://playground.sun.com/1275/bindings/chrp/chrp1_7a.ps */ static void -try_bootinfo(const char *path) +try_bootinfo(const char *path, const char *param) { int fd, len, tag, taglen, script, scriptlen, entity; char tagbuf[256], bootscript[256], c; @@ -311,6 +312,8 @@
ELF_DPRINTF("got bootscript %s\n", bootscript);
+ encode_bootpath(path, param); + feval(bootscript); badf: close_io( fd ); @@ -412,6 +415,12 @@ char *path = pop_fstr_copy(), *param; int i;
+ param = strchr(path, ' '); + if (param) { + *param = 0; + param++; + } + if (!path) { ELF_DPRINTF("Entering boot, no path\n"); push_str("boot-device"); @@ -435,7 +444,7 @@ param = pop_fstr_copy(); } try_path(path, param); - try_bootinfo(path); + try_bootinfo(path, param); } else { char boot_device = nvram_read(0x34);
@@ -448,12 +457,12 @@ path = strdup("cd:0"); break; } - try_bootinfo(path); + try_bootinfo(path, NULL); } } else { ELF_DPRINTF("Entering boot, path %s\n", path); - try_path(path, ""); - try_bootinfo(path); + try_path(path, param); + try_bootinfo(path, param); } for( i=0; i < sizeof(paths) / sizeof(paths[0]); i++ ) { try_path(paths[i], args[i]);