Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: add oelint-adv based linter for our own recipes #224

Open
wants to merge 32 commits into
base: scarthgap
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
65cc41a
meta-lxatac-software: lxatac-profile: set LG_COORDINATOR not LG_CROSSBAR
hnez Dec 20, 2024
e1bb04a
meta-lxatac-software: container-control: set ...:${PN} not ..._${PN}
hnez Dec 20, 2024
9253ae2
oelint: add linter configuration
hnez Dec 20, 2024
91966cd
CI: add oelint-adv linter rule
hnez Dec 9, 2024
f1e9726
meta-lxatac-{bsp,software}: fix indentation in recipes
hnez Dec 20, 2024
9627468
meta-lxatac-{bsp,software}: fix whitespace in var assign, add and append
hnez Dec 20, 2024
8fb7e89
meta-lxatac-bsp: tf-a-stm32mp_2.9: remove superfluous empty line
hnez Dec 9, 2024
621b4bf
meta-lxatac-{bsp,software}: Sort DEPENDS and RDEPENDS alphabetically
hnez Dec 20, 2024
c3fc800
meta-lxatac-{bsp,software}: Provide better/shorter/any at all SUMMARYs
hnez Dec 20, 2024
696e100
meta-lxatac-{bsp,software}: use SRC_URI:append instead if +=
hnez Dec 20, 2024
be19a66
meta-lxatac-{bsp,software}: Do not override FILES and append instead
hnez Dec 20, 2024
b878102
meta-lxatac-bsp: lxatac-net-switch-hacks: Do not add sysconfdir to FILES
hnez Dec 20, 2024
e29005d
meta-lxatac-bsp: arm-trusted-firmware-a: Do not override variables in…
hnez Dec 20, 2024
4dad2f0
meta-lxatac-bsp: barebox: add oelint exception for require image-uefi…
hnez Dec 20, 2024
ae44f64
meta-lxatac-bsp: barebox: use DEPENDS:append instead of assign in .inc
hnez Dec 20, 2024
d34f86f
meta-lxatac-bsp: barebox: add documentation for the do_copy_fw task
hnez Dec 20, 2024
691c4bc
meta-lxatac-bsp: linux-lxatac: add documentation for the do_copy_fw task
hnez Dec 20, 2024
f4aaf20
meta-lxatac-software: tacd-webinterface: add docs for the do_copy_fw …
hnez Dec 20, 2024
94ce07a
meta-lxatac-bsp: fiptool-native: use inherit_defer native
hnez Dec 20, 2024
83e89c9
meta-lxatac-software: panel-mipi-dbi-native: use inherit_defer native
hnez Dec 20, 2024
c7a07b6
meta-lxatac-bsp: lxatac-net-switch-hacks: depend on util-linux-chrt only
hnez Dec 20, 2024
0bc4ab5
meta-lxatac-bsp: linux-lxatac: disable oelint for false positive
hnez Dec 20, 2024
78e03bb
meta-lxatac-software: github-act-runner: ignore do_compile[network] o…
hnez Dec 20, 2024
3517acd
meta-lxatac-software: gitlab-runner: ignore do_compile[network] oelint
hnez Dec 20, 2024
cf26f81
meta-lxatac-software: classes: panel-mipi-dbi rename to panel_mipi_dbi
hnez Dec 20, 2024
c2caf27
meta-lxatac-software: rkdeveloptool: add upstream status to Makefile …
hnez Dec 20, 2024
f62259d
meta-lxatac-software: bottom: remove require of non-existant files
hnez Dec 20, 2024
357f3b9
meta-lxatac-software: tacd: use require for existing files only
hnez Dec 20, 2024
2077954
meta-lxatac-software: ripgrep: remove require of non-existant files
hnez Dec 20, 2024
c30ee39
meta-lxatac-software: tac-gadget: Do not add bindir to FILES
hnez Dec 20, 2024
f0dcecc
meta-lxatac-{bsp, software}: order variables according to oelint.var.…
hnez Dec 20, 2024
c618afa
meta-lxatac-software: lxatac-core-image-base: add oelint exception
hnez Jan 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: lint

on:
pull_request:
push:
schedule:
- cron: '10 21 * * 4'

jobs:
lint:
name: oelint-adv
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: python3 -m pip install oelint_adv
- run: oelint-adv --mode=all --quiet --color $(find meta-lxatac-bsp/ meta-lxatac-software/ -name "*bb")
22 changes: 22 additions & 0 deletions .oelint-constants.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"functions" : {
"known" : [
"do_genimage"
]
},
"variables" : {
"known" : [
"BAREBOX_IMAGE_DEFAULT",
"BUNDLE_ARGS",
"GENIMAGE_IMAGE_SUFFIX",
"RAUC_BUNDLE_COMPATIBLE",
"RAUC_BUNDLE_FORMAT",
"RAUC_BUNDLE_HOOKS",
"RAUC_BUNDLE_SLOTS",
"RAUC_BUNDLE_VERSION",
"RAUC_SLOT_bootloader",
"RAUC_SLOT_rootfs",
"UMPF_PV"
]
}
}
19 changes: 19 additions & 0 deletions .oelint.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[oelint]
release = scarthgap

suppress =
oelint.file.inappropriatemsg
oelint.file.underscores
oelint.task.noanonpython
oelint.var.badimagefeature.empty-root-password
oelint.var.badimagefeature.tools-debug
oelint.var.bbclassextend
oelint.var.licenseremotefile
oelint.var.mandatoryvar.DESCRIPTION
oelint.var.mandatoryvar.HOMEPAGE
oelint.vars.srcuridomains
oelint.var.suggestedvar.BUGTRACKER
oelint.var.suggestedvar.CVE_PRODUCT
oelint.var.suggestedvar.SECTION

constantmods = +.oelint-constants.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SUMMARY = "ARM Trusted Firmware-A"
DESCRIPTION = " \
SUMMARY ?= "ARM Trusted Firmware-A"
DESCRIPTION = "\
Trusted Firmware-A (TF-A) is a reference implementation of secure world \
software for Arm A-Profile architectures (Armv8-A and Armv7-A), including \
an Exception Level 3 (EL3) Secure Monitor. It provides a suitable starting \
Expand All @@ -9,17 +9,17 @@ DESCRIPTION = " \
HOMEPAGE = "https://developer.trustedfirmware.org/dashboard/view/6/"
SECTION = "bootloaders"

LICENSE = " \
LICENSE = "\
BSD-3-Clause & \
BSD-2-Clause & \
(GPL-2.0-only | GPL-3.0-only | BSD-2-Clause) & \
(NCSA | MIT) & \
Zlib & \
(GPL-2.0-only | GPL-3.0-only | BSD-3-Clause) \
"
LIC_FILES_CHKSUM = "file://docs/license.rst;md5=713afe122abbe07f067f939ca3c480c5"
LIC_FILES_CHKSUM ?= "file://docs/license.rst;md5=713afe122abbe07f067f939ca3c480c5"

DEPENDS = "dtc-native"
DEPENDS += "dtc-native"
PROVIDES = "virtual/ARM-tf-a"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't see how this variable is overridden in the .bb file. Unrelated?


SRC_URI = "git://review.trustedfirmware.org/TF-A/trusted-firmware-a.git;protocol=https;branch=master"
Expand All @@ -29,10 +29,10 @@ B = "${WORKDIR}/build"

inherit deploy

COMPATIBLE_MACHINE = "none"
PLATFORM = "none"
COMPATIBLE_MACHINE ?= "none"
PLATFORM ?= "none"

EXTRA_OEMAKE = " \
EXTRA_OEMAKE = "\
BUILD_BASE=${B} \
CROSS_COMPILE=${TARGET_PREFIX} \
PLAT=${PLATFORM} \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
# umpf-topic: v2.9/customers/lxa/tac
# umpf-hashinfo: e9c0f04902a5616a0af04fc9490edd9f1273ab7c
# umpf-topic-range: d3e71ead6ea5bc3555ac90a446efec84ef6c6122..927790a02af8f782da3c11fc599017767d175de8
SRC_URI += "\
file://patches/0001-fdts-lxa-tac-add-Linux-Automation-GmbH-TAC.patch \
"
SRC_URI:append = " \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't make sense since this file is auto-generated by umpf.

I'm also not fully convinced that ignoring += is the way to go.

An argument in https://github.com/priv-kweihmann/oelint-adv/blob/8096d573cce0c093179957d5b274b895a63bb352/docs/wiki/oelint.vars.srcuriappend.md is the potential issue with SRC_URI ?=, but I can't find any oe-core or meta-oe recipe that actually uses a default assignment here.

priv-kweihmann/oelint-adv#566 also touches this topic.

file://patches/0001-fdts-lxa-tac-add-Linux-Automation-GmbH-TAC.patch \
"
# umpf-release: 2.9/customers/lxa/tac/20240130-2
# umpf-topic-range: 927790a02af8f782da3c11fc599017767d175de8..2c9a028d8673d1b3f8ce99e58ec61c4554b60fda
SRC_URI += "\
file://patches/0101-Release-2.9-customers-lxa-tac-20240130-2.patch \
"
SRC_URI:append = " \
file://patches/0101-Release-2.9-customers-lxa-tac-20240130-2.patch \
"
# umpf-end
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ LIC_FILES_CHKSUM = "file://docs/license.rst;md5=b2c740efedc159745b9b31f88ff03dde

SRCREV = "d3e71ead6ea5bc3555ac90a446efec84ef6c6122"


COMPATIBLE_MACHINE = "lxatac"
PLATFORM = "stm32mp1"

Expand Down
11 changes: 6 additions & 5 deletions meta-lxatac-bsp/recipes-bsp/barebox/barebox-tools_2024.10.0.bb
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@ HOMEPAGE = "https://barebox.org/"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=f5125d13e000b9ca1f0d3364286c4192"

DEPENDS = "libusb1 libusb1-native lzop-native bison-native flex-native pkgconfig-native"
BBCLASSEXTEND = "native"
DEPENDS = "bison-native flex-native libusb1 libusb1-native lzop-native pkgconfig-native"

SRC_URI = "http://barebox.org/download/barebox-${PV}.tar.bz2"
SRC_URI[sha256sum] = "955b20bfa7358732d2c0c09ccfd4c1a69087b7e2c610b16dee7442d71a5af88d"

S = "${WORKDIR}/barebox-${PV}"

EXTRA_OEMAKE = " \
BBCLASSEXTEND = "native"

EXTRA_OEMAKE = "\
ARCH=sandbox \
CROSS_COMPILE=${TARGET_PREFIX} -C ${S} O=${B} \
CROSS_PKG_CONFIG=pkg-config \
"
"

do_compile:class-target () {
export userccflags="${TARGET_CC_ARCH}${TOOLCHAIN_OPTIONS}"
Expand All @@ -32,7 +33,7 @@ do_compile:class-native () {
oe_runmake scripts
}

TOOLS = " \
TOOLS = "\
bareboxenv \
bareboxcrc32 \
kernel-install \
Expand Down
30 changes: 15 additions & 15 deletions meta-lxatac-bsp/recipes-bsp/barebox/barebox.inc
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
SUMMARY = "barebox is a bootloader designed for embedded systems. It runs on a variety of architectures including x86, ARM, MIPS, PowerPC and others."
SUMMARY = "barebox is a bootloader designed for embedded systems."
HOMEPAGE = "https://barebox.org/"
SECTION = "bootloaders"
PROVIDES = "virtual/bootloader"

LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=f5125d13e000b9ca1f0d3364286c4192"

PACKAGE_ARCH = "${MACHINE_ARCH}"

require conf/image-uefi.conf

inherit kernel-arch deploy cml1 pkgconfig

# libusb1 is only required for usb tools like imx-usb-loader. These tools may
# be enabled within the defconfig file so depend on it here to be more user
# friendly (do not abort the build). The actual tools are provided by the
# barebox-tools package.
DEPENDS = "libusb1 bison-native flex-native"

export KBUILD_BUILD_USER ?= "oe-user"
export KBUILD_BUILD_HOST ?= "oe-host"
DEPENDS:append = " bison-native flex-native libusb1"
PROVIDES = "virtual/bootloader"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd find the solution to set DEPENDS before inherit more simple here.
This is how almost all oe-core recipes do it.

(Will be done in a later commit anyway)


SRC_URI = "https://barebox.org/download/barebox-${PV}.tar.bz2"

S = "${WORKDIR}/barebox-${PV}"
B = "${WORKDIR}/build"

PACKAGE_ARCH = "${MACHINE_ARCH}"

# nooelint: oelint.file.requirenotfound
require conf/image-uefi.conf

inherit kernel-arch deploy cml1 pkgconfig

export KBUILD_BUILD_USER ?= "oe-user"
export KBUILD_BUILD_HOST ?= "oe-host"

def get_layer_rev(path):
try:
rev, _ = bb.process.run("git describe --match='' --always --dirty --broken", cwd=path)
Expand All @@ -39,7 +39,7 @@ BAREBOX_BUILDSYSTEM_VERSION ??= "${@get_layer_rev(os.path.dirname(d.getVar('FILE
BAREBOX_FIRMWARE_DIR[doc] = "Overwrite barebox' firmware blobs search directory (CONFIG_EXTRA_FIRMWARE_DIR) with this path, default ${B}/firmware"
BAREBOX_FIRMWARE_DIR ??= "${B}/firmware"

EXTRA_OEMAKE = " \
EXTRA_OEMAKE = "\
CROSS_COMPILE=${TARGET_PREFIX} -C ${S} O=${B} \
BUILDSYSTEM_VERSION=${BAREBOX_BUILDSYSTEM_VERSION} \
CONFIG_EXTRA_FIRMWARE_DIR=${BAREBOX_FIRMWARE_DIR} \
Expand Down Expand Up @@ -123,7 +123,7 @@ do_install () {
done
fi
}
FILES:${PN} = "${BAREBOX_INSTALL_PATH}"
FILES:${PN} += "${BAREBOX_INSTALL_PATH}"

do_deploy () {
if [ -n "${BAREBOX_BINARY}" ]; then
Expand Down
19 changes: 10 additions & 9 deletions meta-lxatac-bsp/recipes-bsp/barebox/barebox_2024.10.0.bb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
# included.
require barebox.inc

SRC_URI += " \
DEPENDS:append = " panel-shineworld-lh133k"

SRC_URI:append = " \
file://defconfig \
file://env \
"
Expand All @@ -20,16 +22,15 @@ COMPATIBLE_MACHINE = "lxatac"
BAREBOX_DTBS_TO_DEPLOY = "arch/arm/dts/*.dtb"

do_deploy:append () {
for DTB in ${BAREBOX_DTBS_TO_DEPLOY}; do
if [ -e ${DTB} ]; then
BAREBOX_DTB_BASENAME=barebox-$(basename ${DTB} .dtb)${BAREBOX_IMAGE_SUFFIX}
install -m 644 -T ${DTB} ${DEPLOYDIR}/${BAREBOX_DTB_BASENAME}.dtb
fi
done
for DTB in ${BAREBOX_DTBS_TO_DEPLOY}; do
if [ -e ${DTB} ]; then
BAREBOX_DTB_BASENAME=barebox-$(basename ${DTB} .dtb)${BAREBOX_IMAGE_SUFFIX}
install -m 644 -T ${DTB} ${DEPLOYDIR}/${BAREBOX_DTB_BASENAME}.dtb
fi
done
}

DEPENDS:append = " panel-shineworld-lh133k"

do_copy_fw[doc] = "Copy the LCD display firmware to the barebox env"
do_copy_fw() {
mkdir -p ${WORKDIR}/env/firmware/
cp ${RECIPE_SYSROOT}${nonarch_base_libdir}/firmware/shineworld,lh133k.bin ${WORKDIR}/env/firmware/
Expand Down
42 changes: 21 additions & 21 deletions meta-lxatac-bsp/recipes-bsp/barebox/files/patches/series.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,32 @@
# umpf-topic: v2024.10.0/topic/tlv
# umpf-hashinfo: 6d130e9537b785ad42b8bfb6d0d9c91fd70a3eea
# umpf-topic-range: 1f31cde526d4e251da6464cac42ee2252643b972..3b1c5b6c26759c488ca8aa83e9145972d229eea7
SRC_URI += "\
file://patches/0001-scripts-implement-slurp-a-read_file-with-fd-as-argum.patch \
file://patches/0002-of_path-support-phandles-in-of_find_path.patch \
file://patches/0003-Makefile-add-common-boards-include-to-include-search.patch \
file://patches/0004-net-add-ethaddr-sequence-handling.patch \
file://patches/0005-common-add-optional-systemd.hostname-generation.patch \
file://patches/0006-net-factor-out-eth_of_get_fixup_node.patch \
file://patches/0007-net-export-list-of-registered-ethernet-addresses.patch \
file://patches/0008-net-implement-ethaddr_string_cmp.patch \
file://patches/0009-common-add-barebox-TLV-support.patch \
file://patches/0010-commands-add-TLV-debugging-command.patch \
file://patches/0011-scripts-add-bareboxtlv-host-target-tool.patch \
"
SRC_URI:append = " \
file://patches/0001-scripts-implement-slurp-a-read_file-with-fd-as-argum.patch \
file://patches/0002-of_path-support-phandles-in-of_find_path.patch \
file://patches/0003-Makefile-add-common-boards-include-to-include-search.patch \
file://patches/0004-net-add-ethaddr-sequence-handling.patch \
file://patches/0005-common-add-optional-systemd.hostname-generation.patch \
file://patches/0006-net-factor-out-eth_of_get_fixup_node.patch \
file://patches/0007-net-export-list-of-registered-ethernet-addresses.patch \
file://patches/0008-net-implement-ethaddr_string_cmp.patch \
file://patches/0009-common-add-barebox-TLV-support.patch \
file://patches/0010-commands-add-TLV-debugging-command.patch \
file://patches/0011-scripts-add-bareboxtlv-host-target-tool.patch \
"
# umpf-topic: v2024.10.0/customers/lxa/tac
# umpf-hashinfo: 1413c76bc3233a8732a51c3010d6a8433e2b7e3a
# umpf-topic-range: 3b1c5b6c26759c488ca8aa83e9145972d229eea7..df227f29447718518a7bb92954fc4f74aa58d77f
SRC_URI += "\
file://patches/0101-boards-add-decoder-for-LXA-TLV-v1-format.patch \
file://patches/0102-ARM-dts-stm32-lxa-tac-fix-gen-1-2-boards-and-add-gen.patch \
file://patches/0103-ARM-stm32mp-add-Linux-Automation-TAC-board.patch \
"
SRC_URI:append = " \
file://patches/0101-boards-add-decoder-for-LXA-TLV-v1-format.patch \
file://patches/0102-ARM-dts-stm32-lxa-tac-fix-gen-1-2-boards-and-add-gen.patch \
file://patches/0103-ARM-stm32mp-add-Linux-Automation-TAC-board.patch \
"
# umpf-release: 2024.10.0/customers/lxa/tac/20241121-2
# umpf-topic-range: df227f29447718518a7bb92954fc4f74aa58d77f..be16d68f8fa1f5197557d48c1f0b9f50cc342895
SRC_URI += "\
file://patches/0201-Release-2024.10.0-customers-lxa-tac-20241121-2.patch \
"
SRC_URI:append = " \
file://patches/0201-Release-2024.10.0-customers-lxa-tac-20241121-2.patch \
"
UMPF_BASE = "2024.10.0"
UMPF_VERSION = "20241121-2"
UMPF_PV = "${UMPF_BASE}-${UMPF_VERSION}"
Expand Down
2 changes: 1 addition & 1 deletion meta-lxatac-bsp/recipes-core/images/emmc-boot-image.bb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda

DEPENDS += "fiptool-native"

SRC_URI += "file://genimage.config"
SRC_URI:append = " file://genimage.config"

inherit genimage

Expand Down
2 changes: 1 addition & 1 deletion meta-lxatac-bsp/recipes-core/images/emmc-image.bb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda

DEPENDS += "e2fsprogs-native"

SRC_URI += "file://genimage.config"
SRC_URI:append = " file://genimage.config"

inherit genimage

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
SUMMARY = "Read out and distribute factory data from the devicetree"

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SUMMARY = "Read out and distribute factory data from the devicetree"

inherit allarch systemd

RDEPENDS:${PN} = "bash"

SYSTEMD_SERVICE:${PN} = "lxatac-factory-data.service"

SRC_URI += " \
SRC_URI:append = " \
file://lxatac-factory-data.service \
file://lxatac-factory-data.sh \
"

RDEPENDS:${PN} = "bash"

do_install() {
install -m 0644 -D ${WORKDIR}/lxatac-factory-data.service ${D}${systemd_system_unitdir}/lxatac-factory-data.service
install -m 0755 -D ${WORKDIR}/lxatac-factory-data.sh ${D}${sbindir}/lxatac-factory-data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ SUMMARY = "Set up LXA TAC LEDs with triggers that need sysfs interaction"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI += " \
SRC_URI:append = " \
file://lxatac-led-setup.service \
file://lxatac-led-setup.sh \
"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
SUMMARY = "Configure the lldpd daemon on the switch interface"

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

inherit allarch

SRC_URI = " \
SRC_URI = "\
file://01-switch.conf \
"

do_install() {
install -D -m0644 ${WORKDIR}/01-switch.conf ${D}${sysconfdir}/lldpd.d/01-switch.conf
}

FILES:${PN} = "${sysconfdir}/lldpd.d/"
FILES:${PN} += "${sysconfdir}/lldpd.d/"
Loading
Loading