From e603bd0c69f0cb4f295824037f8b975db45917cc Mon Sep 17 00:00:00 2001 From: Luciano Dittgen Date: Tue, 7 Jul 2026 14:37:47 -0300 Subject: 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 --- .oelint.cfg | 9 ++ contrib/oelint/run-oelint.sh | 38 ++++++ oelint.constants.json | 295 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 342 insertions(+) create mode 100644 .oelint.cfg create mode 100755 contrib/oelint/run-oelint.sh create mode 100644 oelint.constants.json diff --git a/.oelint.cfg b/.oelint.cfg new file mode 100644 index 000000000..fbf1ede14 --- /dev/null +++ b/.oelint.cfg @@ -0,0 +1,9 @@ +# oelint-adv defaults for this layer. Auto-loaded when oelint-adv runs with this +# directory as the working directory (see contrib/oelint/run-oelint.sh). +# +# Layer-specific parser hints live in oelint.constants.json and are passed by +# contrib/oelint/run-oelint.sh. Rule exceptions should stay inline as +# '# nooelint: ' comments next to the finding, so new recipes are fully +# linted and each exception is documented in place. +[oelint] +release = 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 @@ +#!/bin/sh +# Run oelint-adv over meta-freescale. Requires oelint-adv on PATH. +# +# All linter configuration is declarative and lives at the layer root, so this +# script only has to enumerate the files (oelint-adv does not recurse into +# directories): +# * .oelint.cfg - sets '--release'; auto-loaded from the working +# directory +# * oelint.constants.json - the layer constant-DB additions, passed via +# --constantmods for compatibility with oelint-adv +# versions that do not auto-load layer constants +# +# Exceptions should stay inline as '# nooelint: ' comments next to the +# finding, so new recipes are fully linted and each exception is documented in +# place (and flagged by oelint.file.inlinesuppress_na once stale). +set -eu + +# Neutralise CDPATH so 'cd' below can't print or jump to an unexpected dir. +unset CDPATH + +here=$(cd -- "$(dirname -- "$0")" && pwd) +layer=$(cd -- "$here/../.." && pwd) + +# Run from the layer root so '.oelint.cfg' is probed in the working directory +# and the relative constants path below is stable. +cd -- "$layer" + +files=$(find . \ + \( -name '*.bb' -o -name '*.bbappend' -o -name '*.bbclass' -o -name '*.inc' \) \ + | sort) + +# Run serially: oelint-adv's parallel workers race while loading the layer +# constants, intermittently emitting false "unknown variable/override" findings. +# Serial execution is deterministic. Pass '--jobs N' to override. +# Keep files before --constantmods: that option accepts one or more arguments +# and otherwise consumes the entire generated file list. +# shellcheck disable=SC2086 +exec 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 @@ +{ + "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.", + "functions": { + "known": [ + "do_image_uboot_mxsboot_nand", + "do_image_uboot_mxsboot_sdcard", + "do_image_wic", + "module_conf_moal" + ] + }, + "variables": { + "known": [ + "ACCEPT_FSL_EULA", + "ALSA_INSTALL", + "ANNOTATED_NAME", + "ANT_DIR", + "ARM_EXTRA_SOCARCH", + "ARM_INSTRUCTION_SET", + "ARM_PIPELINES", + "ATF_BOOT_UART_BASE", + "ATF_BRANCH", + "ATF_MACHINE_NAME", + "ATF_PLATFORM", + "ATF_SRC", + "BACKEND", + "BASEDEPENDS", + "BEEP_RDEPENDS", + "BHOST_PKGCONFIG_PATH", + "BL32", + "BL33", + "BOARDS", + "BOARD_TARGETS", + "BOARD_TYPE", + "BOOTTYPE", + "BOOT_CONFIG_MACHINE_EXTRA", + "BOOT_MODE", + "BOOT_SPACE", + "BOOT_STAGING", + "BOOT_TOOLS", + "BOOT_VARIANT", + "BUILD_64BIT_KERNEL", + "BUILD_IMPLEMENTATION", + "CACHED_DMA_HEAP_CONF", + "CACHED_DMA_HEAP_DEVICE_NODE_PATH", + "CELLCONF_DIR", + "CELL_DIR", + "CFG_CORE_ARM64_PA_BITS", + "CFG_CORE_LARGE_PHYS_ADDR", + "CFG_CORE_PAUTH", + "CFG_DDR_SIZE", + "CFG_NXP_CAAM", + "CFG_TA_BTI", + "CFG_TA_PAUTH", + "CFG_TEE_CORE_LOG_LEVEL", + "CFG_TEE_TA_LOG_LEVEL", + "CFG_TZDRAM_START", + "COMPILER", + "CONFIG_CMD_LICENSE", + "CONFIG_CPU_BIG_ENDIAN", + "CONFIG_LOCALVERSION", + "CONFIG_LOCALVERSION_AUTO", + "CONFIG_MTD_CFI_BE_BYTE_SWAP", + "CONFIG_MX28", + "CONFIG_MXC_GPU_VIV", + "CROSS_COMPILE64", + "CROSS_COMPILE_HOST", + "CROSS_COMPILE_TA", + "CRRM_DEPLOY_DEPENDS", + "CRRM_FILES", + "CRYPTO_AF_ALG_SRC", + "CST_DIR", + "CTRLSW_HDRPATH", + "CVE_STATUS", + "DDR_CONFIG", + "DDR_TYPE", + "DEBIAN_NOAUTONAME", + "DEFAULT_FS_SUPPORT", + "DEMOS_PATH", + "DEPENDS_BACKEND", + "DEPENDS_IMXGPU", + "DEPENDS_IMX_OPENCL_CONVERTER", + "DEPENDS_MX8", + "DEPENDS_V4L2", + "DEPLOY_FOR", + "DEPLOY_OPTEE", + "DEPLOY_OPTEE_STMM", + "DEST", + "DEST_DIR", + "DIRPATCHVULKAN", + "DISABLE_STATIC", + "DPAA_VER", + "DPDK_APPS", + "DPDK_EXAMPLES", + "DPDK_SRC", + "DTB", + "DTB_BASE_NAME", + "DTB_EXT", + "DTB_NAME", + "DTB_SYMLINK_NAME", + "ENDIANNESS_GCC", + "ENDIANNESS_LD", + "ETHOS_U_FIRMWARE", + "ETHOS_U_FIRMWARE_SRC", + "ETHOS_U_SRC", + "EXTENSIONS", + "EXTRA_CONF", + "EXTRA_KBUILD_DEFCONFIG", + "EXTRA_OEMAKE_PLATFORM", + "FEATURE_PACKAGES_extfs", + "FEATURE_PACKAGES_f2fs", + "FEATURE_PACKAGES_mtd", + "FSL_EULA_FILE_MD5SUMS", + "GLIBC_64BIT_TIME_FLAGS", + "GSTREAMER_GPL", + "GST_PLUGIN_SET_HAS_EXAMPLES", + "GST_WAYLAND_PACKAGES", + "GST_X11_PACKAGES", + "KBUILD_DEFCONFIG", + "KCONFIG_MODE", + "KERNEL_DEVICETREE_32BIT_COMPATIBILITY_UPDATE", + "LE_UBOOT_FOR_ARMBE_TARGET", + "LICENSE_FLAGS", + "MC_FLAVOUR", + "MFGTOOL_FILESPATH", + "NETWORK_TOOLS", + "ODP_BUILD_TYPE", + "OEI_CORE", + "OEI_DDR_CONFIG", + "OEI_SOC", + "OPENGL_APIS", + "OPENGL_PKGCONFIGS", + "OPENGL_PLATFORMS", + "OPENGL_WINSYS", + "OPTEE_ARCH", + "OPTEE_CORE", + "OPTEEMACHINE", + "PACKAGECONFIG_GL", + "PACKAGECONFIG_GRAPHICS", + "PACKAGECONFIG_IMXGPU_X11", + "PACKAGECONFIG_OPENGL", + "PACKAGE_FP_TYPE", + "PKG", + "PLATFORM_FLAVOR", + "QEMU_TARGETS", + "QT_CONFIG_FLAGS", + "QT_GLFLAGS", + "REGLEX_b4420", + "SCR", + "SECO_FIRMWARE_NAME", + "SOC_DEFAULT_IMAGE_FSTYPES", + "SOC_TOOLS_GPU_FB", + "SOC_TOOLS_GPU_WAYLAND", + "SOC_TOOLS_GPU_X11", + "SOC_TOOLS_GPU_XWAYLAND", + "SRCREV_FORMAT:append", + "STAGING_INCDIR_IMX", + "TA_DEV_KIT_DIR", + "TFA_BUILD_TARGET", + "TFA_INSTALL_TARGET", + "TFA_PLATFORM", + "WRAP_TARGET_PREFIX", + "ZIMAGE_BASE_NAME" + ] + }, + "replacements": { + "distros": [ + "imx-nxp-bsp", + "use-mainline-bsp", + "use-nxp-bsp" + ], + "machines": [ + "arm", + "darwin", + "e500mc", + "e500v2", + "e5500", + "e6500", + "e6500-64b", + "fsl-lsch2", + "fsl-lsch3", + "genericarm64", + "imx-generic-bsp", + "imx-mainline-bsp", + "imx-nxp-bsp", + "imx6qpdlsolox", + "imx8dxlb0-fips-lpddr4-evk", + "imx95-19x19-lpddr5-frdm-pro", + "imx95-a1-19x19-verdin", + "imxdpu", + "imxdrm", + "imxfbdev", + "imxgpu", + "imxgpu2d", + "imxgpu3d", + "imxipu", + "imxmali", + "imxpxp", + "imxviv", + "imxvpu", + "imxvulkan", + "ls1012a", + "ls102xa", + "ls1043a", + "ls1046a", + "ls1088a", + "ls2080a", + "ls2088a", + "lx2160a", + "lx2160ardb-rev2", + "lx2162a", + "mingw32", + "mx5-generic-bsp", + "mx5-mainline-bsp", + "mx6-generic-bsp", + "mx6-mainline-bsp", + "mx6-nxp-bsp", + "mx6dl-nxp-bsp", + "mx6q-nxp-bsp", + "mx6sl-nxp-bsp", + "mx6sll-nxp-bsp", + "mx6sx-nxp-bsp", + "mx6ull-generic-bsp", + "mx6ull-nxp-bsp", + "mx6ul-nxp-bsp", + "mx6ulz-generic-bsp", + "mx6ulz-nxp-bsp", + "mx7-generic-bsp", + "mx7-mainline-bsp", + "mx7-nxp-bsp", + "mx7d-nxp-bsp", + "mx7ulp-nxp-bsp", + "mx8-generic-bsp", + "mx8-mainline-bsp", + "mx8-nxp-bsp", + "mx8dx-generic-bsp", + "mx8dx-nxp-bsp", + "mx8dxl-generic-bsp", + "mx8dxl-nxp-bsp", + "mx8m-generic-bsp", + "mx8m-nxp-bsp", + "mx8mn-nxp-bsp", + "mx8mnul-nxp-bsp", + "mx8mm-nxp-bsp", + "mx8mp-nxp-bsp", + "mx8mpul-nxp-bsp", + "mx8mq-evk", + "mx8mq-generic-bsp", + "mx8mq-nxp-bsp", + "mx8qm-generic-bsp", + "mx8qm-nxp-bsp", + "mx8qxp-generic-bsp", + "mx8qxp-nxp-bsp", + "mx8ulp-generic-bsp", + "mx8ulp-nxp-bsp", + "mx8x-generic-bsp", + "mx8x-nxp-bsp", + "mx9-generic-bsp", + "mx9-mainline-bsp", + "mx9-nxp-bsp", + "mx91-generic-bsp", + "mx91-nxp-bsp", + "mx93-generic-bsp", + "mx93-nxp-bsp", + "mx943-generic-bsp", + "mx943-nxp-bsp", + "mx94-generic-bsp", + "mx94-nxp-bsp", + "mx95-generic-bsp", + "mx95-nxp-bsp", + "mx952-nxp-bsp", + "mxs-generic-bsp", + "p1020", + "p2020", + "p2041", + "p3041", + "p4080", + "p5040", + "qoriq", + "qoriq-arm", + "qoriq-arm64", + "qoriq-generic-bsp", + "qoriq-ppc", + "t1", + "t1023", + "t1024", + "t1040", + "t1042", + "t4160", + "toolchain-clang", + "vf-generic-bsp", + "virtclass-multilib-lib32", + "virtclass-multilib-lib64" + ] + } +} -- cgit v1.2.3-54-g00ecf