DTOVERLAY(1)

πŸ“¦
version 0-unstable-2024-12 Β· 2 versions
, in nixos 26.05, nixpkgs unstable

πŸ’… NAME πŸ’…

okay bestie, this is DTOVERLAY(1), a General Commands Manual page, and the main character is dtoverlay β€” load a device-tree overlay. That’s the whole NAME situation, and honestly? iconic. πŸŽ€


✨ SYNOPSIS ✨

dtoverlay [-d dir] [-p string] [-v] [-D] [-r] [-R] [-l] [-a] [overlay
          [param=val...]]

dtoverlay -h [overlay [param]]

πŸ¦‹ DESCRIPTION πŸ¦‹

dtoverlay is the command-line utility for manipulating the system’s runtime device-tree by adding or removing overlays. It can also customize the base device-tree or overlays by setting parameters within them. See [DTREE] for more information.

By default β€” like, without the -r or -R options β€” the application adds the specified overlay. Manipulation of active device-tree overlays usually requires root privileges.

⚠️ bestie, root privileges are usually required for manipulating active device-tree overlays. That’s not a vibe check, that’s just the rules. πŸ’…

πŸŽ€ OPTIONS πŸŽ€

  • -a β€” Lists all defined device-tree overlays, placing a "*" next to those that are currently loaded. It’s giving overlay attendance sheet. βœ…
  • -d dir β€” Specifies an alternate location path from which to load overlays. The utility defaults to "/boot/overlays" or "/flash/overlays". So if your overlays live somewhere else, this is your moment. πŸ“
  • -D β€” Dry-run; prepares the specified overlay but doesn’t apply it. The resulting prepared overlay is saved as "dry-run.dtbo". Literally a practice run, no cap. πŸ§ͺ
  • -h[overlay][param] β€” If given without overlay or param, displays help on the application overall. If overlay is specified, prints help on that overlay. Finally, if param is also specified, prints help on that parameter of the overlay. To query parameters on the base overlay, specify "dtparam" as the overlay. Help is self-care. 🫢
  • -l β€” Lists all currently loaded device-tree overlays, in the order they were loaded. This also specifies the index of each overlay. Load-order receipts, served fresh. 🧾
  • -p string β€” Overrides the platform’s "compatible" string, normally read from "/proc/device-tree/compatible". This is used with the overlay map to determine which platform-specific overlay to read (if necessary). Very β€œiykyk” of it. πŸ”
  • -r β€” Remove overlay. With this option, the utility will remove the specified overlay. If no overlay is given, the last overlay loaded will be removed. Overlays can be specified by name or by index. Bye-bye, bestie. πŸ‘‹
  • -R β€” Remove the specified overlay, and all subsequent overlays that were loaded after it. If no overlay is given, all overlays will be removed. Overlays can be specified by name or by index. This one is highkey the load-order nuke. πŸ’€
  • -v β€” Verbose operation; the utility will produce more output. More yapping, but make it useful. πŸ—£οΈ

🌸 EXAMPLES 🌸

here’s the tea, with the commands kept exactly as they are:

sudo dtoverlay w1-gpio

Load the w1-gpio overlay (to enable Dallas 1-Wire on GPIO4). Note that root privileges are usually required for manipulating the device-tree overlays (hence, sudo in the example).

dtoverlay -l

Show the loaded overlays.

sudo dtoverlay -r

Remove the last loaded overlay.

sudo dtoverlay gpio-shutdown gpio_pin=7 active_low=0 gpio_pull=down

Load the gpio-shutdown overlay specifying that it should pull GPIO7 down and monitor it for a rising edge to initiate shutdown.

dtoverlay -h gpio-shutdown

Display help for the gpio-shutdown overlay

sudo dtoverlay -r gpio-shutdown

Remove the gpio-shutdown overlay, wherever it is in the load order.

🧚 HOOKS 🧚

dtoverlay attempts to call two executables (shell scripts by default) during its operation: dtoverlay-pre prior to making device-tree modifications, and dtoverlay-post afterwards. Each executable is optional and will be ignored if not present. So if they’re there, they get their little moment; if not, no drama. πŸ¦‹

πŸ‘‘ SEE ALSO πŸ‘‘

🌈 REFERENCES 🌈


That’s the whole DTOVERLAY(1) page, bestie 🫢 β€” the footer is just DTOVERLAY(1), with no extra source/version/date line hiding down there, so you’re fully caught up. Periodt. πŸ’…

πŸ“¦ where this page comes from