Skip to content

Commit

Permalink
README: add section for custom layer
Browse files Browse the repository at this point in the history
and describe how to setup custom MACHINE and DISTRO
settings for the linter

Signed-off-by: Konrad Weihmann <[email protected]>
  • Loading branch information
priv-kweihmann committed Dec 30, 2023
1 parent b733b30 commit 36e4134
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,34 @@ INSANE_SKIP:${PN} = "foo"
will not warn about the usage of `INSANE_SKIP`.
## Configure your custom machine or distro settings
You can let `oelint-adv` know about your custom `MACHINE` and `DISTRO` overrides, so they won't produce any findings, when
used in your setup.

### Create a layer specific oelint configuration file

Copy over the template this [file](docs/.oelint.cfg.custom-layer) to the root of your layer

```shell
LAYER_PATH=<path to your layer>
cp docs/.oelint.cfg.custom-layer $LAYER_PATH/.oelint.cfg
```

### Create the known MACHINE and DISTRO settings

Source your bitbake build directory and run the following commands (**) (***)

```shell
LAYER_PATH=<path to your layer>
bitbake-getvar --value MACHINEOVERRIDES | tr ':' '\n' | jq -Rn '{replacements:{ machines: [inputs]}}' > $LAYER_PATH/.oelint-custom-machines.json
bitbake-getvar --value DISTROOVERRIDES | tr ':' '\n' | jq -Rn '{replacements:{ distros: [inputs]}}' > $LAYER_PATH/.oelint-custom-distros.json
```

(**) you'll need to have `jq` installed on your local machine.
(***) `bitbake-getvar` command is available since `kirkstone` release. For older release you can use `bitbake core-image-minial -e | grep ^MACHINEOVERRIDES` resp. `bitbake core-image-minial -e | grep ^DISTROOVERRIDES` and pass them into the rest of the pipe.
## vscode extension
Find the extension in the [marketplace](https://marketplace.visualstudio.com/items?itemName=kweihmann.oelint-vscode), or search for `oelint-vscode`.
Expand Down
4 changes: 4 additions & 0 deletions docs/.oelint.cfg.custom-layer
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[oelint]
constantmods=
+.oelint-custom-distros.json
+.oelint-custom-machines.json

0 comments on commit 36e4134

Please sign in to comment.