pb-discover: add dtb support for PXE config
diff mbox

Message ID 1462772327-11436-1-git-send-email-oohall@gmail.com
State Accepted
Headers show

Commit Message

Oliver O'Halloran May 9, 2016, 5:38 a.m. UTC
Currently there is no way to manually specify a DTB file when with a PXE
network boot configuration file. This makes it difficult when you need
to work with or emulate a special snowflake machines with special snowflake
hardware.

Some ARM systems provide this feature with the "fdt" option so this patch
adds support for using the ftd or dtb configuration options to the PXE
config parser.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 discover/pxe-parser.c         | 4 ++++
 test/parser/test-pxe-single.c | 3 +++
 2 files changed, 7 insertions(+)

Comments

Samuel Mendoza-Jonas May 24, 2016, 1:26 a.m. UTC | #1
On Mon, May 09, 2016 at 03:38:47PM +1000, Oliver O'Halloran wrote:
> Currently there is no way to manually specify a DTB file when with a PXE
> network boot configuration file. This makes it difficult when you need
> to work with or emulate a special snowflake machines with special snowflake
> hardware.
> 
> Some ARM systems provide this feature with the "fdt" option so this patch
> adds support for using the ftd or dtb configuration options to the PXE
> config parser.
> 
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>

Thanks! Merged as 6993af8a

> ---
>  discover/pxe-parser.c         | 4 ++++
>  test/parser/test-pxe-single.c | 3 +++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/discover/pxe-parser.c b/discover/pxe-parser.c
> index 95547c389799..4812c374d199 100644
> --- a/discover/pxe-parser.c
> +++ b/discover/pxe-parser.c
> @@ -189,6 +189,10 @@ static void pxe_process_pair(struct conf_context *ctx,
>  		type = strtoul(value, &end, 10);
>  		if (end != value && !(*end))
>  			pxe_process_sysappend(ctx->dc, opt, type);
> +
> +	} else if (streq(name, "DTB") || streq(name, "FDT")) {
> +		url = pxe_url_join(ctx->dc, ctx->dc->conf_url, value);
> +		opt->dtb = create_url_resource(opt, url);
>  	}
>  
>  }
> diff --git a/test/parser/test-pxe-single.c b/test/parser/test-pxe-single.c
> index 56c404cd9820..3c3ab2b9beae 100644
> --- a/test/parser/test-pxe-single.c
> +++ b/test/parser/test-pxe-single.c
> @@ -8,6 +8,7 @@ label linux
>  kernel ./pxe/de-ad-de-ad-be-ef.vmlinuz
>  append command line
>  initrd=./pxe/de-ad-de-ad-be-ef.initrd
> +dtb ./pxe/de-ad-de-ad-be-ef.dtb
>  #endif
>  
>  void run_test(struct parser_test *test)
> @@ -35,4 +36,6 @@ void run_test(struct parser_test *test)
>  			"tftp://host/dir/./pxe/de-ad-de-ad-be-ef.vmlinuz");
>  	check_resolved_url_resource(opt->initrd,
>  			"tftp://host/dir/./pxe/de-ad-de-ad-be-ef.initrd");
> +	check_resolved_url_resource(opt->dtb,
> +			"tftp://host/dir/./pxe/de-ad-de-ad-be-ef.dtb");
>  }
> -- 
> 2.5.5
> 
> _______________________________________________
> Petitboot mailing list
> Petitboot@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/petitboot

Patch
diff mbox

diff --git a/discover/pxe-parser.c b/discover/pxe-parser.c
index 95547c389799..4812c374d199 100644
--- a/discover/pxe-parser.c
+++ b/discover/pxe-parser.c
@@ -189,6 +189,10 @@  static void pxe_process_pair(struct conf_context *ctx,
 		type = strtoul(value, &end, 10);
 		if (end != value && !(*end))
 			pxe_process_sysappend(ctx->dc, opt, type);
+
+	} else if (streq(name, "DTB") || streq(name, "FDT")) {
+		url = pxe_url_join(ctx->dc, ctx->dc->conf_url, value);
+		opt->dtb = create_url_resource(opt, url);
 	}
 
 }
diff --git a/test/parser/test-pxe-single.c b/test/parser/test-pxe-single.c
index 56c404cd9820..3c3ab2b9beae 100644
--- a/test/parser/test-pxe-single.c
+++ b/test/parser/test-pxe-single.c
@@ -8,6 +8,7 @@  label linux
 kernel ./pxe/de-ad-de-ad-be-ef.vmlinuz
 append command line
 initrd=./pxe/de-ad-de-ad-be-ef.initrd
+dtb ./pxe/de-ad-de-ad-be-ef.dtb
 #endif
 
 void run_test(struct parser_test *test)
@@ -35,4 +36,6 @@  void run_test(struct parser_test *test)
 			"tftp://host/dir/./pxe/de-ad-de-ad-be-ef.vmlinuz");
 	check_resolved_url_resource(opt->initrd,
 			"tftp://host/dir/./pxe/de-ad-de-ad-be-ef.initrd");
+	check_resolved_url_resource(opt->dtb,
+			"tftp://host/dir/./pxe/de-ad-de-ad-be-ef.dtb");
 }