Skip to content

Raspberry Pi 4: apply-overlays-dtmerge.nix always skips overlays #1529

Open
@Gigahawk

Description

@Gigahawk

When building off master, it seems like none of the overlays I've selected are getting applied:

config:

  hardware.raspberry-pi."4".apply-overlays-dtmerge.enable = true;

  hardware.deviceTree = {
    enable = true;
    filter = "bcm2711-rpi-cm4.dtb";
    overlays = [
      rec {
        name = "dwc2";
        dtboFile = "${config.boot.kernelPackages.kernel}/dtbs/overlays/${name}.dtbo";
      }
      rec {
        name = "tc358743";
        dtboFile = "${config.boot.kernelPackages.kernel}/dtbs/overlays/${name}.dtbo";
      }
      rec {
        name = "i2c1";
        dtboFile = "${config.boot.kernelPackages.kernel}/dtbs/overlays/${name}.dtbo";
      }
    ];
  };

When building I get:

$ nix log /nix/store/rqzzj81h8dmal41yvnvkj2qpyalskdwq-device-tree-overlays
./broadcom -> /nix/store/rqzzj81h8dmal41yvnvkj2qpyalskdwq-device-tree-overlays/./broadcom
'./broadcom/bcm2711-rpi-cm4.dtb' -> '/nix/store/rqzzj81h8dmal41yvnvkj2qpyalskdwq-device-tree-overlays/./broadcom/bcm2711-rpi-cm4.dtb'
Skipping overlay rpi4-cpu-revision: incompatible with bcm2711-rpi-cm4.dtb
Skipping overlay dwc2: incompatible with bcm2711-rpi-cm4.dtb
Skipping overlay tc358743: incompatible with bcm2711-rpi-cm4.dtb
Skipping overlay i2c1: incompatible with bcm2711-rpi-cm4.dtb

However, I've made a branch where the compatibility check is removed and everything seems to work fine.
It seems like the overlays use slightly different compatible strings from the base tree, but are otherwise compatible.

Just wanted to understand what the point of this check was, my understanding was that at runtime incompatible nodes in the device tree just get ignored so it should be fine to always add them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions