summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuciano Dittgen <luciano.dittgen@ossystems.com.br>2026-07-07 14:37:47 -0300
committerLuciano Dittgen <luciano.dittgen@ossystems.com.br>2026-07-07 14:37:47 -0300
commite603bd0c69f0cb4f295824037f8b975db45917cc (patch)
treecdc569230f54c29efbdea6a996e9a9592674ed25
parent1473211584c156a622b3cfd80adb6d823ea7f390 (diff)
downloadmeta-freescale-e603bd0c69f0cb4f295824037f8b975db45917cc.tar.gz
contrib/oelint: Add layer lint wrapper
Add an oelint-adv wrapper, default release setting, and layer-specific constant database so standalone lint runs know the variables and overrides expected by this layer. Tested with: git diff --check. contrib/oelint/run-oelint.sh still exits non-zero because of existing layer findings outside this wrapper. Signed-off-by: Luciano Dittgen <luciano.dittgen@ossystems.com.br>
-rw-r--r--.oelint.cfg9
-rwxr-xr-xcontrib/oelint/run-oelint.sh38
-rw-r--r--oelint.constants.json295
3 files changed, 342 insertions, 0 deletions
diff --git a/.oelint.cfg b/.oelint.cfg
new file mode 100644
index 000000000..fbf1ede14
--- /dev/null
+++ b/.oelint.cfg
@@ -0,0 +1,9 @@
1# oelint-adv defaults for this layer. Auto-loaded when oelint-adv runs with this
2# directory as the working directory (see contrib/oelint/run-oelint.sh).
3#
4# Layer-specific parser hints live in oelint.constants.json and are passed by
5# contrib/oelint/run-oelint.sh. Rule exceptions should stay inline as
6# '# nooelint: <rule.id>' comments next to the finding, so new recipes are fully
7# linted and each exception is documented in place.
8[oelint]
9release = wrynose
diff --git a/contrib/oelint/run-oelint.sh b/contrib/oelint/run-oelint.sh
new file mode 100755
index 000000000..d09f2a45d
--- /dev/null
+++ b/contrib/oelint/run-oelint.sh
@@ -0,0 +1,38 @@
1#!/bin/sh
2# Run oelint-adv over meta-freescale. Requires oelint-adv on PATH.
3#
4# All linter configuration is declarative and lives at the layer root, so this
5# script only has to enumerate the files (oelint-adv does not recurse into
6# directories):
7# * .oelint.cfg - sets '--release'; auto-loaded from the working
8# directory
9# * oelint.constants.json - the layer constant-DB additions, passed via
10# --constantmods for compatibility with oelint-adv
11# versions that do not auto-load layer constants
12#
13# Exceptions should stay inline as '# nooelint: <rule.id>' comments next to the
14# finding, so new recipes are fully linted and each exception is documented in
15# place (and flagged by oelint.file.inlinesuppress_na once stale).
16set -eu
17
18# Neutralise CDPATH so 'cd' below can't print or jump to an unexpected dir.
19unset CDPATH
20
21here=$(cd -- "$(dirname -- "$0")" && pwd)
22layer=$(cd -- "$here/../.." && pwd)
23
24# Run from the layer root so '.oelint.cfg' is probed in the working directory
25# and the relative constants path below is stable.
26cd -- "$layer"
27
28files=$(find . \
29 \( -name '*.bb' -o -name '*.bbappend' -o -name '*.bbclass' -o -name '*.inc' \) \
30 | sort)
31
32# Run serially: oelint-adv's parallel workers race while loading the layer
33# constants, intermittently emitting false "unknown variable/override" findings.
34# Serial execution is deterministic. Pass '--jobs N' to override.
35# Keep files before --constantmods: that option accepts one or more arguments
36# and otherwise consumes the entire generated file list.
37# shellcheck disable=SC2086
38exec oelint-adv --jobs 1 $files --constantmods +oelint.constants.json "$@"
diff --git a/oelint.constants.json b/oelint.constants.json
new file mode 100644
index 000000000..1379f4eff
--- /dev/null
+++ b/oelint.constants.json
@@ -0,0 +1,295 @@
1{
2 "comment": "Layer-specific oelint-adv constant DB. contrib/oelint/run-oelint.sh passes this file via --constantmods so standalone lint runs know about real variables/overrides that normally come from the full bitbake metadata context.",
3 "functions": {
4 "known": [
5 "do_image_uboot_mxsboot_nand",
6 "do_image_uboot_mxsboot_sdcard",
7 "do_image_wic",
8 "module_conf_moal"
9 ]
10 },
11 "variables": {
12 "known": [
13 "ACCEPT_FSL_EULA",
14 "ALSA_INSTALL",
15 "ANNOTATED_NAME",
16 "ANT_DIR",
17 "ARM_EXTRA_SOCARCH",
18 "ARM_INSTRUCTION_SET",
19 "ARM_PIPELINES",
20 "ATF_BOOT_UART_BASE",
21 "ATF_BRANCH",
22 "ATF_MACHINE_NAME",
23 "ATF_PLATFORM",
24 "ATF_SRC",
25 "BACKEND",
26 "BASEDEPENDS",
27 "BEEP_RDEPENDS",
28 "BHOST_PKGCONFIG_PATH",
29 "BL32",
30 "BL33",
31 "BOARDS",
32 "BOARD_TARGETS",
33 "BOARD_TYPE",
34 "BOOTTYPE",
35 "BOOT_CONFIG_MACHINE_EXTRA",
36 "BOOT_MODE",
37 "BOOT_SPACE",
38 "BOOT_STAGING",
39 "BOOT_TOOLS",
40 "BOOT_VARIANT",
41 "BUILD_64BIT_KERNEL",
42 "BUILD_IMPLEMENTATION",
43 "CACHED_DMA_HEAP_CONF",
44 "CACHED_DMA_HEAP_DEVICE_NODE_PATH",
45 "CELLCONF_DIR",
46 "CELL_DIR",
47 "CFG_CORE_ARM64_PA_BITS",
48 "CFG_CORE_LARGE_PHYS_ADDR",
49 "CFG_CORE_PAUTH",
50 "CFG_DDR_SIZE",
51 "CFG_NXP_CAAM",
52 "CFG_TA_BTI",
53 "CFG_TA_PAUTH",
54 "CFG_TEE_CORE_LOG_LEVEL",
55 "CFG_TEE_TA_LOG_LEVEL",
56 "CFG_TZDRAM_START",
57 "COMPILER",
58 "CONFIG_CMD_LICENSE",
59 "CONFIG_CPU_BIG_ENDIAN",
60 "CONFIG_LOCALVERSION",
61 "CONFIG_LOCALVERSION_AUTO",
62 "CONFIG_MTD_CFI_BE_BYTE_SWAP",
63 "CONFIG_MX28",
64 "CONFIG_MXC_GPU_VIV",
65 "CROSS_COMPILE64",
66 "CROSS_COMPILE_HOST",
67 "CROSS_COMPILE_TA",
68 "CRRM_DEPLOY_DEPENDS",
69 "CRRM_FILES",
70 "CRYPTO_AF_ALG_SRC",
71 "CST_DIR",
72 "CTRLSW_HDRPATH",
73 "CVE_STATUS",
74 "DDR_CONFIG",
75 "DDR_TYPE",
76 "DEBIAN_NOAUTONAME",
77 "DEFAULT_FS_SUPPORT",
78 "DEMOS_PATH",
79 "DEPENDS_BACKEND",
80 "DEPENDS_IMXGPU",
81 "DEPENDS_IMX_OPENCL_CONVERTER",
82 "DEPENDS_MX8",
83 "DEPENDS_V4L2",
84 "DEPLOY_FOR",
85 "DEPLOY_OPTEE",
86 "DEPLOY_OPTEE_STMM",
87 "DEST",
88 "DEST_DIR",
89 "DIRPATCHVULKAN",
90 "DISABLE_STATIC",
91 "DPAA_VER",
92 "DPDK_APPS",
93 "DPDK_EXAMPLES",
94 "DPDK_SRC",
95 "DTB",
96 "DTB_BASE_NAME",
97 "DTB_EXT",
98 "DTB_NAME",
99 "DTB_SYMLINK_NAME",
100 "ENDIANNESS_GCC",
101 "ENDIANNESS_LD",
102 "ETHOS_U_FIRMWARE",
103 "ETHOS_U_FIRMWARE_SRC",
104 "ETHOS_U_SRC",
105 "EXTENSIONS",
106 "EXTRA_CONF",
107 "EXTRA_KBUILD_DEFCONFIG",
108 "EXTRA_OEMAKE_PLATFORM",
109 "FEATURE_PACKAGES_extfs",
110 "FEATURE_PACKAGES_f2fs",
111 "FEATURE_PACKAGES_mtd",
112 "FSL_EULA_FILE_MD5SUMS",
113 "GLIBC_64BIT_TIME_FLAGS",
114 "GSTREAMER_GPL",
115 "GST_PLUGIN_SET_HAS_EXAMPLES",
116 "GST_WAYLAND_PACKAGES",
117 "GST_X11_PACKAGES",
118 "KBUILD_DEFCONFIG",
119 "KCONFIG_MODE",
120 "KERNEL_DEVICETREE_32BIT_COMPATIBILITY_UPDATE",
121 "LE_UBOOT_FOR_ARMBE_TARGET",
122 "LICENSE_FLAGS",
123 "MC_FLAVOUR",
124 "MFGTOOL_FILESPATH",
125 "NETWORK_TOOLS",
126 "ODP_BUILD_TYPE",
127 "OEI_CORE",
128 "OEI_DDR_CONFIG",
129 "OEI_SOC",
130 "OPENGL_APIS",
131 "OPENGL_PKGCONFIGS",
132 "OPENGL_PLATFORMS",
133 "OPENGL_WINSYS",
134 "OPTEE_ARCH",
135 "OPTEE_CORE",
136 "OPTEEMACHINE",
137 "PACKAGECONFIG_GL",
138 "PACKAGECONFIG_GRAPHICS",
139 "PACKAGECONFIG_IMXGPU_X11",
140 "PACKAGECONFIG_OPENGL",
141 "PACKAGE_FP_TYPE",
142 "PKG",
143 "PLATFORM_FLAVOR",
144 "QEMU_TARGETS",
145 "QT_CONFIG_FLAGS",
146 "QT_GLFLAGS",
147 "REGLEX_b4420",
148 "SCR",
149 "SECO_FIRMWARE_NAME",
150 "SOC_DEFAULT_IMAGE_FSTYPES",
151 "SOC_TOOLS_GPU_FB",
152 "SOC_TOOLS_GPU_WAYLAND",
153 "SOC_TOOLS_GPU_X11",
154 "SOC_TOOLS_GPU_XWAYLAND",
155 "SRCREV_FORMAT:append",
156 "STAGING_INCDIR_IMX",
157 "TA_DEV_KIT_DIR",
158 "TFA_BUILD_TARGET",
159 "TFA_INSTALL_TARGET",
160 "TFA_PLATFORM",
161 "WRAP_TARGET_PREFIX",
162 "ZIMAGE_BASE_NAME"
163 ]
164 },
165 "replacements": {
166 "distros": [
167 "imx-nxp-bsp",
168 "use-mainline-bsp",
169 "use-nxp-bsp"
170 ],
171 "machines": [
172 "arm",
173 "darwin",
174 "e500mc",
175 "e500v2",
176 "e5500",
177 "e6500",
178 "e6500-64b",
179 "fsl-lsch2",
180 "fsl-lsch3",
181 "genericarm64",
182 "imx-generic-bsp",
183 "imx-mainline-bsp",
184 "imx-nxp-bsp",
185 "imx6qpdlsolox",
186 "imx8dxlb0-fips-lpddr4-evk",
187 "imx95-19x19-lpddr5-frdm-pro",
188 "imx95-a1-19x19-verdin",
189 "imxdpu",
190 "imxdrm",
191 "imxfbdev",
192 "imxgpu",
193 "imxgpu2d",
194 "imxgpu3d",
195 "imxipu",
196 "imxmali",
197 "imxpxp",
198 "imxviv",
199 "imxvpu",
200 "imxvulkan",
201 "ls1012a",
202 "ls102xa",
203 "ls1043a",
204 "ls1046a",
205 "ls1088a",
206 "ls2080a",
207 "ls2088a",
208 "lx2160a",
209 "lx2160ardb-rev2",
210 "lx2162a",
211 "mingw32",
212 "mx5-generic-bsp",
213 "mx5-mainline-bsp",
214 "mx6-generic-bsp",
215 "mx6-mainline-bsp",
216 "mx6-nxp-bsp",
217 "mx6dl-nxp-bsp",
218 "mx6q-nxp-bsp",
219 "mx6sl-nxp-bsp",
220 "mx6sll-nxp-bsp",
221 "mx6sx-nxp-bsp",
222 "mx6ull-generic-bsp",
223 "mx6ull-nxp-bsp",
224 "mx6ul-nxp-bsp",
225 "mx6ulz-generic-bsp",
226 "mx6ulz-nxp-bsp",
227 "mx7-generic-bsp",
228 "mx7-mainline-bsp",
229 "mx7-nxp-bsp",
230 "mx7d-nxp-bsp",
231 "mx7ulp-nxp-bsp",
232 "mx8-generic-bsp",
233 "mx8-mainline-bsp",
234 "mx8-nxp-bsp",
235 "mx8dx-generic-bsp",
236 "mx8dx-nxp-bsp",
237 "mx8dxl-generic-bsp",
238 "mx8dxl-nxp-bsp",
239 "mx8m-generic-bsp",
240 "mx8m-nxp-bsp",
241 "mx8mn-nxp-bsp",
242 "mx8mnul-nxp-bsp",
243 "mx8mm-nxp-bsp",
244 "mx8mp-nxp-bsp",
245 "mx8mpul-nxp-bsp",
246 "mx8mq-evk",
247 "mx8mq-generic-bsp",
248 "mx8mq-nxp-bsp",
249 "mx8qm-generic-bsp",
250 "mx8qm-nxp-bsp",
251 "mx8qxp-generic-bsp",
252 "mx8qxp-nxp-bsp",
253 "mx8ulp-generic-bsp",
254 "mx8ulp-nxp-bsp",
255 "mx8x-generic-bsp",
256 "mx8x-nxp-bsp",
257 "mx9-generic-bsp",
258 "mx9-mainline-bsp",
259 "mx9-nxp-bsp",
260 "mx91-generic-bsp",
261 "mx91-nxp-bsp",
262 "mx93-generic-bsp",
263 "mx93-nxp-bsp",
264 "mx943-generic-bsp",
265 "mx943-nxp-bsp",
266 "mx94-generic-bsp",
267 "mx94-nxp-bsp",
268 "mx95-generic-bsp",
269 "mx95-nxp-bsp",
270 "mx952-nxp-bsp",
271 "mxs-generic-bsp",
272 "p1020",
273 "p2020",
274 "p2041",
275 "p3041",
276 "p4080",
277 "p5040",
278 "qoriq",
279 "qoriq-arm",
280 "qoriq-arm64",
281 "qoriq-generic-bsp",
282 "qoriq-ppc",
283 "t1",
284 "t1023",
285 "t1024",
286 "t1040",
287 "t1042",
288 "t4160",
289 "toolchain-clang",
290 "vf-generic-bsp",
291 "virtclass-multilib-lib32",
292 "virtclass-multilib-lib64"
293 ]
294 }
295}