From c078ee940a565fd4d28ea4f02d916428484375a6 Mon Sep 17 00:00:00 2001 From: SorinO Date: Mon, 2 Mar 2026 10:37:48 +0200 Subject: [PATCH 1/3] scripts: add license banner check for .md files Signed-off-by: SorinO --- scripts/check_license_banner_md.sh | 53 ++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 scripts/check_license_banner_md.sh diff --git a/scripts/check_license_banner_md.sh b/scripts/check_license_banner_md.sh new file mode 100644 index 00000000..9013739d --- /dev/null +++ b/scripts/check_license_banner_md.sh @@ -0,0 +1,53 @@ +#!/bin/sh +# @copyright Copyright (c) contributors to Project Ocre, +# which has been established as Project Ocre a Series of LF Projects, LLC +# +# SPDX-License-Identifier: Apache-2.0 + +# Checks all .md files for license banner + +set -e + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" +SRC_DIR="$ROOT_DIR/src" + +check_license_banner() { + local file="$1" + local file_header + + file_header=$(head -n 4 "$file") + + # Expected license banner + local expected_banner="" + + if [ "$file_header" != "$expected_banner" ]; then + echo "ERROR: Missing or incorrect license banner in $file" + return 1 + fi + + return 0 +} + +echo "Checking license banners." +ERROR_FOUND=0 +for file in $(find . -type f \( -name '*.md' \) \ + ! -path './tests/Unity/*' \ + ! -path './build/*' \ + ! -path './wasm-micro-runtime/*' \ + ! -path './ocre-sdk/*' \ + ! -path './.github/ISSUE_TEMPLATE*' \ + | sort); do + + if ! check_license_banner "$file"; then + ERROR_FOUND=1 + fi +done + +if [ $ERROR_FOUND -ne 0 ]; then + echo "License check failed." + exit 1 +fi From c111ac1e20e84d36d764f231d13f5ee861151738 Mon Sep 17 00:00:00 2001 From: SorinO Date: Mon, 2 Mar 2026 11:32:29 +0200 Subject: [PATCH 2/3] md_files: add license banners to all .md files Signed-off-by: SorinO --- .github/CODE_OF_CONDUCT.md | 5 +++++ .github/PULL_REQUEST_TEMPLATE.md | 5 +++++ CONTRIBUTING.md | 5 +++++ MAINTAINERS.md | 5 +++++ README.md | 5 +++++ SECURITY.md | 5 +++++ docs/AddZephyrBoard.md | 5 +++++ docs/BuildSystemLinux.md | 5 +++++ docs/BuildSystemZephyr.md | 5 +++++ docs/CreateAndRunCustomContainer.md | 5 +++++ docs/CustomZephyrApplication.md | 5 +++++ docs/Devcontainers.md | 5 +++++ docs/EmbeddingOcre.md | 5 +++++ docs/GetStartedLinux.md | 5 +++++ docs/GetStartedZephyr.md | 5 +++++ docs/NativeBuild.md | 5 +++++ docs/OcreCli.md | 5 +++++ docs/Platform.md | 5 +++++ docs/PlatformPosix.md | 5 +++++ docs/PlatformZephyr.md | 5 +++++ docs/StateInformation.md | 5 +++++ docs/Versioning.md | 5 +++++ docs/boards/zephyr/b_u585i_iot02a.md | 5 +++++ docs/boards/zephyr/native_sim.md | 5 +++++ docs/samples/demo.md | 5 +++++ docs/samples/mini.md | 5 +++++ docs/samples/supervisor.md | 5 +++++ docs/tests/CoverageReports.md | 5 +++++ docs/tests/LeakChecks.md | 5 +++++ docs/tests/SystemTests.md | 5 +++++ tests_hw/README.md | 5 +++++ 31 files changed, 155 insertions(+) diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md index 11b64794..747c4630 100644 --- a/.github/CODE_OF_CONDUCT.md +++ b/.github/CODE_OF_CONDUCT.md @@ -1,3 +1,8 @@ + + # Code of Conduct Ocre is a project of Linux Foundation Edge and applies the [LF Edge Contributor Code of Conduct](https://www.lfedge.org/governance/code-of-conduct/). diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 98f00ebd..34d96616 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,3 +1,8 @@ + + # Description Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 99cfa1f4..3c1cb9b9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,8 @@ + + # Contributing to Ocre The Ocre community shares the spirit of the [Apache Way](https://apache.org/theapacheway/) diff --git a/MAINTAINERS.md b/MAINTAINERS.md index c9cace2b..124a38a2 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -1,3 +1,8 @@ + + # Maintainers This page lists all active maintainers (also known as committers) of the [Ocre Project](https://www.lfedge.org/projects/ocre/), which includes this repository and the [Ocre Project Documentation Repo](https://github.com/project-ocre/project-ocre.github.io). diff --git a/README.md b/README.md index fe5de619..24e956b9 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ + + ![Ocre logo](ocre_logo.jpg "Ocre") # Ocre diff --git a/SECURITY.md b/SECURITY.md index 44f59f54..67d07601 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,3 +1,8 @@ + + # Security Policy ## Reporting a Vulnerability diff --git a/docs/AddZephyrBoard.md b/docs/AddZephyrBoard.md index ce87fca6..03fab6b8 100644 --- a/docs/AddZephyrBoard.md +++ b/docs/AddZephyrBoard.md @@ -1,3 +1,8 @@ + + # Adding support for Zephyr boards This document will guide you through the process of adding support for Zephyr boards to Ocre. diff --git a/docs/BuildSystemLinux.md b/docs/BuildSystemLinux.md index d75b6ffd..208c2b58 100644 --- a/docs/BuildSystemLinux.md +++ b/docs/BuildSystemLinux.md @@ -1,3 +1,8 @@ + + # Ocre Build System for Linux Ocre build system is based on CMake. This provides an easy way of embedding Ocre in diffrerent Linux applications, diff --git a/docs/BuildSystemZephyr.md b/docs/BuildSystemZephyr.md index 3367950c..265c40cb 100644 --- a/docs/BuildSystemZephyr.md +++ b/docs/BuildSystemZephyr.md @@ -1,3 +1,8 @@ + + # Ocre Build System for Zephyr Ocre build system is tightly integrated with Zephyr's build system, allowing developers to leverage the power of Zephyr's build system while also providing a more streamlined and user-friendly experience for developing Ocre itself. diff --git a/docs/CreateAndRunCustomContainer.md b/docs/CreateAndRunCustomContainer.md index 8e4913f3..859bf8a6 100644 --- a/docs/CreateAndRunCustomContainer.md +++ b/docs/CreateAndRunCustomContainer.md @@ -1,3 +1,8 @@ + + # Create and Run Custom Container This guide will walk you through the process of creating and running a custom Ocre container on your board. diff --git a/docs/CustomZephyrApplication.md b/docs/CustomZephyrApplication.md index d4ee12aa..7cbb80c0 100644 --- a/docs/CustomZephyrApplication.md +++ b/docs/CustomZephyrApplication.md @@ -1,3 +1,8 @@ + + ## Adding Ocre Zephyr module to a custom Zephyr application Ocre comes with a few samples to get you going fast: diff --git a/docs/Devcontainers.md b/docs/Devcontainers.md index 33e9df71..f3170904 100644 --- a/docs/Devcontainers.md +++ b/docs/Devcontainers.md @@ -1,3 +1,8 @@ + + # Devcontainers Devcontainers are tools that allows you to create and manage isolated development environments in containers. It provides a consistent and reproducible development environment across different machines and operating systems. diff --git a/docs/EmbeddingOcre.md b/docs/EmbeddingOcre.md index 907000dc..cfeca235 100644 --- a/docs/EmbeddingOcre.md +++ b/docs/EmbeddingOcre.md @@ -1,3 +1,8 @@ + + # Add Ocre Runtime to a custom Linux Application This document will guide you through the process of embedding Ocre Runtime into a custom Linux application. For integrating Ocre Runtime into a Zephyr application, please refer to the [Custom Zephyr Application](CustomZephyrApplication.md) documentation. diff --git a/docs/GetStartedLinux.md b/docs/GetStartedLinux.md index f9c6f477..31ad990d 100644 --- a/docs/GetStartedLinux.md +++ b/docs/GetStartedLinux.md @@ -1,3 +1,8 @@ + + # Get Started with Linux The samples we currently provide for Linux are the following. Check their specific instruction for diff --git a/docs/GetStartedZephyr.md b/docs/GetStartedZephyr.md index 118b6f7f..9f18c4e4 100644 --- a/docs/GetStartedZephyr.md +++ b/docs/GetStartedZephyr.md @@ -1,3 +1,8 @@ + + # Get Started with Zephyr The samples we currently provide for Zephyr are the following. Check their specific instruction for diff --git a/docs/NativeBuild.md b/docs/NativeBuild.md index de66b6a4..2fd69ec7 100644 --- a/docs/NativeBuild.md +++ b/docs/NativeBuild.md @@ -1,3 +1,8 @@ + + # Set up host to build Ocre This document provides instructions on how to build the Ocre Runtime from source without requiring Docker. These instructions also work inside a docker container, however this is provided as a reference for whose who need the development enviroment available in the host. diff --git a/docs/OcreCli.md b/docs/OcreCli.md index 79361aa5..a892b25d 100644 --- a/docs/OcreCli.md +++ b/docs/OcreCli.md @@ -1,3 +1,8 @@ + + # Ocre CLI The ocre command line interface (CLI) is a powerful tool for interacting with the Ocre runtime. It provides a simple and intuitive way to manage and execute images within the Ocre environment. diff --git a/docs/Platform.md b/docs/Platform.md index 35a2c50d..2b7f35e4 100644 --- a/docs/Platform.md +++ b/docs/Platform.md @@ -1,3 +1,8 @@ + + # Ocre Runtime platform requirements Ocre targets a POSIX-like operating system and makes heavy use of the POSIX API. diff --git a/docs/PlatformPosix.md b/docs/PlatformPosix.md index fdd80706..272f33bd 100644 --- a/docs/PlatformPosix.md +++ b/docs/PlatformPosix.md @@ -1,3 +1,8 @@ + + # POSIX Platform In Linux, pthreads are enabled by compiling with `-pthread` and linking with `-lpthread`. This might not be required for other POSIX platforms. The required build flags are automatically selected by the cmake build system. diff --git a/docs/PlatformZephyr.md b/docs/PlatformZephyr.md index 39d84a0c..639cb89e 100644 --- a/docs/PlatformZephyr.md +++ b/docs/PlatformZephyr.md @@ -1,3 +1,8 @@ + + # Zephyr Platform In Zephyr, the POSIX API is selected by the `CONFIG_POSIX_API` configuration option. diff --git a/docs/StateInformation.md b/docs/StateInformation.md index 8a0734b1..86bc437f 100644 --- a/docs/StateInformation.md +++ b/docs/StateInformation.md @@ -1,3 +1,8 @@ + + # State information directory ## Location diff --git a/docs/Versioning.md b/docs/Versioning.md index 1fe06463..7f517962 100644 --- a/docs/Versioning.md +++ b/docs/Versioning.md @@ -1,3 +1,8 @@ + + # Ocre Versioning ## Source components diff --git a/docs/boards/zephyr/b_u585i_iot02a.md b/docs/boards/zephyr/b_u585i_iot02a.md index 2d6460c4..f34bc8ba 100644 --- a/docs/boards/zephyr/b_u585i_iot02a.md +++ b/docs/boards/zephyr/b_u585i_iot02a.md @@ -1,3 +1,8 @@ + + # Zephyr Board: `b_u585i_iot02a` The [Discovery Kit for IoT Node with STM32U5 Series](https://www.st.com/en/evaluation-tools/b-u585i-iot02a.html) is a demonstration and development board featuring the **STM32U585AIUx** MCU. diff --git a/docs/boards/zephyr/native_sim.md b/docs/boards/zephyr/native_sim.md index 9b5d7ef8..3a50f3bd 100644 --- a/docs/boards/zephyr/native_sim.md +++ b/docs/boards/zephyr/native_sim.md @@ -1,3 +1,8 @@ + + # Zephyr Board: `native_sim` The **native_sim** board is a simulated Zephyr target that runs on your host Linux machine. It allows you to develop and test Zephyr applications without needing physical hardware. The native_sim board is particularly useful for rapid iteration, testing, and debugging. diff --git a/docs/samples/demo.md b/docs/samples/demo.md index d3c02698..68074823 100644 --- a/docs/samples/demo.md +++ b/docs/samples/demo.md @@ -1,3 +1,8 @@ + + # demo sample The demo sample will run a few scenarios in a sequential demonstration. diff --git a/docs/samples/mini.md b/docs/samples/mini.md index 9ca5d76f..547c30da 100644 --- a/docs/samples/mini.md +++ b/docs/samples/mini.md @@ -1,3 +1,8 @@ + + # mini sample This sample will create `hello-world.wasm` from the state information directory (`/lfs/ocre/images/hellow-world.wasm` if it does not exist. Then it will execute this container, which prints a nice ASCII art. diff --git a/docs/samples/supervisor.md b/docs/samples/supervisor.md index 1895a0d6..4365e0f2 100644 --- a/docs/samples/supervisor.md +++ b/docs/samples/supervisor.md @@ -1,3 +1,8 @@ + + # Supervisor The Supervisor will run "ocre daemon" in background, being controlled by the ocre-cli command line (shell) tool. It by default will preload the following images, diff --git a/docs/tests/CoverageReports.md b/docs/tests/CoverageReports.md index b1670c3a..5dcd9fc6 100644 --- a/docs/tests/CoverageReports.md +++ b/docs/tests/CoverageReports.md @@ -1,3 +1,8 @@ + + # Source code test coverage reports The source code coverage report generation coverage mapping features provided in clang diff --git a/docs/tests/LeakChecks.md b/docs/tests/LeakChecks.md index e6d00ce2..f1a91c73 100644 --- a/docs/tests/LeakChecks.md +++ b/docs/tests/LeakChecks.md @@ -1,3 +1,8 @@ + + # Memory leak checks The memory leak checks will leverage the address sanitizer features provided in clang diff --git a/docs/tests/SystemTests.md b/docs/tests/SystemTests.md index 9304b2bc..b84665f9 100644 --- a/docs/tests/SystemTests.md +++ b/docs/tests/SystemTests.md @@ -1,3 +1,8 @@ + + # System tests System Tests are tests designed to test the entire system as a black box, diff --git a/tests_hw/README.md b/tests_hw/README.md index 9c9f6da8..9006eaca 100644 --- a/tests_hw/README.md +++ b/tests_hw/README.md @@ -1,3 +1,8 @@ + + ## Overview In the Ocre testing framework, the Ocre execution is comprised of test groups, test suites, and test cases. From 02541ccb90903540dd4d52173a2680ba02c8dd47 Mon Sep 17 00:00:00 2001 From: SorinO Date: Mon, 2 Mar 2026 11:36:07 +0200 Subject: [PATCH 3/3] ci(formmatting-checks): add license banner checker for .md files to the CI Signed-off-by: SorinO --- .github/workflows/formatting-checks.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/formatting-checks.yml b/.github/workflows/formatting-checks.yml index 6e09407f..dd38741d 100644 --- a/.github/workflows/formatting-checks.yml +++ b/.github/workflows/formatting-checks.yml @@ -44,3 +44,6 @@ jobs: - name: License Banner Checks(conf files) run: sh scripts/check_license_banner_conf_files.sh + + - name: License Banner Checks(md files) + run: sh scripts/check_license_banner_md.sh