Device tree file locations

We are looking into standardizing the location of kernel provided dtbs. Standard location would help both end users to locate the files as well as simplify writing tools to manage boot process.

kernel make install

/boot/dtbs/$(uname -r)

fedora

/boot/dtb-$(uname -r)

Debian

/usr/lib/linux-image-$(uname -r)

Ubuntu

/lib/firmware/$(uname -r)/device-tree

archlinux

/boot/dtbs

openSUSE

/boot/dtb

OpenEmbedded

/boot

gentoo

??

chromeos

 provided by firmware?

Discussion points:

  • Shouldn't dtb come with the firmware/bootloader not kernel?
    • yes many see that as the preferred way. However, in reality every distro ships with dtb files from kernel sources.
  • How is device tree file location related to BootLoaderSpec, grub, EFI or extlinux.conf based boot menus?

    • Not related, but having a standard location for dtb's should make it simpler to write general purpose code to manage menus.
  • /boot
    • + Accessible to bootloaders, menus etc
    • + All artifacts needed for boot (kernel, initrd, dtb) under same location
    • + FHS agrees: http://www.pathname.com/fhs/pub/fhs-2.3.html#BOOTSTATICFILESOFTHEBOOTLOADER

    • - If /boot is separate partition, constrained by bootloader/firmware, it might not have enough space to carry all device tree files from a generic kernel
      • Suggestion: for platforms where firmware boot partition is size limited, it probably isn't wise to mount as /boot, where general purpose distro might install other non-boot-critical files.
  • /lib
    • + Matches where kernel modules and firmwares are installed
  • /usr/lib
    • + Standard place to throw stuff without FHS locations
    • - /usr might be separate mount, making tricky to locate under recovery etc
  • $(uname -r) in path
    • + In practice the kernel and dtb need to match anyways
    • + We need uname -r in path to allow installing several kernel packages at same time
    • - Conflicts with the "dtb as stable abi" idea
    • - Need to make a link/copy of the "current" dtb file
    • - In future dtb's could gain their own repo separate from the kernel with independent version numbers
      • Should that happen, replace uname -r with the dtb package version number

Platform/DeviceTreeConsolidation (last modified 2014-05-21 13:21:01)