Index: arch/ppc/qemu/main.c =================================================================== --- arch/ppc/qemu/main.c (révision 396) +++ arch/ppc/qemu/main.c (copie de travail) @@ -364,18 +368,23 @@
static void check_preloaded_kernel(void) { - unsigned long kernel_image, kernel_size, cmdline; + unsigned long kernel_image, kernel_size; unsigned long initrd_image, initrd_size; + unsigned long cmdline, cmdline_len; + phandle_t ph;
kernel_size = nvram_read_be32(0x3c); if (kernel_size) { kernel_image = nvram_read_be32(0x38); cmdline = nvram_read_be32(0x40); + cmdline_len = nvram_read_be32(0x44); initrd_image = nvram_read_be32(0x48); initrd_size = nvram_read_be32(0x4c); printk("[ppc] Kernel already loaded (0x%8.8lx + 0x%8.8lx) " "(initrd 0x%8.8lx + 0x%8.8lx)\n", kernel_image, kernel_size, initrd_image, initrd_size); + ph = find_dev("/chosen"); + set_property(ph, "bootargs", cmdline, cmdline_len + 1); call_elf(initrd_image, initrd_size, kernel_image); } }
Le 12 janv. 09 à 22:46, Aurelien Jarno a écrit :
Index: arch/ppc/qemu/main.c
--- arch/ppc/qemu/main.c (révision 396) +++ arch/ppc/qemu/main.c (copie de travail) @@ -364,18 +368,23 @@
static void check_preloaded_kernel(void) {
- unsigned long kernel_image, kernel_size, cmdline;
unsigned long kernel_image, kernel_size; unsigned long initrd_image, initrd_size;
unsigned long cmdline, cmdline_len;
phandle_t ph;
kernel_size = nvram_read_be32(0x3c); if (kernel_size) { kernel_image = nvram_read_be32(0x38); cmdline = nvram_read_be32(0x40);
cmdline_len = nvram_read_be32(0x44); initrd_image = nvram_read_be32(0x48); initrd_size = nvram_read_be32(0x4c); printk("[ppc] Kernel already loaded (0x%8.8lx + 0x%8.8lx) " "(initrd 0x%8.8lx + 0x%8.8lx)\n", kernel_image, kernel_size, initrd_image, initrd_size);
ph = find_dev("/chosen");
set_property(ph, "bootargs", cmdline, cmdline_len + 1); call_elf(initrd_image, initrd_size, kernel_image);
}
}
Looks good to me.
Laurent
-------------------- laurent@lvivier.info -------------------- "Tout ce qui est impossible reste à accomplir" Jules Verne "Things are only impossible until they're not" Jean-Luc Picard
Please find a new version of the patch below, that verifies that a command line has been given by qemu before defining the bootargs property.
Index: arch/ppc/qemu/main.c =================================================================== --- arch/ppc/qemu/main.c (révision 398) +++ arch/ppc/qemu/main.c (copie de travail) @@ -364,18 +368,24 @@
static void check_preloaded_kernel(void) { - unsigned long kernel_image, kernel_size, cmdline; + unsigned long kernel_image, kernel_size; unsigned long initrd_image, initrd_size; + unsigned long cmdline, cmdline_len;
kernel_size = nvram_read_be32(0x3c); if (kernel_size) { kernel_image = nvram_read_be32(0x38); cmdline = nvram_read_be32(0x40); + cmdline_len = nvram_read_be32(0x44); initrd_image = nvram_read_be32(0x48); initrd_size = nvram_read_be32(0x4c); printk("[ppc] Kernel already loaded (0x%8.8lx + 0x%8.8lx) " "(initrd 0x%8.8lx + 0x%8.8lx)\n", kernel_image, kernel_size, initrd_image, initrd_size); + if (cmdline_len > 0) { + phandle_t ph = find_dev("/chosen"); + set_property(ph, "bootargs", cmdline, cmdline_len + 1); + } call_elf(initrd_image, initrd_size, kernel_image); } }
On 1/13/09, Aurelien Jarno aurelien@aurel32.net wrote:
Please find a new version of the patch below, that verifies that a command line has been given by qemu before defining the bootargs property.
On Sparc32 there were some strange bugs, until the command line was strdup()'d. This makes the string to reside in the OpenBIOS memory instead of low memory which can be trashed or unmapped by the kernel.