Thread (1 message) 1 message, 1 author, 2012-05-31

[RFC 2/2] linux.c32: Add initrd= parameter

From: Thierry Reding <hidden>
Date: 2012-05-31 15:41:36
Subsystem: the rest · Maintainer: Linus Torvalds

This new parameter can be used to specify a Flattened Device Tree (FDT)
blob to pass to the Linux kernel.

Signed-off-by: Thierry Reding <redacted>
---
 com32/modules/linux.c |   20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/com32/modules/linux.c b/com32/modules/linux.c
index b902ebc..cc1e6fe 100644
--- a/com32/modules/linux.c
+++ b/com32/modules/linux.c
@@ -112,6 +112,7 @@ int main(int argc, char *argv[])
 {
     const char *kernel_name;
     struct initramfs *initramfs;
+    struct fdt *fdt;
     char *cmdline;
     char *boot_image;
     void *kernel_data;
@@ -207,8 +208,25 @@ int main(int argc, char *argv[])
 	    goto bail;
     }
 
+    fdt = fdt_init();
+    if (!fdt)
+	goto bail;
+
+    if ((arg = find_argument(argp, "fdt="))) {
+	if (!opt_quiet)
+	    printf("Loading %s... ", arg);
+
+	if (fdt_load(fdt, arg)) {
+	    printf("failed!\n");
+	    goto bail;
+	}
+
+	if (!opt_quiet)
+	    printf("ok\n");
+    }
+
     /* This should not return... */
-    syslinux_boot_linux(kernel_data, kernel_len, initramfs, cmdline);
+    syslinux_boot_linux(kernel_data, kernel_len, initramfs, fdt, cmdline);
 
 bail:
     fprintf(stderr, "Kernel load failure (insufficient memory?)\n");
-- 
1.7.10.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help