syslinux: Add support for DEVICETREE from bootloader spec
authorWilliam Manley <will@williammanley.net>
Mon, 6 Mar 2017 19:41:46 +0000 (19:41 +0000)
committerAtomic Bot <atomic-devel@projectatomic.io>
Tue, 16 Jan 2018 22:54:53 +0000 (22:54 +0000)
The bootloader spec says:

> `devicetree` refers to the binary device tree to use when executing the
> kernel. This also shall be a path relative to the `$BOOT` directory. This
> key is optional. Example:
> `6a9857a393724b7a981ebb5b8495b9ea/3.8.0-2.fc19.armv7hl/tegra20-paz00.dtb`

This is necessary for booting my NVidia Tegra TK1 device.  It uses u-boot
with syslinux compatibility.  In the syslinux files that come with the
device this is called `FDT`, but u-boot treats `FDT and `DEVICETREE` as
synonyms.

See also: [f43c401 in u-boot].

[f43c401 in u-boot]: http://git.denx.de/?p=u-boot.git;a=commit;h=f43c401b72bb0db43ab0b55c4a79e1f4889d3aa2

Closes: #1411
Approved by: cgwalters

src/libostree/ostree-bootloader-syslinux.c

index 85b84e613939c841ab7d01235397330007b31390..8b09a861b240eb0f1ec5a4cb85989fe44e46d179 100644 (file)
@@ -95,6 +95,10 @@ append_config_from_loader_entries (OstreeBootloaderSyslinux  *self,
       if (val)
         g_ptr_array_add (new_lines, g_strdup_printf ("\tINITRD %s", val));
 
+      val = ostree_bootconfig_parser_get (config, "devicetree");
+      if (val)
+        g_ptr_array_add (new_lines, g_strdup_printf ("\tDEVICETREE %s", val));
+
       val = ostree_bootconfig_parser_get (config, "options");
       if (val)
         g_ptr_array_add (new_lines, g_strdup_printf ("\tAPPEND %s", val));