Commit Graph

17 Commits

Author SHA1 Message Date
Silvan Mosberger
4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00
K900
5567f3ace5 deviceTree.applyOverlays: rewrite in Python/libfdt
Pros:
- code you can actually read
- compatible strings handled properly
- no shelling out to what's essentially test tools

Cons:
- Python
2024-09-15 06:46:01 +03:00
Philip Taron
9a6897925d
deviceTree: remove with statements 2024-08-18 06:31:18 -07:00
Jared Baur
ce80359d9f deviceTree: ensure file symlinks are included in applyOverlays output
When using a custom `hardware.deviceTree.dtbSource`, we cannot assume
that all DTBs in this directory are regular files. This change allows
for file symlinks to be present as well, which fixes the issue where
only file (a symlink) is present in `dtbSource` and the copy fails with
`cp: missing file operand`.
2024-04-24 19:38:39 -07:00
ktrinh
8da771560c nixos/device-tree: Allow custom dtbSource and expose compileDts 2023-09-24 11:58:13 -07:00
Ivan Petkov
bfd1c45e54
nixos/hardware/device-tree: fix application of overlays
Previously whenever an overlay was found to be incompatible with a base
device tree blob, the entire base dtb would be skipped in favor of
processing the next one. This had the unfortunate effect where overlays
would not fully be applied if any incompatibility was found. For
example, this is an issue with build device trees specific for one
flavor of raspberry pi if the overlay was not compatible _everywhere_.

The solution is to forego the `continue` keyword if an overlay is in
compatible and instead use a compound conditional statement to skip
incompatible overlays but continue trying to apply it to any remaining
dtbs.
2022-12-10 20:13:08 -08:00
rnhmjoj
916ca8f2b0
nixos/hardware/device-tree: make overlays more reliable
This make the process of applying overlays more reliable by:

1. Ignoring dtb files that are not really device trees. [^1]

2. Adding a `filter` option (per-overlay, there already is a global one)
   to limit the files to which the overlay applies. This is useful
   in cases where the `compatible` string is ambiguous and multiple
   unrelated files match.

Previously the script would fail in both cases.

[^1]: For example, there is dtbs/overlays/overlay_map.dtb in the
      Raspberry Pi 1 kernel.
2022-08-20 13:34:14 +02:00
Ben Siraphob
259fa13d53 treewide: remove nativeBuildInputs that are in stdenv 2022-04-16 21:46:46 +03:00
Felix Buehler
027d353491 treewide: rename name to pname&version 2022-01-22 18:13:29 +01:00
Ben Siraphob
16d91ee628 pkgs/os-specific: stdenv.lib -> lib 2021-01-17 23:26:08 +07:00
Janne Heß
9a966e84b6
raspberrypifw: 1.20200601 -> 1.20200902
Also disable the fixup phase since it only throws errors and remove the
platforms since these are only static files.
2020-10-07 00:41:15 +02:00
Richard Marko
6c9df40a4b nixos/device-tree: improve overlays support
Now allows applying external overlays either in form of
.dts file, literal dts context added to store or precompiled .dtbo.

If overlays are defined, kernel device-trees are compiled with '-@'
so the .dtb files contain symbols which we can reference in our
overlays.

Since `fdtoverlay` doesn't respect `/ compatible` by itself
we query compatible strings of both `dtb` and `dtbo(verlay)`
and apply only if latter is substring of the former.

Also adds support for filtering .dtb files (as there are now nearly 1k
dtbs).

Co-authored-by: georgewhewell <georgerw@gmail.com>
Co-authored-by: Kai Wohlfahrt <kai.wohlfahrt@gmail.com>
2020-09-09 16:34:58 +02:00
Markus Kowalewski
68ec5811d1
device-tree_rpi: update meta data 2020-06-30 20:58:30 +02:00
Michael Bishop
70308c5c56
device-tree_rpi: fix platforms 2020-04-08 12:54:58 -03:00
Thomas Kerber
cc5baf2d86
Various: Add support for raspberry pi 4. 2019-09-17 04:05:16 +01:00
Kai Wohlfahrt
766e0958b3 device-tree_rpi: fixup dtb names
This is just as messy as it is for the kernel files. Maybe it should be
done in the uboot boot-loader?
2019-08-07 13:51:22 +01:00
Kai Wohlfahrt
28cf80acf8 nixos/hardware.deviceTree: Move things around
In response to comments, create a sub-folder for deviceTree packages
(starting with rpi), and a top-level package for helpers.
2019-08-07 13:51:22 +01:00