Add support for devicetree files alongside the kernel and initramfs
authorWilliam Manley <will@williammanley.net>
Tue, 9 Jan 2018 19:40:07 +0000 (19:40 +0000)
committerAtomic Bot <atomic-devel@projectatomic.io>
Tue, 16 Jan 2018 22:54:53 +0000 (22:54 +0000)
commit720e2ec9bc401ec82deb64d5f493d5a2a41dd87d
tree392357aacda02e2e817263c2479ba697eb1f6562
parentc5112c25e4519835c4cd53f4350c1b2f2a477746
Add support for devicetree files alongside the kernel and initramfs

Much like the (optional) initramfs at
`/usr/lib/ostree-boot/initramfs-<SHA256>` or
`/usr/lib/modules/$kver/initramfs` you can now optionally include a
flattened devicetree (.dtb) file alongside the kernel at
`/usr/lib/ostree-boot/devicetree-<SHA256>` or
`/usr/lib/modules/$kver/devicetree`.

This is useful for embedded ARM systems which need the devicetree file
loaded by the bootloader for the kernel to discover and initialise
hardware.  See https://en.wikipedia.org/wiki/Device_tree for more
information.

This patch was mostly produced by copy-pasting code for initramfs handling
and renaming `s/initramfs/devicetree/g`.  It's not beautiful, but it is
fairly straightforward.

It may be useful to extend device-tree support in a number ways in the
future.  Device trees dependant on many details of the hardware they
support.  This makes them unlike kernels, which may support many different
hardware variants as long as the instruction-set matches.  This means that
a ostree tree created with a device-tree in this manner will only boot on
a single model of hardware.  This is sufficient for my purposes, but may
not be for others'.

I've tested this on my NVidia Tegra TK1 device which has u-boot running
in syslinux-compatible mode.

Closes: #1411
Approved by: cgwalters
docs/manual/atomic-upgrades.md
docs/manual/deployment.md
src/libostree/ostree-sysroot-deploy.c
tests/test-no-initramfs.sh