Signed-off-by: 吴文峰 <kevin@lmve.net>
This commit is contained in:
@@ -1,52 +0,0 @@
|
|||||||
# This container is used to build Meshtastic with the libraries required by the fuzzer.
|
|
||||||
# ClusterFuzzLite starts the container, runs the build.sh script, and then exits.
|
|
||||||
|
|
||||||
# As this is not a long running service, health-checks are not required. ClusterFuzzLite
|
|
||||||
# also only works if the user remains unchanged from the base image (it expects to run
|
|
||||||
# as root).
|
|
||||||
# trunk-ignore-all(trivy/DS026): No healthcheck is needed for this builder container
|
|
||||||
# trunk-ignore-all(checkov/CKV_DOCKER_2): No healthcheck is needed for this builder container
|
|
||||||
# trunk-ignore-all(checkov/CKV_DOCKER_3): We must run as root for this container
|
|
||||||
# trunk-ignore-all(trivy/DS002): We must run as root for this container
|
|
||||||
# trunk-ignore-all(checkov/CKV_DOCKER_8): We must run as root for this container
|
|
||||||
# trunk-ignore-all(hadolint/DL3002): We must run as root for this container
|
|
||||||
|
|
||||||
FROM gcr.io/oss-fuzz-base/base-builder:v1
|
|
||||||
|
|
||||||
ENV PIP_ROOT_USER_ACTION=ignore
|
|
||||||
|
|
||||||
# trunk-ignore(hadolint/DL3008): apt packages are not pinned.
|
|
||||||
# trunk-ignore(terrascan/AC_DOCKER_0002): apt packages are not pinned.
|
|
||||||
RUN apt-get update && apt-get install --no-install-recommends -y \
|
|
||||||
cmake git zip libgpiod-dev libbluetooth-dev libi2c-dev \
|
|
||||||
libunistring-dev libmicrohttpd-dev libgnutls28-dev libgcrypt20-dev \
|
|
||||||
libusb-1.0-0-dev libssl-dev pkg-config && \
|
|
||||||
apt-get clean && rm -rf /var/lib/apt/lists/* && \
|
|
||||||
pip install --no-cache-dir -U \
|
|
||||||
platformio==6.1.16 \
|
|
||||||
grpcio-tools==1.68.1 \
|
|
||||||
meshtastic==2.5.9
|
|
||||||
|
|
||||||
# Ugly hack to avoid clang detecting a conflict between the math "log" function and the "log" function in framework-portduino/cores/portduino/logging.h
|
|
||||||
RUN sed -i -e 's/__MATHCALL_VEC (log,, (_Mdouble_ __x));//' /usr/include/x86_64-linux-gnu/bits/mathcalls.h
|
|
||||||
|
|
||||||
# A few dependencies are too old on the base-builder image. More recent versions are built from source.
|
|
||||||
WORKDIR $SRC
|
|
||||||
RUN git config --global advice.detachedHead false && \
|
|
||||||
git clone --depth 1 --branch 0.8.0 https://github.com/jbeder/yaml-cpp.git && \
|
|
||||||
git clone --depth 1 --branch v2.3.3 https://github.com/babelouest/orcania.git && \
|
|
||||||
git clone --depth 1 --branch v1.4.20 https://github.com/babelouest/yder.git && \
|
|
||||||
git clone --depth 1 --branch v2.7.15 https://github.com/babelouest/ulfius.git
|
|
||||||
|
|
||||||
COPY ./.clusterfuzzlite/build.sh $SRC/
|
|
||||||
|
|
||||||
WORKDIR $SRC/firmware
|
|
||||||
COPY . $SRC/firmware/
|
|
||||||
|
|
||||||
# https://docs.platformio.org/en/latest/envvars.html
|
|
||||||
ENV PLATFORMIO_CORE_DIR=$SRC/pio/core \
|
|
||||||
PLATFORMIO_LIBDEPS_DIR=$SRC/pio/libdeps \
|
|
||||||
PLATFORMIO_PACKAGES_DIR=$SRC/pio/packages \
|
|
||||||
PLATFORMIO_SETTING_ENABLE_CACHE=No \
|
|
||||||
PIO_ENV=buildroot
|
|
||||||
RUN platformio pkg install --environment $PIO_ENV
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
# ClusterFuzzLite for Meshtastic
|
|
||||||
|
|
||||||
This directory contains the fuzzer implementation for Meshtastic using the ClusterFuzzLite framework.
|
|
||||||
See the [ClusterFuzzLite documentation](https://google.github.io/clusterfuzzlite/) for more details.
|
|
||||||
|
|
||||||
## Running locally
|
|
||||||
|
|
||||||
ClusterFuzzLite uses the OSS-Fuzz toolchain. To build the fuzzer manually, first grab a copy of OSS-Fuzz.
|
|
||||||
|
|
||||||
```shell
|
|
||||||
git clone https://github.com/google/oss-fuzz.git
|
|
||||||
cd oss-fuzz
|
|
||||||
```
|
|
||||||
|
|
||||||
To build the fuzzer, run:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
python3 infra/helper.py build_image --external $PATH_TO_MESHTASTIC_FIRMWARE_DIRECTORY
|
|
||||||
python3 infra/helper.py build_fuzzers --external $PATH_TO_MESHTASTIC_FIRMWARE_DIRECTORY --sanitizer address
|
|
||||||
```
|
|
||||||
|
|
||||||
To run the fuzzer, run:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
python3 infra/helper.py run_fuzzer --external --corpus-dir=<path-to-temp-corpus-dir> $PATH_TO_MESHTASTIC_FIRMWARE_DIRECTORY router_fuzzer
|
|
||||||
```
|
|
||||||
|
|
||||||
More background on these commands can be found in the
|
|
||||||
[ClusterFuzzLite documentation](https://google.github.io/clusterfuzzlite/build-integration/#testing-locally).
|
|
||||||
|
|
||||||
## router_fuzzer.cpp
|
|
||||||
|
|
||||||
This fuzzer submits MeshPacket protos to the `Router::enqueueReceivedMessage` method. It takes the binary
|
|
||||||
data from the fuzzer and decodes that data to a MeshPacket using nanopb. A few fields in
|
|
||||||
the MeshPacket are modified by the fuzzer.
|
|
||||||
|
|
||||||
- If the `to` field is 0, it will be replaced with the NodeID of the running node.
|
|
||||||
- If the `from` field is 0, it will be replaced with the NodeID of the running node.
|
|
||||||
- If the `id` field is 0, it will be replaced with an incrementing counter value.
|
|
||||||
- If the `pki_encrypted` field is true, the `public_key` field will be populated with the first admin key.
|
|
||||||
|
|
||||||
The `router_fuzzer_seed_corpus.py` file contains a list of MeshPackets. It is run from inside build.sh and
|
|
||||||
writes the binary MeshPacket protos to files. These files are use used by the fuzzer as its initial seed data,
|
|
||||||
helping the fuzzer to start off with a few known inputs.
|
|
||||||
|
|
||||||
### Interpreting a fuzzer crash
|
|
||||||
|
|
||||||
If the fuzzer crashes, it'll write the input bytes used for the test case to a file and notify about the
|
|
||||||
location of that file. The contents of the file are a binary serialized MeshPacket protobuf. The following
|
|
||||||
snippet of Python code can be used to parse the file into a human readable form.
|
|
||||||
|
|
||||||
```python
|
|
||||||
from meshtastic.protobuf import mesh_pb2
|
|
||||||
|
|
||||||
mesh_pb2.MeshPacket.FromString(open("crash-XXXX-file", "rb").read())
|
|
||||||
```
|
|
||||||
|
|
||||||
Consider adding any such crash results to the `router_fuzzer_seed_corpus.py` file to ensure there a isn't
|
|
||||||
a future regression for that crash test case.
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
#!/bin/bash -eu
|
|
||||||
|
|
||||||
# Build Meshtastic and a few needed dependencies using clang++
|
|
||||||
# and the OSS-Fuzz required build flags.
|
|
||||||
|
|
||||||
env
|
|
||||||
|
|
||||||
cd "$SRC"
|
|
||||||
NPROC=$(nproc || echo 1)
|
|
||||||
|
|
||||||
LDFLAGS=-lpthread cmake -S "$SRC/yaml-cpp" -B "$WORK/yaml-cpp/$SANITIZER" \
|
|
||||||
-DBUILD_SHARED_LIBS=OFF
|
|
||||||
cmake --build "$WORK/yaml-cpp/$SANITIZER" -j "$NPROC"
|
|
||||||
cmake --install "$WORK/yaml-cpp/$SANITIZER" --prefix /usr
|
|
||||||
|
|
||||||
cmake -S "$SRC/orcania" -B "$WORK/orcania/$SANITIZER" \
|
|
||||||
-DBUILD_STATIC=ON
|
|
||||||
cmake --build "$WORK/orcania/$SANITIZER" -j "$NPROC"
|
|
||||||
cmake --install "$WORK/orcania/$SANITIZER" --prefix /usr
|
|
||||||
|
|
||||||
cmake -S "$SRC/yder" -B "$WORK/yder/$SANITIZER" \
|
|
||||||
-DBUILD_STATIC=ON -DWITH_JOURNALD=OFF
|
|
||||||
cmake --build "$WORK/yder/$SANITIZER" -j "$NPROC"
|
|
||||||
cmake --install "$WORK/yder/$SANITIZER" --prefix /usr
|
|
||||||
|
|
||||||
cmake -S "$SRC/ulfius" -B "$WORK/ulfius/$SANITIZER" \
|
|
||||||
-DBUILD_STATIC=ON -DWITH_JANSSON=OFF -DWITH_CURL=OFF -DWITH_WEBSOCKET=OFF
|
|
||||||
cmake --build "$WORK/ulfius/$SANITIZER" -j "$NPROC"
|
|
||||||
cmake --install "$WORK/ulfius/$SANITIZER" --prefix /usr
|
|
||||||
|
|
||||||
cd "$SRC/firmware"
|
|
||||||
|
|
||||||
PLATFORMIO_EXTRA_SCRIPTS=$(echo -e "pre:.clusterfuzzlite/platformio-clusterfuzzlite-pre.py\npost:.clusterfuzzlite/platformio-clusterfuzzlite-post.py")
|
|
||||||
STATIC_LIBS=$(pkg-config --libs --static libulfius openssl libgpiod yaml-cpp bluez --silence-errors)
|
|
||||||
export PLATFORMIO_EXTRA_SCRIPTS
|
|
||||||
export STATIC_LIBS
|
|
||||||
export PLATFORMIO_WORKSPACE_DIR="$WORK/pio/$SANITIZER"
|
|
||||||
export TARGET_CC=$CC
|
|
||||||
export TARGET_CXX=$CXX
|
|
||||||
export TARGET_LD=$CXX
|
|
||||||
export TARGET_AR=llvm-ar
|
|
||||||
export TARGET_AS=llvm-as
|
|
||||||
export TARGET_OBJCOPY=llvm-objcopy
|
|
||||||
export TARGET_RANLIB=llvm-ranlib
|
|
||||||
|
|
||||||
mkdir -p "$OUT/lib"
|
|
||||||
|
|
||||||
cp .clusterfuzzlite/*_fuzzer.options "$OUT/"
|
|
||||||
|
|
||||||
for f in .clusterfuzzlite/*_fuzzer.cpp; do
|
|
||||||
fuzzer=$(basename "$f" .cpp)
|
|
||||||
cp -f "$f" src/fuzzer.cpp
|
|
||||||
pio run -vvv --environment "$PIO_ENV"
|
|
||||||
program="$PLATFORMIO_WORKSPACE_DIR/build/$PIO_ENV/program"
|
|
||||||
cp "$program" "$OUT/$fuzzer"
|
|
||||||
|
|
||||||
# Copy shared libraries used by the fuzzer.
|
|
||||||
read -d '' -ra shared_libs < <(ldd "$program" | sed -n 's/[^=]\+=> \([^ ]\+\).*/\1/p') || true
|
|
||||||
cp -f "${shared_libs[@]}" "$OUT/lib/"
|
|
||||||
|
|
||||||
# Build the initial fuzzer seed corpus.
|
|
||||||
corpus_name="${fuzzer}_seed_corpus"
|
|
||||||
corpus_generator="$PWD/.clusterfuzzlite/${corpus_name}.py"
|
|
||||||
if [[ -f $corpus_generator ]]; then
|
|
||||||
mkdir "$corpus_name"
|
|
||||||
pushd "$corpus_name"
|
|
||||||
python3 "$corpus_generator"
|
|
||||||
popd
|
|
||||||
zip -D "$OUT/${corpus_name}.zip" "$corpus_name"/*
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
"""PlatformIO build script (post: runs after other Meshtastic scripts)."""
|
|
||||||
|
|
||||||
import os
|
|
||||||
import shlex
|
|
||||||
|
|
||||||
from SCons.Script import DefaultEnvironment
|
|
||||||
|
|
||||||
env = DefaultEnvironment()
|
|
||||||
|
|
||||||
# Remove any static libraries from the LIBS environment. Static libraries are
|
|
||||||
# handled in platformio-clusterfuzzlite-pre.py.
|
|
||||||
static_libs = set(lib[2:] for lib in shlex.split(os.getenv("STATIC_LIBS")))
|
|
||||||
env.Replace(
|
|
||||||
LIBS=[
|
|
||||||
lib for lib in env["LIBS"] if not (isinstance(lib, str) and lib in static_libs)
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
# FrameworkArduino/portduino/main.cpp contains the "main" function the binary.
|
|
||||||
# The fuzzing framework also provides a "main" function and needs to be run
|
|
||||||
# before Meshtastic is started. We rename the "main" function for Meshtastic to
|
|
||||||
# "portduino_main" here so that it can be called inside the fuzzer.
|
|
||||||
env.AddPostAction(
|
|
||||||
"$BUILD_DIR/FrameworkArduino/portduino/main.cpp.o",
|
|
||||||
env.VerboseAction(
|
|
||||||
" ".join(
|
|
||||||
[
|
|
||||||
"$OBJCOPY",
|
|
||||||
"--redefine-sym=main=portduino_main",
|
|
||||||
"$BUILD_DIR/FrameworkArduino/portduino/main.cpp.o",
|
|
||||||
]
|
|
||||||
),
|
|
||||||
"Renaming main symbol to portduino_main",
|
|
||||||
),
|
|
||||||
)
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
"""PlatformIO build script (pre: runs before other Meshtastic scripts).
|
|
||||||
|
|
||||||
ClusterFuzzLite executes in a different container from the build. During the build,
|
|
||||||
attempt to link statically to as many dependencies as possible. For dependencies that
|
|
||||||
do not have static libraries, the shared library files are copied to the output
|
|
||||||
directory by the build.sh script.
|
|
||||||
"""
|
|
||||||
|
|
||||||
import glob
|
|
||||||
import os
|
|
||||||
import shlex
|
|
||||||
|
|
||||||
from SCons.Script import DefaultEnvironment, Literal
|
|
||||||
|
|
||||||
env = DefaultEnvironment()
|
|
||||||
|
|
||||||
cxxflags = shlex.split(os.getenv("CXXFLAGS"))
|
|
||||||
sanitizer_flags = shlex.split(os.getenv("SANITIZER_FLAGS"))
|
|
||||||
lib_fuzzing_engine = shlex.split(os.getenv("LIB_FUZZING_ENGINE"))
|
|
||||||
statics = glob.glob("/usr/lib/lib*.a") + glob.glob("/usr/lib/*/lib*.a")
|
|
||||||
no_static = set(("-ldl",))
|
|
||||||
|
|
||||||
|
|
||||||
def replaceStatic(lib):
|
|
||||||
"""Replace -l<libname> with the static .a file for the library."""
|
|
||||||
if not lib.startswith("-l") or lib in no_static:
|
|
||||||
return lib
|
|
||||||
static_name = f"/lib{lib[2:]}.a"
|
|
||||||
static = [s for s in statics if s.endswith(static_name)]
|
|
||||||
if len(static) == 1:
|
|
||||||
return static[0]
|
|
||||||
return lib
|
|
||||||
|
|
||||||
|
|
||||||
# Setup the environment for building with Clang and the OSS-Fuzz required build flags.
|
|
||||||
env.Append(
|
|
||||||
CFLAGS=os.getenv("CFLAGS"),
|
|
||||||
CXXFLAGS=cxxflags,
|
|
||||||
LIBSOURCE_DIRS=["/usr/lib/x86_64-linux-gnu"],
|
|
||||||
LINKFLAGS=cxxflags
|
|
||||||
+ sanitizer_flags
|
|
||||||
+ lib_fuzzing_engine
|
|
||||||
+ ["-stdlib=libc++", "-std=c++17"],
|
|
||||||
_LIBFLAGS=[replaceStatic(s) for s in shlex.split(os.getenv("STATIC_LIBS"))]
|
|
||||||
+ [
|
|
||||||
"/usr/lib/x86_64-linux-gnu/libunistring.a", # Needs to be at the end.
|
|
||||||
# Find the shared libraries in a subdirectory named lib
|
|
||||||
# within the same directory as the binary.
|
|
||||||
Literal("-Wl,-rpath,$ORIGIN/lib"),
|
|
||||||
"-Wl,-z,origin",
|
|
||||||
],
|
|
||||||
)
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
language: c++
|
|
||||||
@@ -1,206 +0,0 @@
|
|||||||
// Fuzzer implementation that sends MeshPackets to Router::enqueueReceivedMessage.
|
|
||||||
#include <condition_variable>
|
|
||||||
#include <cstdlib>
|
|
||||||
#include <mutex>
|
|
||||||
#include <pb_decode.h>
|
|
||||||
#include <stdexcept>
|
|
||||||
#include <string>
|
|
||||||
#include <thread>
|
|
||||||
|
|
||||||
#include "PortduinoGPIO.h"
|
|
||||||
#include "PortduinoGlue.h"
|
|
||||||
#include "PowerFSM.h"
|
|
||||||
#include "mesh/MeshTypes.h"
|
|
||||||
#include "mesh/NodeDB.h"
|
|
||||||
#include "mesh/Router.h"
|
|
||||||
#include "mesh/TypeConversions.h"
|
|
||||||
#include "mesh/mesh-pb-constants.h"
|
|
||||||
|
|
||||||
namespace
|
|
||||||
{
|
|
||||||
constexpr uint32_t nodeId = 0x12345678;
|
|
||||||
// Set to true when lateInitVariant finishes. Used to ensure lateInitVariant was called during startup.
|
|
||||||
bool hasBeenConfigured = false;
|
|
||||||
|
|
||||||
// These are used to block the Arduino loop() function until a fuzzer input is ready. This is
|
|
||||||
// an optimization that prevents a sleep from happening before the loop is run. The Arduino loop
|
|
||||||
// function calls loopCanSleep() before sleeping. loopCanSleep is implemented here in the fuzzer
|
|
||||||
// and blocks until runLoopOnce() is called to signal for the loop to run.
|
|
||||||
bool fuzzerRunning = false; // Set to true once LLVMFuzzerTestOneInput has started running.
|
|
||||||
bool loopCanRun = true; // The main Arduino loop() can run when this is true.
|
|
||||||
bool loopIsWaiting = false; // The main Arduino loop() is waiting to be signaled to run.
|
|
||||||
bool loopShouldExit = false; // Indicates that the main Arduino thread should exit by throwing ShouldExitException.
|
|
||||||
std::mutex loopLock;
|
|
||||||
std::condition_variable loopCV;
|
|
||||||
std::thread meshtasticThread;
|
|
||||||
|
|
||||||
// This exception is thrown when the portuino main thread should exit.
|
|
||||||
class ShouldExitException : public std::runtime_error
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
using std::runtime_error::runtime_error;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Start the loop for one test case and wait till the loop has completed. This ensures fuzz
|
|
||||||
// test cases do not overlap with one another. This helps the fuzzer attribute a crash to the
|
|
||||||
// single, currently running, test case.
|
|
||||||
void runLoopOnce()
|
|
||||||
{
|
|
||||||
realHardware = true; // Avoids delay(100) within portduino/main.cpp
|
|
||||||
std::unique_lock<std::mutex> lck(loopLock);
|
|
||||||
fuzzerRunning = true;
|
|
||||||
loopCanRun = true;
|
|
||||||
loopCV.notify_one();
|
|
||||||
loopCV.wait(lck, [] { return !loopCanRun && loopIsWaiting; });
|
|
||||||
}
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
// Called in the main Arduino loop function to determine if the loop can delay/sleep before running again.
|
|
||||||
// We use this as a way to block the loop from sleeping and to start the loop function immediately when a
|
|
||||||
// fuzzer input is ready.
|
|
||||||
bool loopCanSleep()
|
|
||||||
{
|
|
||||||
std::unique_lock<std::mutex> lck(loopLock);
|
|
||||||
loopIsWaiting = true;
|
|
||||||
loopCV.notify_one();
|
|
||||||
loopCV.wait(lck, [] { return loopCanRun || loopShouldExit; });
|
|
||||||
loopIsWaiting = false;
|
|
||||||
if (loopShouldExit)
|
|
||||||
throw ShouldExitException("exit");
|
|
||||||
if (!fuzzerRunning)
|
|
||||||
return true; // The loop can sleep before the fuzzer starts.
|
|
||||||
loopCanRun = false; // Only run the loop once before waiting again.
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called just prior to starting Meshtastic. Allows for setting config values before startup.
|
|
||||||
void lateInitVariant()
|
|
||||||
{
|
|
||||||
portduino_config.logoutputlevel = level_error;
|
|
||||||
channelFile.channels[0] = meshtastic_Channel{
|
|
||||||
.has_settings = true,
|
|
||||||
.settings =
|
|
||||||
meshtastic_ChannelSettings{
|
|
||||||
.psk = {.size = 1, .bytes = {/*defaultpskIndex=*/1}},
|
|
||||||
.name = "LongFast",
|
|
||||||
.uplink_enabled = true,
|
|
||||||
.has_module_settings = true,
|
|
||||||
.module_settings = {.position_precision = 16},
|
|
||||||
},
|
|
||||||
.role = meshtastic_Channel_Role_PRIMARY,
|
|
||||||
};
|
|
||||||
config.security.admin_key[0] = {
|
|
||||||
.size = 32,
|
|
||||||
.bytes = {0xcd, 0xc0, 0xb4, 0x3c, 0x53, 0x24, 0xdf, 0x13, 0xca, 0x5a, 0xa6, 0x0c, 0x0d, 0xec, 0x85, 0x5a,
|
|
||||||
0x4c, 0xf6, 0x1a, 0x96, 0x04, 0x1a, 0x3e, 0xfc, 0xbb, 0x8e, 0x33, 0x71, 0xe5, 0xfc, 0xff, 0x3c},
|
|
||||||
};
|
|
||||||
config.security.admin_key_count = 1;
|
|
||||||
config.lora.region = meshtastic_Config_LoRaConfig_RegionCode_US;
|
|
||||||
moduleConfig.has_mqtt = true;
|
|
||||||
moduleConfig.mqtt = meshtastic_ModuleConfig_MQTTConfig{
|
|
||||||
.enabled = true,
|
|
||||||
.proxy_to_client_enabled = true,
|
|
||||||
};
|
|
||||||
moduleConfig.has_store_forward = true;
|
|
||||||
moduleConfig.store_forward = meshtastic_ModuleConfig_StoreForwardConfig{
|
|
||||||
.enabled = true,
|
|
||||||
.history_return_max = 4,
|
|
||||||
.history_return_window = 600,
|
|
||||||
.is_server = true,
|
|
||||||
};
|
|
||||||
meshtastic_Position fixedGPS = meshtastic_Position{
|
|
||||||
.has_latitude_i = true,
|
|
||||||
.latitude_i = static_cast<uint32_t>(1 * 1e7),
|
|
||||||
.has_longitude_i = true,
|
|
||||||
.longitude_i = static_cast<uint32_t>(3 * 1e7),
|
|
||||||
.has_altitude = true,
|
|
||||||
.altitude = 64,
|
|
||||||
.location_source = meshtastic_Position_LocSource_LOC_MANUAL,
|
|
||||||
};
|
|
||||||
nodeDB->setLocalPosition(fixedGPS);
|
|
||||||
config.has_position = true;
|
|
||||||
config.position.fixed_position = true;
|
|
||||||
meshtastic_NodeInfoLite *info = nodeDB->getMeshNode(nodeDB->getNodeNum());
|
|
||||||
info->has_position = true;
|
|
||||||
info->position = TypeConversions::ConvertToPositionLite(fixedGPS);
|
|
||||||
hasBeenConfigured = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
int portduino_main(int argc, char **argv); // Renamed "main" function from Meshtastic binary.
|
|
||||||
|
|
||||||
// Start Meshtastic in a thread and wait till it has reached the ON state.
|
|
||||||
int LLVMFuzzerInitialize(int *argc, char ***argv)
|
|
||||||
{
|
|
||||||
portduino_config.maxtophone = 5;
|
|
||||||
|
|
||||||
meshtasticThread = std::thread([program = *argv[0]]() {
|
|
||||||
char nodeIdStr[12];
|
|
||||||
strcpy(nodeIdStr, std::to_string(nodeId).c_str());
|
|
||||||
int argc = 7;
|
|
||||||
char *argv[] = {program, "-d", "/tmp/meshtastic", "-h", nodeIdStr, "-p", "0", nullptr};
|
|
||||||
try {
|
|
||||||
portduino_main(argc, argv);
|
|
||||||
} catch (const ShouldExitException &) {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
std::atexit([] {
|
|
||||||
{
|
|
||||||
const std::lock_guard<std::mutex> lck(loopLock);
|
|
||||||
loopShouldExit = true;
|
|
||||||
loopCV.notify_one();
|
|
||||||
}
|
|
||||||
meshtasticThread.join();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Wait for startup.
|
|
||||||
for (int i = 1; i < 20; ++i) {
|
|
||||||
if (powerFSM.getState() == &stateON) {
|
|
||||||
assert(hasBeenConfigured);
|
|
||||||
assert(router);
|
|
||||||
assert(nodeDB);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// This is the main entrypoint for the fuzzer (the fuzz target). The fuzzer will provide an array of bytes to be
|
|
||||||
// interpreted by this method. To keep things simple, the bytes are interpreted as a binary serialized MeshPacket
|
|
||||||
// proto. Any crashes discovered by the fuzzer will be written to a file. Unserialize that file to print the MeshPacket
|
|
||||||
// that caused the failure.
|
|
||||||
//
|
|
||||||
// This guide provides best practices for writing a fuzzer target.
|
|
||||||
// https://github.com/google/fuzzing/blob/master/docs/good-fuzz-target.md
|
|
||||||
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t length)
|
|
||||||
{
|
|
||||||
meshtastic_MeshPacket p = meshtastic_MeshPacket_init_default;
|
|
||||||
pb_istream_t stream = pb_istream_from_buffer(data, length);
|
|
||||||
// Ignore any inputs that fail to decode or have fields set that are not transmitted over LoRa.
|
|
||||||
if (!pb_decode(&stream, &meshtastic_MeshPacket_msg, &p) || p.rx_time || p.rx_snr || p.priority || p.rx_rssi || p.delayed ||
|
|
||||||
p.public_key.size || p.next_hop || p.relay_node || p.tx_after)
|
|
||||||
return -1; // Reject: The input will not be added to the corpus.
|
|
||||||
if (p.which_payload_variant == meshtastic_MeshPacket_decoded_tag) {
|
|
||||||
meshtastic_Data d;
|
|
||||||
stream = pb_istream_from_buffer(p.decoded.payload.bytes, p.decoded.payload.size);
|
|
||||||
if (!pb_decode(&stream, &meshtastic_Data_msg, &d))
|
|
||||||
return -1; // Reject: The input will not be added to the corpus.
|
|
||||||
}
|
|
||||||
|
|
||||||
// Provide default values for a few fields so the fuzzer doesn't need to guess them.
|
|
||||||
if (p.from == 0)
|
|
||||||
p.from = nodeDB->getNodeNum();
|
|
||||||
if (p.to == 0)
|
|
||||||
p.to = nodeDB->getNodeNum();
|
|
||||||
static uint32_t packetId = 0;
|
|
||||||
if (p.id == 0)
|
|
||||||
p.id == ++packetId;
|
|
||||||
if (p.pki_encrypted && config.security.admin_key_count)
|
|
||||||
memcpy(&p.public_key, &config.security.admin_key[0], sizeof(p.public_key));
|
|
||||||
|
|
||||||
router->enqueueReceivedMessage(packetPool.allocCopy(p));
|
|
||||||
runLoopOnce();
|
|
||||||
return 0; // Accept: The input may be added to the corpus.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
[libfuzzer]
|
|
||||||
max_len=256
|
|
||||||
@@ -1,168 +0,0 @@
|
|||||||
"""Generate an initial set of MeshPackets.
|
|
||||||
|
|
||||||
The fuzzer uses these MeshPackets as an initial seed of test candidates.
|
|
||||||
|
|
||||||
It's also good to add any previously discovered crash test cases to this list
|
|
||||||
to avoid future regressions.
|
|
||||||
|
|
||||||
If left unset, the following values will be automatically set by the fuzzer.
|
|
||||||
- to: automatically set to the running node's NodeID
|
|
||||||
- from: automatically set to the running node's NodeID
|
|
||||||
- id: automatically set to the value of an incrementing counter
|
|
||||||
|
|
||||||
Additionally, if `pki_encrypted` is populated in the packet, the first admin key
|
|
||||||
will be copied into the `public_key` field.
|
|
||||||
"""
|
|
||||||
|
|
||||||
import base64
|
|
||||||
|
|
||||||
from meshtastic import BROADCAST_NUM
|
|
||||||
from meshtastic.protobuf import (
|
|
||||||
admin_pb2,
|
|
||||||
atak_pb2,
|
|
||||||
mesh_pb2,
|
|
||||||
portnums_pb2,
|
|
||||||
telemetry_pb2,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def From(node: int = 9):
|
|
||||||
"""Return a dict suitable for **kwargs for populating the 'from' field.
|
|
||||||
|
|
||||||
'from' is a reserved keyword in Python. It can't be used directly as an
|
|
||||||
argument to the MeshPacket constructor. Rather **From() can be used as
|
|
||||||
the final argument to provide the from node as a **kwarg.
|
|
||||||
|
|
||||||
Defaults to 9 if no value is provided.
|
|
||||||
"""
|
|
||||||
return {"from": node}
|
|
||||||
|
|
||||||
|
|
||||||
packets = (
|
|
||||||
(
|
|
||||||
"position",
|
|
||||||
mesh_pb2.MeshPacket(
|
|
||||||
decoded=mesh_pb2.Data(
|
|
||||||
portnum=portnums_pb2.PortNum.POSITION_APP,
|
|
||||||
payload=mesh_pb2.Position(
|
|
||||||
latitude_i=int(1 * 1e7),
|
|
||||||
longitude_i=int(2 * 1e7),
|
|
||||||
altitude=5,
|
|
||||||
precision_bits=32,
|
|
||||||
).SerializeToString(),
|
|
||||||
),
|
|
||||||
to=BROADCAST_NUM,
|
|
||||||
**From(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"telemetry",
|
|
||||||
mesh_pb2.MeshPacket(
|
|
||||||
decoded=mesh_pb2.Data(
|
|
||||||
portnum=portnums_pb2.PortNum.TELEMETRY_APP,
|
|
||||||
payload=telemetry_pb2.Telemetry(
|
|
||||||
time=1736192207,
|
|
||||||
device_metrics=telemetry_pb2.DeviceMetrics(
|
|
||||||
battery_level=101,
|
|
||||||
channel_utilization=8,
|
|
||||||
air_util_tx=2,
|
|
||||||
uptime_seconds=42,
|
|
||||||
),
|
|
||||||
).SerializeToString(),
|
|
||||||
),
|
|
||||||
to=BROADCAST_NUM,
|
|
||||||
**From(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"text",
|
|
||||||
mesh_pb2.MeshPacket(
|
|
||||||
decoded=mesh_pb2.Data(
|
|
||||||
portnum=portnums_pb2.PortNum.TEXT_MESSAGE_APP,
|
|
||||||
payload=b"Hello world",
|
|
||||||
),
|
|
||||||
to=BROADCAST_NUM,
|
|
||||||
**From(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"user",
|
|
||||||
mesh_pb2.MeshPacket(
|
|
||||||
decoded=mesh_pb2.Data(
|
|
||||||
portnum=portnums_pb2.PortNum.NODEINFO_APP,
|
|
||||||
payload=mesh_pb2.User(
|
|
||||||
id="!00000009",
|
|
||||||
long_name="Node 9",
|
|
||||||
short_name="N9",
|
|
||||||
macaddr=b"\x00\x00\x00\x00\x00\x09",
|
|
||||||
hw_model=mesh_pb2.HardwareModel.RAK4631,
|
|
||||||
public_key=base64.b64decode(
|
|
||||||
"L0ih/6F41itofdE8mYyHk1SdfOJ/QRM1KQ+pO4vEEjQ="
|
|
||||||
),
|
|
||||||
).SerializeToString(),
|
|
||||||
),
|
|
||||||
**From(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"traceroute",
|
|
||||||
mesh_pb2.MeshPacket(
|
|
||||||
decoded=mesh_pb2.Data(
|
|
||||||
portnum=portnums_pb2.PortNum.TRACEROUTE_APP,
|
|
||||||
payload=mesh_pb2.RouteDiscovery(
|
|
||||||
route=[10],
|
|
||||||
).SerializeToString(),
|
|
||||||
),
|
|
||||||
**From(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"routing",
|
|
||||||
mesh_pb2.MeshPacket(
|
|
||||||
decoded=mesh_pb2.Data(
|
|
||||||
portnum=portnums_pb2.PortNum.ROUTING_APP,
|
|
||||||
payload=mesh_pb2.Routing(
|
|
||||||
error_reason=mesh_pb2.Routing.NO_RESPONSE,
|
|
||||||
).SerializeToString(),
|
|
||||||
),
|
|
||||||
**From(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"admin",
|
|
||||||
mesh_pb2.MeshPacket(
|
|
||||||
decoded=mesh_pb2.Data(
|
|
||||||
portnum=portnums_pb2.PortNum.ADMIN_APP,
|
|
||||||
payload=admin_pb2.AdminMessage(
|
|
||||||
get_owner_request=True,
|
|
||||||
).SerializeToString(),
|
|
||||||
),
|
|
||||||
pki_encrypted=True,
|
|
||||||
**From(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"atak",
|
|
||||||
mesh_pb2.MeshPacket(
|
|
||||||
decoded=mesh_pb2.Data(
|
|
||||||
portnum=portnums_pb2.PortNum.ATAK_PLUGIN,
|
|
||||||
payload=atak_pb2.TAKPacket(
|
|
||||||
is_compressed=True,
|
|
||||||
# Note, the strings are not valid for a compressed message, but will
|
|
||||||
# give the fuzzer a starting point.
|
|
||||||
contact=atak_pb2.Contact(
|
|
||||||
callsign="callsign", device_callsign="device_callsign"
|
|
||||||
),
|
|
||||||
chat=atak_pb2.GeoChat(
|
|
||||||
message="message", to="to", to_callsign="to_callsign"
|
|
||||||
),
|
|
||||||
).SerializeToString(),
|
|
||||||
),
|
|
||||||
**From(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
||||||
for name, packet in packets:
|
|
||||||
with open(f"{name}.MeshPacket", "wb") as f:
|
|
||||||
f.write(packet.SerializeToString())
|
|
||||||
@@ -1,183 +0,0 @@
|
|||||||
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
#####################################################################################
|
|
||||||
#
|
|
||||||
# INSTALLATION
|
|
||||||
#
|
|
||||||
# Please visit > https://docs.platformio.org/en/latest/core/installation/udev-rules.html
|
|
||||||
#
|
|
||||||
#####################################################################################
|
|
||||||
|
|
||||||
#
|
|
||||||
# Boards
|
|
||||||
#
|
|
||||||
|
|
||||||
# CP210X USB UART
|
|
||||||
ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea[67][013]", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="80a9", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# FT231XS USB UART
|
|
||||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# Prolific Technology, Inc. PL2303 Serial Port
|
|
||||||
ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# QinHeng Electronics HL-340 USB-Serial adapter
|
|
||||||
ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
# QinHeng Electronics CH343 USB-Serial adapter
|
|
||||||
ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="55d3", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
# QinHeng Electronics CH9102 USB-Serial adapter
|
|
||||||
ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="55d4", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# Arduino boards
|
|
||||||
ATTRS{idVendor}=="2341", ATTRS{idProduct}=="[08][023]*", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
ATTRS{idVendor}=="2a03", ATTRS{idProduct}=="[08][02]*", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# Arduino SAM-BA
|
|
||||||
ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="6124", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{MTP_NO_PROBE}="1"
|
|
||||||
|
|
||||||
# Digistump boards
|
|
||||||
ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="0753", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# Maple with DFU
|
|
||||||
ATTRS{idVendor}=="1eaf", ATTRS{idProduct}=="000[34]", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# USBtiny
|
|
||||||
ATTRS{idProduct}=="0c9f", ATTRS{idVendor}=="1781", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# USBasp V2.0
|
|
||||||
ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05dc", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# Teensy boards
|
|
||||||
ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789A]?", ENV{MTP_NO_PROBE}="1"
|
|
||||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789ABCD]?", MODE:="0666"
|
|
||||||
KERNEL=="ttyACM*", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", MODE:="0666"
|
|
||||||
|
|
||||||
# TI Stellaris Launchpad
|
|
||||||
ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="00fd", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# TI MSP430 Launchpad
|
|
||||||
ATTRS{idVendor}=="0451", ATTRS{idProduct}=="f432", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# GD32V DFU Bootloader
|
|
||||||
ATTRS{idVendor}=="28e9", ATTRS{idProduct}=="0189", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# FireBeetle-ESP32
|
|
||||||
ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7522", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# Wio Terminal
|
|
||||||
ATTRS{idVendor}=="2886", ATTRS{idProduct}=="[08]02d", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# Raspberry Pi Pico
|
|
||||||
ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="[01]*", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# AIR32F103
|
|
||||||
ATTRS{idVendor}=="0d28", ATTRS{idProduct}=="0204", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# STM32 virtual COM port
|
|
||||||
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
#
|
|
||||||
# Debuggers
|
|
||||||
#
|
|
||||||
|
|
||||||
# Black Magic Probe
|
|
||||||
SUBSYSTEM=="tty", ATTRS{interface}=="Black Magic GDB Server", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
SUBSYSTEM=="tty", ATTRS{interface}=="Black Magic UART Port", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# opendous and estick
|
|
||||||
ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="204f", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# Original FT232/FT245/FT2232/FT232H/FT4232
|
|
||||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="60[01][104]", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# DISTORTEC JTAG-lock-pick Tiny 2
|
|
||||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8220", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# TUMPA, TUMPA Lite
|
|
||||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8a9[89]", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# XDS100v2
|
|
||||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="a6d0", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# Xverve Signalyzer Tool (DT-USB-ST), Signalyzer LITE (DT-USB-SLITE)
|
|
||||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bca[01]", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# TI/Luminary Stellaris Evaluation Board FTDI (several)
|
|
||||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bcd[9a]", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# egnite Turtelizer 2
|
|
||||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bdc8", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# Section5 ICEbear
|
|
||||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="c14[01]", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# Amontec JTAGkey and JTAGkey-tiny
|
|
||||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="cff8", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# TI ICDI
|
|
||||||
ATTRS{idVendor}=="0451", ATTRS{idProduct}=="c32a", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# STLink probes
|
|
||||||
ATTRS{idVendor}=="0483", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# Hilscher NXHX Boards
|
|
||||||
ATTRS{idVendor}=="0640", ATTRS{idProduct}=="0028", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# Hitex probes
|
|
||||||
ATTRS{idVendor}=="0640", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# Altera USB Blaster
|
|
||||||
ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6001", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# Amontec JTAGkey-HiSpeed
|
|
||||||
ATTRS{idVendor}=="0fbb", ATTRS{idProduct}=="1000", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# SEGGER J-Link
|
|
||||||
ATTRS{idVendor}=="1366", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# Raisonance RLink
|
|
||||||
ATTRS{idVendor}=="138e", ATTRS{idProduct}=="9000", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# Debug Board for Neo1973
|
|
||||||
ATTRS{idVendor}=="1457", ATTRS{idProduct}=="5118", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# Olimex probes
|
|
||||||
ATTRS{idVendor}=="15ba", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# USBprog with OpenOCD firmware
|
|
||||||
ATTRS{idVendor}=="1781", ATTRS{idProduct}=="0c63", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# TI/Luminary Stellaris In-Circuit Debug Interface (ICDI) Board
|
|
||||||
ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="00fd", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# Marvell Sheevaplug
|
|
||||||
ATTRS{idVendor}=="9e88", ATTRS{idProduct}=="9e8f", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# Keil Software, Inc. ULink
|
|
||||||
ATTRS{idVendor}=="c251", ATTRS{idProduct}=="2710", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# CMSIS-DAP compatible adapters
|
|
||||||
ATTRS{product}=="*CMSIS-DAP*", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# Atmel AVR Dragon
|
|
||||||
ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2107", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# Espressif USB JTAG/serial debug unit
|
|
||||||
ATTRS{idVendor}=="303a", ATTRS{idProduct}=="1001", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
|
|
||||||
# Zephyr framework USB CDC-ACM
|
|
||||||
ATTRS{idVendor}=="2fe3", ATTRS{idProduct}=="0100", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1"
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
# trunk-ignore-all(terrascan/AC_DOCKER_0002): Known terrascan issue
|
|
||||||
# trunk-ignore-all(hadolint/DL3008): Do not pin apt package versions
|
|
||||||
# trunk-ignore-all(hadolint/DL3013): Do not pin pip package versions
|
|
||||||
FROM mcr.microsoft.com/devcontainers/cpp:2-debian-13
|
|
||||||
|
|
||||||
USER root
|
|
||||||
|
|
||||||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
|
||||||
&& apt-get -y install --no-install-recommends \
|
|
||||||
ca-certificates \
|
|
||||||
g++ \
|
|
||||||
git \
|
|
||||||
libbluetooth-dev \
|
|
||||||
libgpiod-dev \
|
|
||||||
liborcania-dev \
|
|
||||||
libssl-dev \
|
|
||||||
libulfius-dev \
|
|
||||||
libyaml-cpp-dev \
|
|
||||||
pipx \
|
|
||||||
pkg-config \
|
|
||||||
python3 \
|
|
||||||
python3-pip \
|
|
||||||
python3-venv \
|
|
||||||
python3-wheel \
|
|
||||||
wget \
|
|
||||||
zip \
|
|
||||||
usbutils \
|
|
||||||
hwdata \
|
|
||||||
gpg \
|
|
||||||
gnupg2 \
|
|
||||||
libusb-1.0-0-dev \
|
|
||||||
libuv1-dev \
|
|
||||||
libi2c-dev \
|
|
||||||
libxcb-xkb-dev \
|
|
||||||
libxkbcommon-dev \
|
|
||||||
libinput-dev \
|
|
||||||
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
RUN pipx install platformio
|
|
||||||
|
|
||||||
COPY 99-platformio-udev.rules /etc/udev/rules.d/99-platformio-udev.rules
|
|
||||||
|
|
||||||
USER vscode
|
|
||||||
|
|
||||||
HEALTHCHECK NONE
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
|
||||||
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp
|
|
||||||
{
|
|
||||||
"name": "Meshtastic Firmware Dev",
|
|
||||||
"build": {
|
|
||||||
"dockerfile": "Dockerfile"
|
|
||||||
},
|
|
||||||
"features": {
|
|
||||||
"ghcr.io/devcontainers/features/python:1": {
|
|
||||||
"installTools": true,
|
|
||||||
"version": "3.14"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"customizations": {
|
|
||||||
"vscode": {
|
|
||||||
"extensions": [
|
|
||||||
"ms-vscode.cpptools",
|
|
||||||
"platformio.platformio-ide",
|
|
||||||
"Trunk.io"
|
|
||||||
],
|
|
||||||
"unwantedRecommendations": ["ms-azuretools.vscode-docker"],
|
|
||||||
"settings": {
|
|
||||||
"extensions.ignoreRecommendations": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
|
||||||
"forwardPorts": [4403],
|
|
||||||
|
|
||||||
// Use "--device=" to make a local device available inside the container.
|
|
||||||
// "runArgs": ["--device=/dev/ttyACM0"],
|
|
||||||
|
|
||||||
// Run commands to prepare the container for use
|
|
||||||
"postCreateCommand": ".devcontainer/setup.sh"
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
|
|
||||||
git submodule update --init
|
|
||||||
|
|
||||||
pip install --no-cache-dir setuptools
|
|
||||||
pipx install esptool
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
.gitignore
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
# Absolute path to the local meshtastic config.yaml file
|
|
||||||
CONFIG_PATH=/path/to/meshtastic/config.yaml
|
|
||||||
# USB device to passthrough (`lsusb -t`: look for `ch341`)
|
|
||||||
USB_DEVICE=/dev/bus/usb/001/037
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
* text=auto eol=lf
|
|
||||||
*.cmd text eol=crlf
|
|
||||||
*.bat text eol=crlf
|
|
||||||
*.ps1 text eol=crlf
|
|
||||||
*.{sh,[sS][hH]} text eol=lf
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# These are supported funding model platforms
|
|
||||||
|
|
||||||
open_collective: meshtastic
|
|
||||||
@@ -1,108 +0,0 @@
|
|||||||
name: Bug Report
|
|
||||||
description: File a bug report
|
|
||||||
title: "[Bug]: "
|
|
||||||
labels: [bug, triage]
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Thanks for taking the time to fill out this bug report!
|
|
||||||
|
|
||||||
- type: dropdown
|
|
||||||
id: category
|
|
||||||
attributes:
|
|
||||||
label: Category
|
|
||||||
description: How would you catagorize this issue?
|
|
||||||
multiple: true
|
|
||||||
options:
|
|
||||||
- Hardware Compatibility
|
|
||||||
- BLE
|
|
||||||
- Serial
|
|
||||||
- WiFi
|
|
||||||
- Other
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: dropdown
|
|
||||||
id: hardware
|
|
||||||
attributes:
|
|
||||||
label: Hardware
|
|
||||||
description: What hardware are you encountering this issue on?
|
|
||||||
multiple: true
|
|
||||||
options:
|
|
||||||
- Not Applicable
|
|
||||||
- T-Beam
|
|
||||||
- T-Beam S3
|
|
||||||
- T-Beam 0.7
|
|
||||||
- T-Lora v1
|
|
||||||
- T-Lora v1.3
|
|
||||||
- T-Lora v2 1.6
|
|
||||||
- T-Deck
|
|
||||||
- T-Echo
|
|
||||||
- T-Watch
|
|
||||||
- Rak4631
|
|
||||||
- Rak11200
|
|
||||||
- Rak11310
|
|
||||||
- Heltec v1
|
|
||||||
- Heltec v2
|
|
||||||
- Heltec v2.1
|
|
||||||
- Heltec V3
|
|
||||||
- Heltec Wireless Paper
|
|
||||||
- Heltec Wireless Tracker
|
|
||||||
- Heltec Mesh Node T114
|
|
||||||
- Heltec Vision Master E213
|
|
||||||
- Heltec Vision Master E290
|
|
||||||
- Heltec Vision Master T190
|
|
||||||
- Nano G1
|
|
||||||
- Nano G1 Explorer
|
|
||||||
- Nano G2 Ultra
|
|
||||||
- Raspberry Pi Pico (W)
|
|
||||||
- Relay v1
|
|
||||||
- Relay v2
|
|
||||||
- Seeed Wio Tracker 1110
|
|
||||||
- Seeed Card Tracker T1000-E
|
|
||||||
- Station G1
|
|
||||||
- Station G2
|
|
||||||
- unPhone
|
|
||||||
- CanaryOne
|
|
||||||
- Chatter
|
|
||||||
- Linux Native
|
|
||||||
- DIY
|
|
||||||
- Other
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: checkboxes
|
|
||||||
id: mui
|
|
||||||
attributes:
|
|
||||||
label: Is this bug report about any UI component firmware like InkHUD or Meshtatic UI (MUI)?
|
|
||||||
options:
|
|
||||||
- label: Meshtastic UI aka MUI colorTFT
|
|
||||||
- label: InkHUD ePaper
|
|
||||||
- label: OLED slide UI on any display
|
|
||||||
|
|
||||||
- type: input
|
|
||||||
id: version
|
|
||||||
attributes:
|
|
||||||
label: Firmware Version
|
|
||||||
description: This can be found on the device's screen or via one of the apps.
|
|
||||||
placeholder: x.x.x.yyyyyyy
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: body
|
|
||||||
attributes:
|
|
||||||
label: Description
|
|
||||||
description: Please provide details on what steps you performed for this to happen.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: logs
|
|
||||||
attributes:
|
|
||||||
label: Relevant log output
|
|
||||||
description: If you have any log output to help in diagnosing your bug, please provide it here.
|
|
||||||
render: Shell
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
name: New Board
|
|
||||||
description: Request us to support new hardware
|
|
||||||
title: "[Board]: "
|
|
||||||
labels: [enhancement, triage]
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Thanks for requesting a new board, this will not gurantee that we will support it, but will be on our radar.
|
|
||||||
|
|
||||||
- type: dropdown
|
|
||||||
id: soc
|
|
||||||
attributes:
|
|
||||||
label: SOC
|
|
||||||
description: What SOC does your board have?
|
|
||||||
multiple: true
|
|
||||||
options:
|
|
||||||
- NRF52
|
|
||||||
- ESP32
|
|
||||||
- Other
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: input
|
|
||||||
id: lora
|
|
||||||
attributes:
|
|
||||||
label: Lora IC
|
|
||||||
description: What LoRa IC does the board have?
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: input
|
|
||||||
id: link
|
|
||||||
attributes:
|
|
||||||
label: Product Link
|
|
||||||
description: Where can we find this product?
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: textarea
|
|
||||||
id: body
|
|
||||||
attributes:
|
|
||||||
label: Description
|
|
||||||
description: Please provide any further details you think we may need.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
name: Feature Request
|
|
||||||
description: Request a new feature
|
|
||||||
title: "[Feature Request]: "
|
|
||||||
labels: [enhancement]
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Thanks for your request this will not gurantee that we will implement it, but it will be reviewed.
|
|
||||||
- type: dropdown
|
|
||||||
id: soc
|
|
||||||
attributes:
|
|
||||||
label: Platform
|
|
||||||
description: What device platform will support your feature?
|
|
||||||
multiple: true
|
|
||||||
options:
|
|
||||||
- NRF52
|
|
||||||
- ESP32
|
|
||||||
- RP2040
|
|
||||||
- Linux Native
|
|
||||||
- Cross-Platform
|
|
||||||
- other
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: body
|
|
||||||
attributes:
|
|
||||||
label: Description
|
|
||||||
description: Please provide details about your enhancement.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# Configuration related to self-hosted runner.
|
|
||||||
self-hosted-runner:
|
|
||||||
# Labels of self-hosted runner in array of strings.
|
|
||||||
labels:
|
|
||||||
- test-runner
|
|
||||||
@@ -1,108 +0,0 @@
|
|||||||
name: Setup Build Variant Composite Action
|
|
||||||
description: Variant build actions for Meshtastic Platform IO steps
|
|
||||||
|
|
||||||
inputs:
|
|
||||||
board:
|
|
||||||
description: The board to build for
|
|
||||||
required: true
|
|
||||||
github_token:
|
|
||||||
description: GitHub token
|
|
||||||
required: true
|
|
||||||
build-script-path:
|
|
||||||
description: Path to the build script
|
|
||||||
required: true
|
|
||||||
remove-debug-flags:
|
|
||||||
description: A space separated list of files to remove debug flags from
|
|
||||||
required: false
|
|
||||||
default: ""
|
|
||||||
ota-firmware-source:
|
|
||||||
description: The OTA firmware file to pull
|
|
||||||
required: false
|
|
||||||
default: ""
|
|
||||||
ota-firmware-target:
|
|
||||||
description: The target path to store the OTA firmware file
|
|
||||||
required: false
|
|
||||||
default: ""
|
|
||||||
artifact-paths:
|
|
||||||
description: A newline separated list of paths to store as artifacts
|
|
||||||
required: false
|
|
||||||
default: ""
|
|
||||||
# include-web-ui:
|
|
||||||
# description: Include the web UI in the build
|
|
||||||
# required: false
|
|
||||||
# default: "false"
|
|
||||||
arch:
|
|
||||||
description: Processor arch name
|
|
||||||
required: true
|
|
||||||
default: esp32
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: composite
|
|
||||||
steps:
|
|
||||||
- name: Build base
|
|
||||||
id: base
|
|
||||||
uses: ./.github/actions/setup-base
|
|
||||||
|
|
||||||
# - name: Get web ui version
|
|
||||||
# if: inputs.include-web-ui == 'true'
|
|
||||||
# id: webver
|
|
||||||
# shell: bash
|
|
||||||
# run: |
|
|
||||||
# echo "ver=$(cat bin/web.version)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
# - name: Pull web ui
|
|
||||||
# if: inputs.include-web-ui == 'true'
|
|
||||||
# uses: dsaltares/fetch-gh-release-asset@master
|
|
||||||
# with:
|
|
||||||
# repo: meshtastic/web
|
|
||||||
# file: build.tar
|
|
||||||
# target: build.tar
|
|
||||||
# token: ${{ inputs.github_token }}
|
|
||||||
# version: tags/v${{ steps.webver.outputs.ver }}
|
|
||||||
|
|
||||||
# - name: Unpack web ui
|
|
||||||
# if: inputs.include-web-ui == 'true'
|
|
||||||
# shell: bash
|
|
||||||
# run: |
|
|
||||||
# tar -xf build.tar -C data/static
|
|
||||||
# rm build.tar
|
|
||||||
|
|
||||||
- name: Remove debug flags for release
|
|
||||||
shell: bash
|
|
||||||
if: inputs.remove-debug-flags != ''
|
|
||||||
run: |
|
|
||||||
for INI_FILE in ${{ inputs.remove-debug-flags }}; do
|
|
||||||
sed -i '/DDEBUG_HEAP/d' ${INI_FILE}
|
|
||||||
done
|
|
||||||
|
|
||||||
- name: PlatformIO ${{ inputs.arch }} download cache
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: ~/.platformio/.cache
|
|
||||||
key: pio-cache-${{ inputs.arch }}-${{ hashFiles('.github/actions/**', '**.ini') }}
|
|
||||||
|
|
||||||
- name: Build ${{ inputs.board }}
|
|
||||||
shell: bash
|
|
||||||
run: ${{ inputs.build-script-path }} ${{ inputs.board }}
|
|
||||||
|
|
||||||
- name: Pull OTA Firmware
|
|
||||||
if: inputs.ota-firmware-source != '' && inputs.ota-firmware-target != ''
|
|
||||||
uses: dsaltares/fetch-gh-release-asset@master
|
|
||||||
with:
|
|
||||||
repo: meshtastic/firmware-ota
|
|
||||||
file: ${{ inputs.ota-firmware-source }}
|
|
||||||
target: ${{ inputs.ota-firmware-target }}
|
|
||||||
token: ${{ inputs.github_token }}
|
|
||||||
|
|
||||||
- name: Get release version string
|
|
||||||
shell: bash
|
|
||||||
run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
|
||||||
id: version
|
|
||||||
|
|
||||||
- name: Store binaries as an artifact
|
|
||||||
uses: actions/upload-artifact@v5
|
|
||||||
with:
|
|
||||||
name: firmware-${{ inputs.arch }}-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip
|
|
||||||
overwrite: true
|
|
||||||
path: |
|
|
||||||
${{ inputs.artifact-paths }}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
name: Setup Build Base Composite Action
|
|
||||||
description: Base build actions for Meshtastic Platform IO steps
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: composite
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
sudo apt-get -y update --fix-missing
|
|
||||||
sudo apt-get install -y cppcheck libbluetooth-dev libgpiod-dev libyaml-cpp-dev lsb-release
|
|
||||||
|
|
||||||
- name: Setup Python
|
|
||||||
uses: actions/setup-python@v6
|
|
||||||
with:
|
|
||||||
python-version: 3.x
|
|
||||||
cache: pip
|
|
||||||
cache-dependency-path: |
|
|
||||||
.github/actions/**
|
|
||||||
**.ini
|
|
||||||
|
|
||||||
- name: Upgrade python tools
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install -U --no-build-isolation --no-cache-dir "setuptools<72"
|
|
||||||
pip install -U platformio adafruit-nrfutil --no-build-isolation
|
|
||||||
pip install -U poetry --no-build-isolation
|
|
||||||
pip install -U meshtastic --pre --no-build-isolation
|
|
||||||
|
|
||||||
- name: Upgrade platformio
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
pio upgrade
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
name: Setup native build
|
|
||||||
description: Install libraries needed for building the Native/Portduino build
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: composite
|
|
||||||
steps:
|
|
||||||
- name: Setup base
|
|
||||||
id: base
|
|
||||||
uses: ./.github/actions/setup-base
|
|
||||||
|
|
||||||
- name: Install libs needed for native build
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
sudo apt-get install -y libbluetooth-dev libgpiod-dev libyaml-cpp-dev openssl libssl-dev libulfius-dev liborcania-dev libusb-1.0-0-dev libi2c-dev libuv1-dev
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 89 KiB |
@@ -1,28 +0,0 @@
|
|||||||
## 🙏 Thank you for sending in a pull request, here's some tips to get started!
|
|
||||||
|
|
||||||
### ❌ (Please delete all these tips and replace them with your text) ❌
|
|
||||||
|
|
||||||
- Before starting on some new big chunk of code, it it is optional but highly recommended to open an issue first
|
|
||||||
to say "Hey, I think this idea X should be implemented and I'm starting work on it. My general plan is Y, any feedback
|
|
||||||
is appreciated." This will allow other devs to potentially save you time by not accidentially duplicating work etc...
|
|
||||||
- Please do not check in files that don't have real changes
|
|
||||||
- Please do not reformat lines that you didn't have to change the code on
|
|
||||||
- We recommend using the [Visual Studio Code](https://platformio.org/install/ide?install=vscode) editor along with the ['Trunk Check' extension](https://marketplace.visualstudio.com/items?itemName=trunk.io) (In beta for windows, WSL2 for the linux version),
|
|
||||||
because it automatically follows our indentation rules and its auto reformatting will not cause spurious changes to lines.
|
|
||||||
- If your PR fixes a bug, mention "fixes #bugnum" somewhere in your pull request description.
|
|
||||||
- If your other co-developers have comments on your PR please tweak as needed.
|
|
||||||
- Please also enable "Allow edits by maintainers".
|
|
||||||
- Please do not submit untested code.
|
|
||||||
- If you do not have the affected hardware to test your code changes adequately against regressions, please indicate this, so that contributors and commnunity members can help test your changes.
|
|
||||||
- If your PR gets accepted you can request a "Contributor" role in the Meshtastic Discord
|
|
||||||
|
|
||||||
## 🤝 Attestations
|
|
||||||
|
|
||||||
- [ ] I have tested that my proposed changes behave as described.
|
|
||||||
- [ ] I have tested that my proposed changes do not cause any obvious regressions on the following devices:
|
|
||||||
- [ ] Heltec (Lora32) V3
|
|
||||||
- [ ] LilyGo T-Deck
|
|
||||||
- [ ] LilyGo T-Beam
|
|
||||||
- [ ] RAK WisBlock 4631
|
|
||||||
- [ ] Seeed Studio T-1000E tracker card
|
|
||||||
- [ ] Other (please specify below)
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
name: Build Debian Source Package
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
secrets:
|
|
||||||
PPA_GPG_PRIVATE_KEY:
|
|
||||||
required: false
|
|
||||||
inputs:
|
|
||||||
series:
|
|
||||||
description: Ubuntu/Debian series to target
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
build_location:
|
|
||||||
description: Location where build will execute
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-debian-src:
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
path: meshtasticd
|
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- name: Install deps
|
|
||||||
shell: bash
|
|
||||||
working-directory: meshtasticd
|
|
||||||
run: |
|
|
||||||
sudo apt-get update -y --fix-missing
|
|
||||||
sudo apt-get install -y software-properties-common build-essential devscripts equivs
|
|
||||||
sudo add-apt-repository ppa:meshtastic/build-tools -y
|
|
||||||
sudo apt-get update -y --fix-missing
|
|
||||||
sudo mk-build-deps --install --remove --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control
|
|
||||||
|
|
||||||
- name: Import GPG key
|
|
||||||
uses: crazy-max/ghaction-import-gpg@v6
|
|
||||||
with:
|
|
||||||
gpg_private_key: ${{ secrets.PPA_GPG_PRIVATE_KEY }}
|
|
||||||
id: gpg
|
|
||||||
|
|
||||||
- name: Get release version string
|
|
||||||
working-directory: meshtasticd
|
|
||||||
run: |
|
|
||||||
echo "deb=$(./bin/buildinfo.py deb)" >> $GITHUB_OUTPUT
|
|
||||||
env:
|
|
||||||
BUILD_LOCATION: ${{ inputs.build_location }}
|
|
||||||
id: version
|
|
||||||
|
|
||||||
- name: Fetch libdeps, package debian source
|
|
||||||
working-directory: meshtasticd
|
|
||||||
run: debian/ci_pack_sdeb.sh
|
|
||||||
env:
|
|
||||||
SERIES: ${{ inputs.series }}
|
|
||||||
GPG_KEY_ID: ${{ steps.gpg.outputs.keyid }}
|
|
||||||
PKG_VERSION: ${{ steps.version.outputs.deb }}
|
|
||||||
|
|
||||||
- name: Store binaries as an artifact
|
|
||||||
uses: actions/upload-artifact@v5
|
|
||||||
with:
|
|
||||||
name: firmware-debian-${{ steps.version.outputs.deb }}~${{ inputs.series }}-src
|
|
||||||
overwrite: true
|
|
||||||
path: |
|
|
||||||
meshtasticd_${{ steps.version.outputs.deb }}*
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
name: Build
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
version:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
platform:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
pio_env:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
|
|
||||||
permissions: read-all
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
pio-build:
|
|
||||||
name: build-${{ inputs.platform }}
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
outputs:
|
|
||||||
artifact-id: ${{ steps.upload.outputs.artifact-id }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- name: Set OTA firmware source and target
|
|
||||||
if: startsWith(inputs.platform, 'esp32')
|
|
||||||
id: ota_dir
|
|
||||||
env:
|
|
||||||
PIO_PLATFORM: ${{ inputs.platform }}
|
|
||||||
run: |
|
|
||||||
if [ "$PIO_PLATFORM" = "esp32s3" ]; then
|
|
||||||
echo "src=firmware-s3.bin" >> $GITHUB_OUTPUT
|
|
||||||
echo "tgt=release/bleota-s3.bin" >> $GITHUB_OUTPUT
|
|
||||||
elif [ "$PIO_PLATFORM" = "esp32c3" ] || [ "$PIO_PLATFORM" = "esp32c6" ]; then
|
|
||||||
echo "src=firmware-c3.bin" >> $GITHUB_OUTPUT
|
|
||||||
echo "tgt=release/bleota-c3.bin" >> $GITHUB_OUTPUT
|
|
||||||
elif [ "$PIO_PLATFORM" = "esp32" ]; then
|
|
||||||
echo "src=firmware.bin" >> $GITHUB_OUTPUT
|
|
||||||
echo "tgt=release/bleota.bin" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Build ${{ inputs.platform }}
|
|
||||||
id: build
|
|
||||||
uses: meshtastic/gh-action-firmware@main
|
|
||||||
with:
|
|
||||||
pio_platform: ${{ inputs.platform }}
|
|
||||||
pio_env: ${{ inputs.pio_env }}
|
|
||||||
pio_target: build
|
|
||||||
ota_firmware_source: ${{ steps.ota_dir.outputs.src || '' }}
|
|
||||||
ota_firmware_target: ${{ steps.ota_dir.outputs.tgt || '' }}
|
|
||||||
|
|
||||||
- name: Store binaries as an artifact
|
|
||||||
uses: actions/upload-artifact@v5
|
|
||||||
id: upload
|
|
||||||
with:
|
|
||||||
name: firmware-${{ inputs.platform }}-${{ inputs.pio_env }}-${{ inputs.version }}.zip
|
|
||||||
overwrite: true
|
|
||||||
path: |
|
|
||||||
release/*.bin
|
|
||||||
release/*.elf
|
|
||||||
release/*.uf2
|
|
||||||
release/*.hex
|
|
||||||
release/*-ota.zip
|
|
||||||
@@ -1,176 +0,0 @@
|
|||||||
name: Build One Arch
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
# trunk-ignore(checkov/CKV_GHA_7)
|
|
||||||
arch:
|
|
||||||
type: choice
|
|
||||||
options:
|
|
||||||
- esp32
|
|
||||||
- esp32s3
|
|
||||||
- esp32c3
|
|
||||||
- esp32c6
|
|
||||||
- nrf52840
|
|
||||||
- rp2040
|
|
||||||
- rp2350
|
|
||||||
- stm32
|
|
||||||
- native
|
|
||||||
|
|
||||||
permissions: read-all
|
|
||||||
|
|
||||||
env:
|
|
||||||
INPUT_ARCH: ${{ github.event.inputs.arch }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
setup:
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
- uses: actions/setup-python@v6
|
|
||||||
with:
|
|
||||||
python-version: 3.x
|
|
||||||
cache: pip
|
|
||||||
- run: pip install -U platformio
|
|
||||||
- name: Generate matrix
|
|
||||||
id: jsonStep
|
|
||||||
run: |
|
|
||||||
TARGETS=$(./bin/generate_ci_matrix.py $INPUT_ARCH --level extra)
|
|
||||||
echo "Name: $GITHUB_REF_NAME Base: $GITHUB_BASE_REF Ref: $GITHUB_REF"
|
|
||||||
echo "selected_arch=$TARGETS" >> $GITHUB_OUTPUT
|
|
||||||
outputs:
|
|
||||||
selected_arch: ${{ steps.jsonStep.outputs.selected_arch }}
|
|
||||||
|
|
||||||
version:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
- name: Get release version string
|
|
||||||
run: |
|
|
||||||
echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
|
||||||
echo "deb=$(./bin/buildinfo.py deb)" >> $GITHUB_OUTPUT
|
|
||||||
id: version
|
|
||||||
env:
|
|
||||||
BUILD_LOCATION: local
|
|
||||||
outputs:
|
|
||||||
long: ${{ steps.version.outputs.long }}
|
|
||||||
deb: ${{ steps.version.outputs.deb }}
|
|
||||||
|
|
||||||
build:
|
|
||||||
if: ${{ github.event_name != 'workflow_dispatch' }}
|
|
||||||
needs: [setup, version]
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
build: ${{ fromJson(needs.setup.outputs.selected_arch) }}
|
|
||||||
uses: ./.github/workflows/build_firmware.yml
|
|
||||||
with:
|
|
||||||
version: ${{ needs.version.outputs.long }}
|
|
||||||
pio_env: ${{ matrix.build.board }}
|
|
||||||
platform: ${{ matrix.build.arch }}
|
|
||||||
|
|
||||||
build-debian-src:
|
|
||||||
if: ${{ github.repository == 'meshtastic/firmware' && github.event_name != 'workflow_dispatch' || inputs.arch == 'native' }}
|
|
||||||
uses: ./.github/workflows/build_debian_src.yml
|
|
||||||
with:
|
|
||||||
series: UNRELEASED
|
|
||||||
build_location: local
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
package-pio-deps-native-tft:
|
|
||||||
if: ${{ inputs.arch == 'native' }}
|
|
||||||
uses: ./.github/workflows/package_pio_deps.yml
|
|
||||||
with:
|
|
||||||
pio_env: native-tft
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
test-native:
|
|
||||||
if: ${{ !contains(github.ref_name, 'event/') && github.event_name != 'workflow_dispatch' || !contains(github.ref_name, 'event/') && inputs.arch == 'native' }}
|
|
||||||
uses: ./.github/workflows/test_native.yml
|
|
||||||
|
|
||||||
gather-artifacts:
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
arch:
|
|
||||||
- esp32
|
|
||||||
- esp32s3
|
|
||||||
- esp32c3
|
|
||||||
- esp32c6
|
|
||||||
- nrf52840
|
|
||||||
- rp2040
|
|
||||||
- rp2350
|
|
||||||
- stm32
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [version, build]
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v6
|
|
||||||
with:
|
|
||||||
path: ./
|
|
||||||
pattern: firmware-${{inputs.arch}}-*
|
|
||||||
merge-multiple: true
|
|
||||||
|
|
||||||
- name: Display structure of downloaded files
|
|
||||||
run: ls -R
|
|
||||||
|
|
||||||
- name: Move files up
|
|
||||||
run: mv -b -t ./ ./bin/device-*.sh ./bin/device-*.bat
|
|
||||||
|
|
||||||
- name: Repackage in single firmware zip
|
|
||||||
uses: actions/upload-artifact@v5
|
|
||||||
with:
|
|
||||||
name: firmware-${{inputs.arch}}-${{ needs.version.outputs.long }}
|
|
||||||
overwrite: true
|
|
||||||
path: |
|
|
||||||
./firmware-*.bin
|
|
||||||
./firmware-*.uf2
|
|
||||||
./firmware-*.hex
|
|
||||||
./firmware-*-ota.zip
|
|
||||||
./device-*.sh
|
|
||||||
./device-*.bat
|
|
||||||
./littlefs-*.bin
|
|
||||||
./bleota*bin
|
|
||||||
./Meshtastic_nRF52_factory_erase*.uf2
|
|
||||||
retention-days: 30
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v6
|
|
||||||
with:
|
|
||||||
name: firmware-${{inputs.arch}}-${{ needs.version.outputs.long }}
|
|
||||||
merge-multiple: true
|
|
||||||
path: ./output
|
|
||||||
|
|
||||||
# For diagnostics
|
|
||||||
- name: Show artifacts
|
|
||||||
run: ls -lR
|
|
||||||
|
|
||||||
- name: Device scripts permissions
|
|
||||||
run: |
|
|
||||||
chmod +x ./output/device-install.sh
|
|
||||||
chmod +x ./output/device-update.sh
|
|
||||||
|
|
||||||
- name: Zip firmware
|
|
||||||
run: zip -j -9 -r ./firmware-${{inputs.arch}}-${{ needs.version.outputs.long }}.zip ./output
|
|
||||||
|
|
||||||
- name: Repackage in single elfs zip
|
|
||||||
uses: actions/upload-artifact@v5
|
|
||||||
with:
|
|
||||||
name: debug-elfs-${{inputs.arch}}-${{ needs.version.outputs.long }}.zip
|
|
||||||
overwrite: true
|
|
||||||
path: ./*.elf
|
|
||||||
retention-days: 30
|
|
||||||
|
|
||||||
- uses: scruplelesswizard/comment-artifact@main
|
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
|
||||||
with:
|
|
||||||
name: firmware-${{inputs.arch}}-${{ needs.version.outputs.long }}
|
|
||||||
description: "Download firmware-${{inputs.arch}}-${{ needs.version.outputs.long }}.zip. This artifact will be available for 90 days from creation"
|
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
@@ -1,182 +0,0 @@
|
|||||||
name: Build One Target
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
# trunk-ignore(checkov/CKV_GHA_7)
|
|
||||||
arch:
|
|
||||||
type: choice
|
|
||||||
options:
|
|
||||||
- esp32
|
|
||||||
- esp32s3
|
|
||||||
- esp32c3
|
|
||||||
- esp32c6
|
|
||||||
- nrf52840
|
|
||||||
- rp2040
|
|
||||||
- rp2350
|
|
||||||
- stm32
|
|
||||||
- native
|
|
||||||
target:
|
|
||||||
type: string
|
|
||||||
required: false
|
|
||||||
description: Choose the target board, e.g. nrf52_promicro_diy_tcxo. If blank, will find available targets.
|
|
||||||
# find-target:
|
|
||||||
# type: boolean
|
|
||||||
# default: true
|
|
||||||
# description: 'Find the available targets'
|
|
||||||
|
|
||||||
permissions: read-all
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
find-targets:
|
|
||||||
if: ${{ inputs.target == '' }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
arch:
|
|
||||||
- esp32
|
|
||||||
- esp32s3
|
|
||||||
- esp32c3
|
|
||||||
- esp32c6
|
|
||||||
- nrf52840
|
|
||||||
- rp2040
|
|
||||||
- rp2350
|
|
||||||
- stm32
|
|
||||||
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
- uses: actions/setup-python@v6
|
|
||||||
with:
|
|
||||||
python-version: 3.x
|
|
||||||
cache: pip
|
|
||||||
- run: pip install -U platformio
|
|
||||||
- name: Generate matrix
|
|
||||||
id: jsonStep
|
|
||||||
run: |
|
|
||||||
TARGETS=$(./bin/generate_ci_matrix.py ${{matrix.arch}} --level extra)
|
|
||||||
echo "Name: $GITHUB_REF_NAME" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "Base: $GITHUB_BASE_REF" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "Arch: ${{matrix.arch}}" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "Ref: $GITHUB_REF" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "Targets:" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo $TARGETS >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
version:
|
|
||||||
if: ${{ inputs.target != '' }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
- name: Get release version string
|
|
||||||
run: |
|
|
||||||
echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
|
||||||
echo "deb=$(./bin/buildinfo.py deb)" >> $GITHUB_OUTPUT
|
|
||||||
id: version
|
|
||||||
env:
|
|
||||||
BUILD_LOCATION: local
|
|
||||||
outputs:
|
|
||||||
long: ${{ steps.version.outputs.long }}
|
|
||||||
deb: ${{ steps.version.outputs.deb }}
|
|
||||||
|
|
||||||
build:
|
|
||||||
if: ${{ inputs.target != '' && inputs.arch != 'native' }}
|
|
||||||
needs: [version]
|
|
||||||
uses: ./.github/workflows/build_firmware.yml
|
|
||||||
with:
|
|
||||||
version: ${{ needs.version.outputs.long }}
|
|
||||||
pio_env: ${{ inputs.target }}
|
|
||||||
platform: ${{ inputs.arch }}
|
|
||||||
|
|
||||||
build-debian-src:
|
|
||||||
if: ${{ github.repository == 'meshtastic/firmware' && inputs.arch == 'native' }}
|
|
||||||
uses: ./.github/workflows/build_debian_src.yml
|
|
||||||
with:
|
|
||||||
series: UNRELEASED
|
|
||||||
build_location: local
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
package-pio-deps-native-tft:
|
|
||||||
if: ${{ inputs.arch == 'native' }}
|
|
||||||
uses: ./.github/workflows/package_pio_deps.yml
|
|
||||||
with:
|
|
||||||
pio_env: native-tft
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
test-native:
|
|
||||||
if: ${{ !contains(github.ref_name, 'event/') && github.event_name != 'workflow_dispatch' || !contains(github.ref_name, 'event/') && inputs.arch == 'native' && inputs.target != '' }}
|
|
||||||
uses: ./.github/workflows/test_native.yml
|
|
||||||
|
|
||||||
gather-artifacts:
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [version, build]
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v6
|
|
||||||
with:
|
|
||||||
path: ./
|
|
||||||
pattern: firmware-*-*
|
|
||||||
merge-multiple: true
|
|
||||||
|
|
||||||
- name: Display structure of downloaded files
|
|
||||||
run: ls -R
|
|
||||||
|
|
||||||
- name: Move files up
|
|
||||||
run: mv -b -t ./ ./bin/device-*.sh ./bin/device-*.bat
|
|
||||||
|
|
||||||
- name: Repackage in single firmware zip
|
|
||||||
uses: actions/upload-artifact@v5
|
|
||||||
with:
|
|
||||||
name: firmware-${{inputs.target}}-${{ needs.version.outputs.long }}
|
|
||||||
overwrite: true
|
|
||||||
path: |
|
|
||||||
./firmware-*.bin
|
|
||||||
./firmware-*.uf2
|
|
||||||
./firmware-*.hex
|
|
||||||
./firmware-*-ota.zip
|
|
||||||
./device-*.sh
|
|
||||||
./device-*.bat
|
|
||||||
./littlefs-*.bin
|
|
||||||
./bleota*bin
|
|
||||||
./Meshtastic_nRF52_factory_erase*.uf2
|
|
||||||
retention-days: 30
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v6
|
|
||||||
with:
|
|
||||||
pattern: firmware-*-${{ needs.version.outputs.long }}
|
|
||||||
merge-multiple: true
|
|
||||||
path: ./output
|
|
||||||
|
|
||||||
# For diagnostics
|
|
||||||
- name: Show artifacts
|
|
||||||
run: ls -lR
|
|
||||||
|
|
||||||
- name: Device scripts permissions
|
|
||||||
run: |
|
|
||||||
chmod +x ./output/device-install.sh
|
|
||||||
chmod +x ./output/device-update.sh
|
|
||||||
|
|
||||||
- name: Zip firmware
|
|
||||||
run: zip -j -9 -r ./firmware-${{inputs.target}}-${{ needs.version.outputs.long }}.zip ./output
|
|
||||||
|
|
||||||
- name: Repackage in single elfs zip
|
|
||||||
uses: actions/upload-artifact@v5
|
|
||||||
with:
|
|
||||||
name: debug-elfs-${{inputs.target}}-${{ needs.version.outputs.long }}.zip
|
|
||||||
overwrite: true
|
|
||||||
path: ./*.elf
|
|
||||||
retention-days: 30
|
|
||||||
|
|
||||||
- uses: scruplelesswizard/comment-artifact@main
|
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
|
||||||
with:
|
|
||||||
name: firmware-${{inputs.target}}-${{ needs.version.outputs.long }}
|
|
||||||
description: "Download firmware-${{inputs.target}}-${{ needs.version.outputs.long }}.zip. This artifact will be available for 90 days from creation"
|
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
name: Daily Packaging
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: 0 2 * * *
|
|
||||||
workflow_dispatch:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
paths:
|
|
||||||
- debian/**
|
|
||||||
- "*.rpkg"
|
|
||||||
- .github/workflows/nightly_packaging.yml
|
|
||||||
- .github/workflows/build_debian_src.yml
|
|
||||||
- .github/workflows/package_ppa.yml
|
|
||||||
- .github/workflows/package_obs.yml
|
|
||||||
- .github/workflows/hook_copr.yml
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
docker-multiarch:
|
|
||||||
if: github.repository == 'meshtastic/firmware'
|
|
||||||
uses: ./.github/workflows/docker_manifest.yml
|
|
||||||
with:
|
|
||||||
release_channel: daily
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
package-ppa:
|
|
||||||
if: github.repository == 'meshtastic/firmware'
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
series:
|
|
||||||
- jammy # 22.04 LTS
|
|
||||||
- noble # 24.04 LTS
|
|
||||||
- plucky # 25.04
|
|
||||||
- questing # 25.10
|
|
||||||
uses: ./.github/workflows/package_ppa.yml
|
|
||||||
with:
|
|
||||||
ppa_repo: ppa:meshtastic/daily
|
|
||||||
series: ${{ matrix.series }}
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
package-obs:
|
|
||||||
if: github.repository == 'meshtastic/firmware'
|
|
||||||
uses: ./.github/workflows/package_obs.yml
|
|
||||||
with:
|
|
||||||
obs_project: network:Meshtastic:daily
|
|
||||||
series: unstable
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
hook-copr:
|
|
||||||
if: github.repository == 'meshtastic/firmware'
|
|
||||||
uses: ./.github/workflows/hook_copr.yml
|
|
||||||
with:
|
|
||||||
copr_project: daily
|
|
||||||
secrets: inherit
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
name: Build Docker
|
|
||||||
|
|
||||||
# Build Docker image, push untagged (digest-only)
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
secrets:
|
|
||||||
DOCKER_FIRMWARE_TOKEN:
|
|
||||||
required: false # Only required for push
|
|
||||||
inputs:
|
|
||||||
distro:
|
|
||||||
description: Distro to target
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
# choices: [debian, alpine]
|
|
||||||
platform:
|
|
||||||
description: Platform to target
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
runs-on:
|
|
||||||
description: Runner to use
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
push:
|
|
||||||
description: Push images to registry
|
|
||||||
required: false
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
pio_env:
|
|
||||||
description: PlatformIO environment to build
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
default: native
|
|
||||||
outputs:
|
|
||||||
digest:
|
|
||||||
description: Digest of built image
|
|
||||||
value: ${{ jobs.docker-build.outputs.digest }}
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
docker-build:
|
|
||||||
outputs:
|
|
||||||
digest: ${{ steps.docker_variant.outputs.digest }}
|
|
||||||
runs-on: ${{ inputs.runs-on }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- name: Get release version string
|
|
||||||
run: |
|
|
||||||
echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
|
||||||
id: version
|
|
||||||
|
|
||||||
- name: Docker login
|
|
||||||
if: ${{ inputs.push }}
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
username: meshtastic
|
|
||||||
password: ${{ secrets.DOCKER_FIRMWARE_TOKEN }}
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: Docker setup
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Sanitize platform string
|
|
||||||
id: sanitize_platform
|
|
||||||
# Replace slashes with underscores
|
|
||||||
run: echo "cleaned_platform=${{ inputs.platform }}" | sed 's/\//_/g' >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Docker tag
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: meshtastic/meshtasticd
|
|
||||||
tags: |
|
|
||||||
GHA-${{ steps.version.outputs.long }}-${{ inputs.distro }}-${{ steps.sanitize_platform.outputs.cleaned_platform }}
|
|
||||||
flavor: latest=false
|
|
||||||
|
|
||||||
- name: Docker build and push
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
id: docker_variant
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: |
|
|
||||||
${{ contains(inputs.distro, 'debian') && './Dockerfile' || contains(inputs.distro, 'alpine') && './alpine.Dockerfile' }}
|
|
||||||
push: ${{ inputs.push }}
|
|
||||||
tags: ${{ steps.meta.outputs.tags }} # Tag is only meant to be consumed by the "manifest" job
|
|
||||||
platforms: ${{ inputs.platform }}
|
|
||||||
build-args: |
|
|
||||||
PIO_ENV=${{ inputs.pio_env }}
|
|
||||||
@@ -1,186 +0,0 @@
|
|||||||
name: Build Docker Multi-Arch Manifest
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
secrets:
|
|
||||||
DOCKER_FIRMWARE_TOKEN:
|
|
||||||
required: true
|
|
||||||
inputs:
|
|
||||||
release_channel:
|
|
||||||
description: Release channel to target
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
docker-debian-amd64:
|
|
||||||
uses: ./.github/workflows/docker_build.yml
|
|
||||||
with:
|
|
||||||
distro: debian
|
|
||||||
platform: linux/amd64
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
push: true
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
docker-debian-arm64:
|
|
||||||
uses: ./.github/workflows/docker_build.yml
|
|
||||||
with:
|
|
||||||
distro: debian
|
|
||||||
platform: linux/arm64
|
|
||||||
runs-on: ubuntu-24.04-arm
|
|
||||||
push: true
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
docker-debian-armv7:
|
|
||||||
uses: ./.github/workflows/docker_build.yml
|
|
||||||
with:
|
|
||||||
distro: debian
|
|
||||||
platform: linux/arm/v7
|
|
||||||
runs-on: ubuntu-24.04-arm
|
|
||||||
push: true
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
docker-alpine-amd64:
|
|
||||||
uses: ./.github/workflows/docker_build.yml
|
|
||||||
with:
|
|
||||||
distro: alpine
|
|
||||||
platform: linux/amd64
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
push: true
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
docker-alpine-arm64:
|
|
||||||
uses: ./.github/workflows/docker_build.yml
|
|
||||||
with:
|
|
||||||
distro: alpine
|
|
||||||
platform: linux/arm64
|
|
||||||
runs-on: ubuntu-24.04-arm
|
|
||||||
push: true
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
docker-alpine-armv7:
|
|
||||||
uses: ./.github/workflows/docker_build.yml
|
|
||||||
with:
|
|
||||||
distro: alpine
|
|
||||||
platform: linux/arm/v7
|
|
||||||
runs-on: ubuntu-24.04-arm
|
|
||||||
push: true
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
docker-manifest:
|
|
||||||
needs:
|
|
||||||
# Debian
|
|
||||||
- docker-debian-amd64
|
|
||||||
- docker-debian-arm64
|
|
||||||
- docker-debian-armv7
|
|
||||||
# Alpine
|
|
||||||
- docker-alpine-amd64
|
|
||||||
- docker-alpine-arm64
|
|
||||||
- docker-alpine-armv7
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- name: Get release version string
|
|
||||||
run: |
|
|
||||||
echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
|
||||||
echo "short=$(./bin/buildinfo.py short)" >> $GITHUB_OUTPUT
|
|
||||||
id: version
|
|
||||||
|
|
||||||
- name: Enumerate tags
|
|
||||||
shell: python
|
|
||||||
run: |
|
|
||||||
import os
|
|
||||||
|
|
||||||
short = "${{ steps.version.outputs.short }}"
|
|
||||||
long = "${{ steps.version.outputs.long }}"
|
|
||||||
release_channel = "${{ inputs.release_channel }}"
|
|
||||||
tags = {
|
|
||||||
"beta": {
|
|
||||||
"debian": [
|
|
||||||
f"{short}", f"{long}", f"{short}-beta", f"{long}-beta", "beta", "latest",
|
|
||||||
f"{short}-debian", f"{long}-debian", f"{short}-beta-debian", f"{long}-beta-debian", "beta-debian"
|
|
||||||
],
|
|
||||||
"alpine": [
|
|
||||||
f"{short}-alpine", f"{long}-alpine", f"{short}-beta-alpine", f"{long}-beta-alpine", "beta-alpine"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"alpha": {
|
|
||||||
"debian": [
|
|
||||||
f"{short}-alpha", f"{long}-alpha", "alpha",
|
|
||||||
f"{short}-alpha-debian", f"{long}-alpha-debian", "alpha-debian"
|
|
||||||
],
|
|
||||||
"alpine": [
|
|
||||||
f"{short}-alpha-alpine", f"{long}-alpha-alpine", "alpha-alpine"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"daily": {
|
|
||||||
"debian": ["daily", "daily-debian"],
|
|
||||||
"alpine": ["daily-alpine"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
with open(os.environ["GITHUB_OUTPUT"], "a") as fh:
|
|
||||||
fh.write("debian<<EOF\n")
|
|
||||||
fh.write("\n".join(tags[release_channel]["debian"]))
|
|
||||||
fh.write("\nEOF\n")
|
|
||||||
|
|
||||||
fh.write("alpine<<EOF\n")
|
|
||||||
fh.write("\n".join(tags[release_channel]["alpine"]))
|
|
||||||
fh.write("\nEOF\n")
|
|
||||||
id: tags
|
|
||||||
|
|
||||||
- name: Docker login
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
username: meshtastic
|
|
||||||
password: ${{ secrets.DOCKER_FIRMWARE_TOKEN }}
|
|
||||||
|
|
||||||
- name: Docker meta (Debian)
|
|
||||||
id: meta_debian
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: meshtastic/meshtasticd
|
|
||||||
tags: |
|
|
||||||
${{ steps.tags.outputs.debian }}
|
|
||||||
flavor: latest=false
|
|
||||||
|
|
||||||
- name: Create Docker manifest (Debian)
|
|
||||||
id: manifest_debian
|
|
||||||
uses: int128/docker-manifest-create-action@v2
|
|
||||||
with:
|
|
||||||
tags: |
|
|
||||||
${{ steps.meta_debian.outputs.tags }}
|
|
||||||
push: true
|
|
||||||
sources: |
|
|
||||||
meshtastic/meshtasticd@${{ needs.docker-debian-amd64.outputs.digest }}
|
|
||||||
meshtastic/meshtasticd@${{ needs.docker-debian-arm64.outputs.digest }}
|
|
||||||
meshtastic/meshtasticd@${{ needs.docker-debian-armv7.outputs.digest }}
|
|
||||||
|
|
||||||
- name: Docker meta (Alpine)
|
|
||||||
id: meta_alpine
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: meshtastic/meshtasticd
|
|
||||||
tags: |
|
|
||||||
${{ steps.tags.outputs.alpine }}
|
|
||||||
|
|
||||||
- name: Create Docker manifest (Alpine)
|
|
||||||
id: manifest_alpine
|
|
||||||
uses: int128/docker-manifest-create-action@v2
|
|
||||||
with:
|
|
||||||
tags: |
|
|
||||||
${{ steps.meta_alpine.outputs.tags }}
|
|
||||||
push: true
|
|
||||||
sources: |
|
|
||||||
meshtastic/meshtasticd@${{ needs.docker-alpine-amd64.outputs.digest }}
|
|
||||||
meshtastic/meshtasticd@${{ needs.docker-alpine-arm64.outputs.digest }}
|
|
||||||
meshtastic/meshtasticd@${{ needs.docker-alpine-armv7.outputs.digest }}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
name: Trigger COPR build
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
secrets:
|
|
||||||
COPR_API_CONFIG:
|
|
||||||
inputs:
|
|
||||||
copr_project:
|
|
||||||
description: COPR project to target
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-copr-hook:
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
ref: ${{ github.ref }}
|
|
||||||
repository: ${{ github.repository }}
|
|
||||||
|
|
||||||
- name: Trigger COPR build
|
|
||||||
uses: vidplace7/copr-build@main
|
|
||||||
id: copr_build
|
|
||||||
env:
|
|
||||||
COPR_API_TOKEN_CONFIG: ${{ secrets.COPR_API_CONFIG }}
|
|
||||||
with:
|
|
||||||
owner: "@meshtastic"
|
|
||||||
package-name: meshtasticd
|
|
||||||
project-name: ${{ inputs.copr_project }}
|
|
||||||
git-remote: "${{ github.server_url }}/${{ github.repository }}.git"
|
|
||||||
committish: ${{ github.sha }}
|
|
||||||
@@ -1,397 +0,0 @@
|
|||||||
name: CI
|
|
||||||
concurrency:
|
|
||||||
group: ci-${{ github.head_ref || github.run_id }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
on:
|
|
||||||
# # Triggers the workflow on push but only for the main branches
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
- develop
|
|
||||||
- event/*
|
|
||||||
paths-ignore:
|
|
||||||
- "**.md"
|
|
||||||
- version.properties
|
|
||||||
|
|
||||||
# Note: This is different from "pull_request". Need to specify ref when doing checkouts.
|
|
||||||
pull_request_target:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
- develop
|
|
||||||
- event/*
|
|
||||||
paths-ignore:
|
|
||||||
- "**.md"
|
|
||||||
#- "**.yml"
|
|
||||||
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
setup:
|
|
||||||
strategy:
|
|
||||||
fail-fast: true
|
|
||||||
matrix:
|
|
||||||
arch:
|
|
||||||
- all
|
|
||||||
- check
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
- uses: actions/setup-python@v6
|
|
||||||
with:
|
|
||||||
python-version: 3.x
|
|
||||||
cache: pip
|
|
||||||
- run: pip install -U platformio
|
|
||||||
- name: Generate matrix
|
|
||||||
id: jsonStep
|
|
||||||
run: |
|
|
||||||
if [[ "$GITHUB_HEAD_REF" == "" ]]; then
|
|
||||||
TARGETS=$(./bin/generate_ci_matrix.py ${{matrix.arch}})
|
|
||||||
else
|
|
||||||
TARGETS=$(./bin/generate_ci_matrix.py ${{matrix.arch}} --level pr)
|
|
||||||
fi
|
|
||||||
echo "Name: $GITHUB_REF_NAME Base: $GITHUB_BASE_REF Ref: $GITHUB_REF"
|
|
||||||
echo "${{matrix.arch}}=$TARGETS" >> $GITHUB_OUTPUT
|
|
||||||
echo "$TARGETS" >> $GITHUB_STEP_SUMMARY
|
|
||||||
outputs:
|
|
||||||
all: ${{ steps.jsonStep.outputs.all }}
|
|
||||||
check: ${{ steps.jsonStep.outputs.check }}
|
|
||||||
|
|
||||||
version:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
- name: Get release version string
|
|
||||||
run: |
|
|
||||||
echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
|
||||||
echo "deb=$(./bin/buildinfo.py deb)" >> $GITHUB_OUTPUT
|
|
||||||
id: version
|
|
||||||
env:
|
|
||||||
BUILD_LOCATION: local
|
|
||||||
outputs:
|
|
||||||
long: ${{ steps.version.outputs.long }}
|
|
||||||
deb: ${{ steps.version.outputs.deb }}
|
|
||||||
|
|
||||||
check:
|
|
||||||
needs: setup
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
check: ${{ fromJson(needs.setup.outputs.check) }}
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: ${{ github.event_name != 'workflow_dispatch' && github.repository == 'meshtastic/firmware' }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
- name: Build base
|
|
||||||
id: base
|
|
||||||
uses: ./.github/actions/setup-base
|
|
||||||
- name: Check ${{ matrix.check.board }}
|
|
||||||
run: bin/check-all.sh ${{ matrix.check.board }}
|
|
||||||
|
|
||||||
build:
|
|
||||||
needs: [setup, version]
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
build: ${{ fromJson(needs.setup.outputs.all) }}
|
|
||||||
uses: ./.github/workflows/build_firmware.yml
|
|
||||||
with:
|
|
||||||
version: ${{ needs.version.outputs.long }}
|
|
||||||
pio_env: ${{ matrix.build.board }}
|
|
||||||
platform: ${{ matrix.build.platform }}
|
|
||||||
|
|
||||||
build-debian-src:
|
|
||||||
if: github.repository == 'meshtastic/firmware'
|
|
||||||
uses: ./.github/workflows/build_debian_src.yml
|
|
||||||
with:
|
|
||||||
series: UNRELEASED
|
|
||||||
build_location: local
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
package-pio-deps-native-tft:
|
|
||||||
if: ${{ github.repository == 'meshtastic/firmware' && github.event_name == 'workflow_dispatch' }}
|
|
||||||
uses: ./.github/workflows/package_pio_deps.yml
|
|
||||||
with:
|
|
||||||
pio_env: native-tft
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
test-native:
|
|
||||||
if: ${{ !contains(github.ref_name, 'event/') && github.repository == 'meshtastic/firmware' }}
|
|
||||||
uses: ./.github/workflows/test_native.yml
|
|
||||||
|
|
||||||
docker:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
distro: [debian, alpine]
|
|
||||||
platform: [linux/amd64, linux/arm64, linux/arm/v7]
|
|
||||||
pio_env: [native, native-tft]
|
|
||||||
exclude:
|
|
||||||
- distro: alpine
|
|
||||||
platform: linux/arm/v7
|
|
||||||
- pio_env: native-tft
|
|
||||||
platform: linux/arm64
|
|
||||||
- pio_env: native-tft
|
|
||||||
platform: linux/arm/v7
|
|
||||||
uses: ./.github/workflows/docker_build.yml
|
|
||||||
with:
|
|
||||||
distro: ${{ matrix.distro }}
|
|
||||||
platform: ${{ matrix.platform }}
|
|
||||||
runs-on: ${{ contains(matrix.platform, 'arm') && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
|
|
||||||
pio_env: ${{ matrix.pio_env }}
|
|
||||||
push: false
|
|
||||||
|
|
||||||
gather-artifacts:
|
|
||||||
# trunk-ignore(checkov/CKV2_GHA_1)
|
|
||||||
if: github.repository == 'meshtastic/firmware'
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
arch:
|
|
||||||
- esp32
|
|
||||||
- esp32s3
|
|
||||||
- esp32c3
|
|
||||||
- esp32c6
|
|
||||||
- nrf52840
|
|
||||||
- rp2040
|
|
||||||
- rp2350
|
|
||||||
- stm32
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [version, build]
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v6
|
|
||||||
with:
|
|
||||||
path: ./
|
|
||||||
pattern: firmware-${{matrix.arch}}-*
|
|
||||||
merge-multiple: true
|
|
||||||
|
|
||||||
- name: Display structure of downloaded files
|
|
||||||
run: ls -R
|
|
||||||
|
|
||||||
- name: Move files up
|
|
||||||
run: mv -b -t ./ ./bin/device-*.sh ./bin/device-*.bat
|
|
||||||
|
|
||||||
- name: Repackage in single firmware zip
|
|
||||||
uses: actions/upload-artifact@v5
|
|
||||||
with:
|
|
||||||
name: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}
|
|
||||||
overwrite: true
|
|
||||||
path: |
|
|
||||||
./firmware-*.bin
|
|
||||||
./firmware-*.uf2
|
|
||||||
./firmware-*.hex
|
|
||||||
./firmware-*-ota.zip
|
|
||||||
./device-*.sh
|
|
||||||
./device-*.bat
|
|
||||||
./littlefs-*.bin
|
|
||||||
./bleota*bin
|
|
||||||
./Meshtastic_nRF52_factory_erase*.uf2
|
|
||||||
retention-days: 30
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v6
|
|
||||||
with:
|
|
||||||
name: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}
|
|
||||||
merge-multiple: true
|
|
||||||
path: ./output
|
|
||||||
|
|
||||||
# For diagnostics
|
|
||||||
- name: Show artifacts
|
|
||||||
run: ls -lR
|
|
||||||
|
|
||||||
- name: Device scripts permissions
|
|
||||||
run: |
|
|
||||||
chmod +x ./output/device-install.sh
|
|
||||||
chmod +x ./output/device-update.sh
|
|
||||||
|
|
||||||
- name: Zip firmware
|
|
||||||
run: zip -j -9 -r ./firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip ./output
|
|
||||||
|
|
||||||
- name: Repackage in single elfs zip
|
|
||||||
uses: actions/upload-artifact@v5
|
|
||||||
with:
|
|
||||||
name: debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip
|
|
||||||
overwrite: true
|
|
||||||
path: ./*.elf
|
|
||||||
retention-days: 30
|
|
||||||
|
|
||||||
- uses: scruplelesswizard/comment-artifact@main
|
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
|
||||||
with:
|
|
||||||
name: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}
|
|
||||||
description: "Download firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip. This artifact will be available for 90 days from creation"
|
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
release-artifacts:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' && github.repository == 'meshtastic/firmware' }}
|
|
||||||
outputs:
|
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
||||||
needs:
|
|
||||||
- version
|
|
||||||
- gather-artifacts
|
|
||||||
- build-debian-src
|
|
||||||
- package-pio-deps-native-tft
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Setup Python
|
|
||||||
uses: actions/setup-python@v6
|
|
||||||
with:
|
|
||||||
python-version: 3.x
|
|
||||||
|
|
||||||
- name: Create release
|
|
||||||
uses: softprops/action-gh-release@v2
|
|
||||||
id: create_release
|
|
||||||
with:
|
|
||||||
draft: true
|
|
||||||
prerelease: true
|
|
||||||
name: Meshtastic Firmware ${{ needs.version.outputs.long }} Alpha
|
|
||||||
tag_name: v${{ needs.version.outputs.long }}
|
|
||||||
body: |
|
|
||||||
Autogenerated by github action, developer should edit as required before publishing...
|
|
||||||
|
|
||||||
- name: Download source deb
|
|
||||||
uses: actions/download-artifact@v6
|
|
||||||
with:
|
|
||||||
pattern: firmware-debian-${{ needs.version.outputs.deb }}~UNRELEASED-src
|
|
||||||
merge-multiple: true
|
|
||||||
path: ./output/debian-src
|
|
||||||
|
|
||||||
- name: Download `native-tft` pio deps
|
|
||||||
uses: actions/download-artifact@v6
|
|
||||||
with:
|
|
||||||
pattern: platformio-deps-native-tft-${{ needs.version.outputs.long }}
|
|
||||||
merge-multiple: true
|
|
||||||
path: ./output/pio-deps-native-tft
|
|
||||||
|
|
||||||
- name: Zip Linux sources
|
|
||||||
working-directory: output
|
|
||||||
run: |
|
|
||||||
zip -j -9 -r ./meshtasticd-${{ needs.version.outputs.deb }}-src.zip ./debian-src
|
|
||||||
zip -9 -r ./platformio-deps-native-tft-${{ needs.version.outputs.long }}.zip ./pio-deps-native-tft
|
|
||||||
|
|
||||||
# For diagnostics
|
|
||||||
- name: Display structure of downloaded files
|
|
||||||
run: ls -lR
|
|
||||||
|
|
||||||
- name: Add Linux sources to GtiHub Release
|
|
||||||
# Only run when targeting master branch with workflow_dispatch
|
|
||||||
if: ${{ github.ref_name == 'master' }}
|
|
||||||
run: |
|
|
||||||
gh release upload v${{ needs.version.outputs.long }} ./output/meshtasticd-${{ needs.version.outputs.deb }}-src.zip
|
|
||||||
gh release upload v${{ needs.version.outputs.long }} ./output/platformio-deps-native-tft-${{ needs.version.outputs.long }}.zip
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
release-firmware:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
arch:
|
|
||||||
- esp32
|
|
||||||
- esp32s3
|
|
||||||
- esp32c3
|
|
||||||
- esp32c6
|
|
||||||
- nrf52840
|
|
||||||
- rp2040
|
|
||||||
- rp2350
|
|
||||||
- stm32
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' && github.repository == 'meshtastic/firmware'}}
|
|
||||||
needs: [release-artifacts, version]
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Setup Python
|
|
||||||
uses: actions/setup-python@v6
|
|
||||||
with:
|
|
||||||
python-version: 3.x
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v6
|
|
||||||
with:
|
|
||||||
pattern: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}
|
|
||||||
merge-multiple: true
|
|
||||||
path: ./output
|
|
||||||
|
|
||||||
- name: Display structure of downloaded files
|
|
||||||
run: ls -lR
|
|
||||||
|
|
||||||
- name: Device scripts permissions
|
|
||||||
run: |
|
|
||||||
chmod +x ./output/device-install.sh
|
|
||||||
chmod +x ./output/device-update.sh
|
|
||||||
|
|
||||||
- name: Zip firmware
|
|
||||||
run: zip -j -9 -r ./firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip ./output
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v6
|
|
||||||
with:
|
|
||||||
name: debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip
|
|
||||||
merge-multiple: true
|
|
||||||
path: ./elfs
|
|
||||||
|
|
||||||
- name: Zip debug elfs
|
|
||||||
run: zip -j -9 -r ./debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip ./elfs
|
|
||||||
|
|
||||||
# For diagnostics
|
|
||||||
- name: Display structure of downloaded files
|
|
||||||
run: ls -lR
|
|
||||||
|
|
||||||
- name: Add bins and debug elfs to GitHub Release
|
|
||||||
# Only run when targeting master branch with workflow_dispatch
|
|
||||||
if: ${{ github.ref_name == 'master' }}
|
|
||||||
run: |
|
|
||||||
gh release upload v${{ needs.version.outputs.long }} ./firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip
|
|
||||||
gh release upload v${{ needs.version.outputs.long }} ./debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
publish-firmware:
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' }}
|
|
||||||
needs: [release-firmware, version]
|
|
||||||
env:
|
|
||||||
targets: |-
|
|
||||||
esp32,esp32s3,esp32c3,esp32c6,nrf52840,rp2040,rp2350,stm32
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Setup Python
|
|
||||||
uses: actions/setup-python@v6
|
|
||||||
with:
|
|
||||||
python-version: 3.x
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v6
|
|
||||||
with:
|
|
||||||
pattern: firmware-{${{ env.targets }}}-${{ needs.version.outputs.long }}
|
|
||||||
merge-multiple: true
|
|
||||||
path: ./publish
|
|
||||||
|
|
||||||
- name: Publish firmware to meshtastic.github.io
|
|
||||||
uses: peaceiris/actions-gh-pages@v4
|
|
||||||
env:
|
|
||||||
# On event/* branches, use the event name as the destination prefix
|
|
||||||
DEST_PREFIX: ${{ contains(github.ref_name, 'event/') && format('{0}/', github.ref_name) || '' }}
|
|
||||||
with:
|
|
||||||
deploy_key: ${{ secrets.DIST_PAGES_DEPLOY_KEY }}
|
|
||||||
external_repository: meshtastic/meshtastic.github.io
|
|
||||||
publish_branch: master
|
|
||||||
publish_dir: ./publish
|
|
||||||
destination_dir: ${{ env.DEST_PREFIX }}firmware-${{ needs.version.outputs.long }}
|
|
||||||
keep_files: true
|
|
||||||
user_name: github-actions[bot]
|
|
||||||
user_email: github-actions[bot]@users.noreply.github.com
|
|
||||||
commit_message: ${{ needs.version.outputs.long }}
|
|
||||||
enable_jekyll: true
|
|
||||||
@@ -1,376 +0,0 @@
|
|||||||
name: Merge Queue
|
|
||||||
# Not sure how concurrency works in merge_queue, removing for now.
|
|
||||||
# concurrency:
|
|
||||||
# group: merge-queue-${{ github.head_ref || github.run_id }}
|
|
||||||
# cancel-in-progress: true
|
|
||||||
on:
|
|
||||||
# Merge group is a special trigger that is used to trigger the workflow when a merge group is created.
|
|
||||||
merge_group:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
setup:
|
|
||||||
strategy:
|
|
||||||
fail-fast: true
|
|
||||||
matrix:
|
|
||||||
arch:
|
|
||||||
- all
|
|
||||||
- check
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
- uses: actions/setup-python@v6
|
|
||||||
with:
|
|
||||||
python-version: 3.x
|
|
||||||
cache: pip
|
|
||||||
- run: pip install -U platformio
|
|
||||||
- name: Generate matrix
|
|
||||||
id: jsonStep
|
|
||||||
run: |
|
|
||||||
if [[ "$GITHUB_HEAD_REF" == "" ]]; then
|
|
||||||
TARGETS=$(./bin/generate_ci_matrix.py ${{matrix.arch}})
|
|
||||||
else
|
|
||||||
TARGETS=$(./bin/generate_ci_matrix.py ${{matrix.arch}} --level pr)
|
|
||||||
fi
|
|
||||||
echo "Name: $GITHUB_REF_NAME Base: $GITHUB_BASE_REF Ref: $GITHUB_REF"
|
|
||||||
echo "${{matrix.arch}}=$TARGETS" >> $GITHUB_OUTPUT
|
|
||||||
outputs:
|
|
||||||
all: ${{ steps.jsonStep.outputs.all }}
|
|
||||||
check: ${{ steps.jsonStep.outputs.check }}
|
|
||||||
|
|
||||||
version:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
- name: Get release version string
|
|
||||||
run: |
|
|
||||||
echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
|
||||||
echo "deb=$(./bin/buildinfo.py deb)" >> $GITHUB_OUTPUT
|
|
||||||
id: version
|
|
||||||
env:
|
|
||||||
BUILD_LOCATION: local
|
|
||||||
outputs:
|
|
||||||
long: ${{ steps.version.outputs.long }}
|
|
||||||
deb: ${{ steps.version.outputs.deb }}
|
|
||||||
|
|
||||||
check:
|
|
||||||
needs: setup
|
|
||||||
strategy:
|
|
||||||
fail-fast: true
|
|
||||||
matrix:
|
|
||||||
check: ${{ fromJson(needs.setup.outputs.check) }}
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: ${{ github.event_name != 'workflow_dispatch' }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
- name: Build base
|
|
||||||
id: base
|
|
||||||
uses: ./.github/actions/setup-base
|
|
||||||
- name: Check ${{ matrix.check.board }}
|
|
||||||
run: bin/check-all.sh ${{ matrix.check.board }}
|
|
||||||
|
|
||||||
build:
|
|
||||||
needs: [setup, version]
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
build: ${{ fromJson(needs.setup.outputs.all) }}
|
|
||||||
uses: ./.github/workflows/build_firmware.yml
|
|
||||||
with:
|
|
||||||
version: ${{ needs.version.outputs.long }}
|
|
||||||
pio_env: ${{ matrix.build.board }}
|
|
||||||
platform: ${{ matrix.build.platform }}
|
|
||||||
|
|
||||||
build-debian-src:
|
|
||||||
if: github.repository == 'meshtastic/firmware'
|
|
||||||
uses: ./.github/workflows/build_debian_src.yml
|
|
||||||
with:
|
|
||||||
series: UNRELEASED
|
|
||||||
build_location: local
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
package-pio-deps-native-tft:
|
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' }}
|
|
||||||
uses: ./.github/workflows/package_pio_deps.yml
|
|
||||||
with:
|
|
||||||
pio_env: native-tft
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
test-native:
|
|
||||||
if: ${{ !contains(github.ref_name, 'event/') }}
|
|
||||||
uses: ./.github/workflows/test_native.yml
|
|
||||||
|
|
||||||
docker:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
distro: [debian, alpine]
|
|
||||||
platform: [linux/amd64, linux/arm64, linux/arm/v7]
|
|
||||||
pio_env: [native, native-tft]
|
|
||||||
exclude:
|
|
||||||
- distro: alpine
|
|
||||||
platform: linux/arm/v7
|
|
||||||
- pio_env: native-tft
|
|
||||||
platform: linux/arm64
|
|
||||||
- pio_env: native-tft
|
|
||||||
platform: linux/arm/v7
|
|
||||||
uses: ./.github/workflows/docker_build.yml
|
|
||||||
with:
|
|
||||||
distro: ${{ matrix.distro }}
|
|
||||||
platform: ${{ matrix.platform }}
|
|
||||||
runs-on: ${{ contains(matrix.platform, 'arm') && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
|
|
||||||
pio_env: ${{ matrix.pio_env }}
|
|
||||||
push: false
|
|
||||||
|
|
||||||
gather-artifacts:
|
|
||||||
# trunk-ignore(checkov/CKV2_GHA_1)
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
arch:
|
|
||||||
- esp32
|
|
||||||
- esp32s3
|
|
||||||
- esp32c3
|
|
||||||
- esp32c6
|
|
||||||
- nrf52840
|
|
||||||
- rp2040
|
|
||||||
- rp2350
|
|
||||||
- stm32
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [version, build]
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v6
|
|
||||||
with:
|
|
||||||
path: ./
|
|
||||||
pattern: firmware-${{matrix.arch}}-*
|
|
||||||
merge-multiple: true
|
|
||||||
|
|
||||||
- name: Display structure of downloaded files
|
|
||||||
run: ls -R
|
|
||||||
|
|
||||||
- name: Move files up
|
|
||||||
run: mv -b -t ./ ./bin/device-*.sh ./bin/device-*.bat
|
|
||||||
|
|
||||||
- name: Repackage in single firmware zip
|
|
||||||
uses: actions/upload-artifact@v5
|
|
||||||
with:
|
|
||||||
name: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}
|
|
||||||
overwrite: true
|
|
||||||
path: |
|
|
||||||
./firmware-*.bin
|
|
||||||
./firmware-*.uf2
|
|
||||||
./firmware-*.hex
|
|
||||||
./firmware-*-ota.zip
|
|
||||||
./device-*.sh
|
|
||||||
./device-*.bat
|
|
||||||
./littlefs-*.bin
|
|
||||||
./bleota*bin
|
|
||||||
./Meshtastic_nRF52_factory_erase*.uf2
|
|
||||||
retention-days: 30
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v6
|
|
||||||
with:
|
|
||||||
name: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}
|
|
||||||
merge-multiple: true
|
|
||||||
path: ./output
|
|
||||||
|
|
||||||
# For diagnostics
|
|
||||||
- name: Show artifacts
|
|
||||||
run: ls -lR
|
|
||||||
|
|
||||||
- name: Device scripts permissions
|
|
||||||
run: |
|
|
||||||
chmod +x ./output/device-install.sh
|
|
||||||
chmod +x ./output/device-update.sh
|
|
||||||
|
|
||||||
- name: Zip firmware
|
|
||||||
run: zip -j -9 -r ./firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip ./output
|
|
||||||
|
|
||||||
- name: Repackage in single elfs zip
|
|
||||||
uses: actions/upload-artifact@v5
|
|
||||||
with:
|
|
||||||
name: debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip
|
|
||||||
overwrite: true
|
|
||||||
path: ./*.elf
|
|
||||||
retention-days: 30
|
|
||||||
|
|
||||||
- uses: scruplelesswizard/comment-artifact@main
|
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
|
||||||
with:
|
|
||||||
name: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}
|
|
||||||
description: "Download firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip. This artifact will be available for 90 days from creation"
|
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
release-artifacts:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' }}
|
|
||||||
outputs:
|
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
||||||
needs:
|
|
||||||
- version
|
|
||||||
- gather-artifacts
|
|
||||||
- build-debian-src
|
|
||||||
- package-pio-deps-native-tft
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Setup Python
|
|
||||||
uses: actions/setup-python@v6
|
|
||||||
with:
|
|
||||||
python-version: 3.x
|
|
||||||
|
|
||||||
- name: Create release
|
|
||||||
uses: softprops/action-gh-release@v2
|
|
||||||
id: create_release
|
|
||||||
with:
|
|
||||||
draft: true
|
|
||||||
prerelease: true
|
|
||||||
name: Meshtastic Firmware ${{ needs.version.outputs.long }} Alpha
|
|
||||||
tag_name: v${{ needs.version.outputs.long }}
|
|
||||||
body: |
|
|
||||||
Autogenerated by github action, developer should edit as required before publishing...
|
|
||||||
|
|
||||||
- name: Download source deb
|
|
||||||
uses: actions/download-artifact@v6
|
|
||||||
with:
|
|
||||||
pattern: firmware-debian-${{ needs.version.outputs.deb }}~UNRELEASED-src
|
|
||||||
merge-multiple: true
|
|
||||||
path: ./output/debian-src
|
|
||||||
|
|
||||||
- name: Download `native-tft` pio deps
|
|
||||||
uses: actions/download-artifact@v6
|
|
||||||
with:
|
|
||||||
pattern: platformio-deps-native-tft-${{ needs.version.outputs.long }}
|
|
||||||
merge-multiple: true
|
|
||||||
path: ./output/pio-deps-native-tft
|
|
||||||
|
|
||||||
- name: Zip Linux sources
|
|
||||||
working-directory: output
|
|
||||||
run: |
|
|
||||||
zip -j -9 -r ./meshtasticd-${{ needs.version.outputs.deb }}-src.zip ./debian-src
|
|
||||||
zip -9 -r ./platformio-deps-native-tft-${{ needs.version.outputs.long }}.zip ./pio-deps-native-tft
|
|
||||||
|
|
||||||
# For diagnostics
|
|
||||||
- name: Display structure of downloaded files
|
|
||||||
run: ls -lR
|
|
||||||
|
|
||||||
- name: Add Linux sources to GtiHub Release
|
|
||||||
# Only run when targeting master branch with workflow_dispatch
|
|
||||||
if: ${{ github.ref_name == 'master' }}
|
|
||||||
run: |
|
|
||||||
gh release upload v${{ needs.version.outputs.long }} ./output/meshtasticd-${{ needs.version.outputs.deb }}-src.zip
|
|
||||||
gh release upload v${{ needs.version.outputs.long }} ./output/platformio-deps-native-tft-${{ needs.version.outputs.long }}.zip
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
release-firmware:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
arch:
|
|
||||||
- esp32
|
|
||||||
- esp32s3
|
|
||||||
- esp32c3
|
|
||||||
- esp32c6
|
|
||||||
- nrf52840
|
|
||||||
- rp2040
|
|
||||||
- rp2350
|
|
||||||
- stm32
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' }}
|
|
||||||
needs: [release-artifacts, version]
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Setup Python
|
|
||||||
uses: actions/setup-python@v6
|
|
||||||
with:
|
|
||||||
python-version: 3.x
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v6
|
|
||||||
with:
|
|
||||||
pattern: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}
|
|
||||||
merge-multiple: true
|
|
||||||
path: ./output
|
|
||||||
|
|
||||||
- name: Display structure of downloaded files
|
|
||||||
run: ls -lR
|
|
||||||
|
|
||||||
- name: Device scripts permissions
|
|
||||||
run: |
|
|
||||||
chmod +x ./output/device-install.sh
|
|
||||||
chmod +x ./output/device-update.sh
|
|
||||||
|
|
||||||
- name: Zip firmware
|
|
||||||
run: zip -j -9 -r ./firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip ./output
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v6
|
|
||||||
with:
|
|
||||||
name: debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip
|
|
||||||
merge-multiple: true
|
|
||||||
path: ./elfs
|
|
||||||
|
|
||||||
- name: Zip debug elfs
|
|
||||||
run: zip -j -9 -r ./debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip ./elfs
|
|
||||||
|
|
||||||
# For diagnostics
|
|
||||||
- name: Display structure of downloaded files
|
|
||||||
run: ls -lR
|
|
||||||
|
|
||||||
- name: Add bins and debug elfs to GitHub Release
|
|
||||||
# Only run when targeting master branch with workflow_dispatch
|
|
||||||
if: ${{ github.ref_name == 'master' }}
|
|
||||||
run: |
|
|
||||||
gh release upload v${{ needs.version.outputs.long }} ./firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip
|
|
||||||
gh release upload v${{ needs.version.outputs.long }} ./debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
publish-firmware:
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' }}
|
|
||||||
needs: [release-firmware, version]
|
|
||||||
env:
|
|
||||||
targets: |-
|
|
||||||
esp32,esp32s3,esp32c3,esp32c6,nrf52840,rp2040,rp2350,stm32
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Setup Python
|
|
||||||
uses: actions/setup-python@v6
|
|
||||||
with:
|
|
||||||
python-version: 3.x
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v6
|
|
||||||
with:
|
|
||||||
pattern: firmware-{${{ env.targets }}}-${{ needs.version.outputs.long }}
|
|
||||||
merge-multiple: true
|
|
||||||
path: ./publish
|
|
||||||
|
|
||||||
- name: Publish firmware to meshtastic.github.io
|
|
||||||
uses: peaceiris/actions-gh-pages@v4
|
|
||||||
env:
|
|
||||||
# On event/* branches, use the event name as the destination prefix
|
|
||||||
DEST_PREFIX: ${{ contains(github.ref_name, 'event/') && format('{0}/', github.ref_name) || '' }}
|
|
||||||
with:
|
|
||||||
deploy_key: ${{ secrets.DIST_PAGES_DEPLOY_KEY }}
|
|
||||||
external_repository: meshtastic/meshtastic.github.io
|
|
||||||
publish_branch: master
|
|
||||||
publish_dir: ./publish
|
|
||||||
destination_dir: ${{ env.DEST_PREFIX }}firmware-${{ needs.version.outputs.long }}
|
|
||||||
keep_files: true
|
|
||||||
user_name: github-actions[bot]
|
|
||||||
user_email: github-actions[bot]@users.noreply.github.com
|
|
||||||
commit_message: ${{ needs.version.outputs.long }}
|
|
||||||
enable_jekyll: true
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
name: Nightly
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: 0 8 * * 1-5
|
|
||||||
workflow_dispatch: {}
|
|
||||||
|
|
||||||
permissions: read-all
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
trunk_check:
|
|
||||||
if: github.repository == 'meshtastic/firmware'
|
|
||||||
name: Trunk Check and Upload
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Trunk Check
|
|
||||||
uses: trunk-io/trunk-action@v1
|
|
||||||
with:
|
|
||||||
trunk-token: ${{ secrets.TRUNK_TOKEN }}
|
|
||||||
|
|
||||||
trunk_upgrade:
|
|
||||||
if: github.repository == 'meshtastic/firmware'
|
|
||||||
# See: https://github.com/trunk-io/trunk-action/blob/v1/readme.md#automatic-upgrades
|
|
||||||
name: Trunk Upgrade (PR)
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
permissions:
|
|
||||||
contents: write # For trunk to create PRs
|
|
||||||
pull-requests: write # For trunk to create PRs
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Trunk Upgrade
|
|
||||||
uses: trunk-io/trunk-action/upgrade@v1
|
|
||||||
with:
|
|
||||||
base: master
|
|
||||||
@@ -1,110 +0,0 @@
|
|||||||
name: Package for OpenSUSE Build Service
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
secrets:
|
|
||||||
OBS_PASSWORD:
|
|
||||||
required: true
|
|
||||||
PPA_GPG_PRIVATE_KEY:
|
|
||||||
required: true
|
|
||||||
inputs:
|
|
||||||
obs_project:
|
|
||||||
description: Meshtastic OBS project to target
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
series:
|
|
||||||
description: Debian series to target
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-debian-src:
|
|
||||||
uses: ./.github/workflows/build_debian_src.yml
|
|
||||||
secrets: inherit
|
|
||||||
with:
|
|
||||||
series: ${{ inputs.series }}
|
|
||||||
build_location: obs
|
|
||||||
|
|
||||||
package-obs:
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
needs: build-debian-src
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
path: meshtasticd
|
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- name: Install OpenSUSE Build Service deps
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo 'deb http://download.opensuse.org/repositories/openSUSE:/Tools/xUbuntu_24.04/ /' | sudo tee /etc/apt/sources.list.d/openSUSE:Tools.list
|
|
||||||
curl -fsSL https://download.opensuse.org/repositories/openSUSE:Tools/xUbuntu_24.04/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/openSUSE_Tools.gpg > /dev/null
|
|
||||||
sudo apt-get update -y --fix-missing
|
|
||||||
sudo apt-get install -y osc
|
|
||||||
|
|
||||||
- name: Get release version string
|
|
||||||
working-directory: meshtasticd
|
|
||||||
run: |
|
|
||||||
echo "deb=$(./bin/buildinfo.py deb)" >> $GITHUB_OUTPUT
|
|
||||||
env:
|
|
||||||
BUILD_LOCATION: obs
|
|
||||||
id: version
|
|
||||||
|
|
||||||
- name: Download artifacts
|
|
||||||
uses: actions/download-artifact@v6
|
|
||||||
with:
|
|
||||||
name: firmware-debian-${{ steps.version.outputs.deb }}~${{ inputs.series }}-src
|
|
||||||
merge-multiple: true
|
|
||||||
|
|
||||||
- name: Display structure of downloaded files
|
|
||||||
run: ls -lah
|
|
||||||
|
|
||||||
- name: Configure osc
|
|
||||||
env:
|
|
||||||
OBS_USERNAME: meshtastic
|
|
||||||
run: |
|
|
||||||
# Setup OpenSUSE Build Service credentials
|
|
||||||
mkdir -p ~/.config/osc
|
|
||||||
echo "[general]" > ~/.config/osc/oscrc
|
|
||||||
echo "apiurl=https://api.opensuse.org" >> ~/.config/osc/oscrc
|
|
||||||
echo "[https://api.opensuse.org]" >> ~/.config/osc/oscrc
|
|
||||||
echo "user=${{ env.OBS_USERNAME }}" >> ~/.config/osc/oscrc
|
|
||||||
echo "pass=${{ secrets.OBS_PASSWORD }}" >> ~/.config/osc/oscrc
|
|
||||||
echo "credentials_mgr_class=osc.credentials.PlaintextConfigFileCredentialsManager" >> ~/.config/osc/oscrc
|
|
||||||
# Create a temporary directory for osc checkout
|
|
||||||
mkdir -p osc
|
|
||||||
|
|
||||||
# Intentionally fail if credentials are invalid
|
|
||||||
# Update secrets if this returns `401`
|
|
||||||
- name: Verify OBS authentication
|
|
||||||
run: osc token
|
|
||||||
|
|
||||||
- name: Upload package to OBS
|
|
||||||
shell: bash
|
|
||||||
working-directory: osc
|
|
||||||
env:
|
|
||||||
OBS_PROJECT: ${{ inputs.obs_project }}
|
|
||||||
OBS_PACKAGE: meshtasticd
|
|
||||||
run: |
|
|
||||||
# Initialize the package in the current directory
|
|
||||||
osc checkout --output-dir . $OBS_PROJECT $OBS_PACKAGE
|
|
||||||
|
|
||||||
# Remove the existing package files
|
|
||||||
rm -rf *.dsc *.tar.xz
|
|
||||||
|
|
||||||
# Copy new package files to the directory
|
|
||||||
cp $GITHUB_WORKSPACE/*.dsc .
|
|
||||||
cp $GITHUB_WORKSPACE/*.tar.xz .
|
|
||||||
|
|
||||||
# Add/Remove the files
|
|
||||||
osc addremove
|
|
||||||
|
|
||||||
# Commit changes and push to OpenSUSE Build Service
|
|
||||||
osc commit -m "GitHub Actions: ${{ steps.version.outputs.deb }}~${{ inputs.series }}"
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
name: Package PlatformIO Library Dependencies
|
|
||||||
# trunk-ignore-all(checkov/CKV_GHA_7): Allow workflow_dispatch inputs for testing
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
pio_env:
|
|
||||||
description: PlatformIO environment to target
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
pio_env:
|
|
||||||
description: PlatformIO environment to target
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
pkg-pio-libdeps:
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- name: Setup Python
|
|
||||||
uses: actions/setup-python@v6
|
|
||||||
with:
|
|
||||||
python-version: 3.x
|
|
||||||
|
|
||||||
- name: Install deps
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
pip install platformio
|
|
||||||
|
|
||||||
- name: Get release version string
|
|
||||||
run: |
|
|
||||||
echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
|
||||||
id: version
|
|
||||||
|
|
||||||
- name: Fetch libdeps
|
|
||||||
shell: bash
|
|
||||||
run: |-
|
|
||||||
platformio pkg install -e ${{ inputs.pio_env }}
|
|
||||||
platformio pkg install -e ${{ inputs.pio_env }} -t platformio/tool-scons@4.40502.0
|
|
||||||
env:
|
|
||||||
PLATFORMIO_LIBDEPS_DIR: pio/libdeps
|
|
||||||
PLATFORMIO_PACKAGES_DIR: pio/packages
|
|
||||||
PLATFORMIO_CORE_DIR: pio/core
|
|
||||||
|
|
||||||
- name: Store binaries as an artifact
|
|
||||||
uses: actions/upload-artifact@v5
|
|
||||||
with:
|
|
||||||
name: platformio-deps-${{ inputs.pio_env }}-${{ steps.version.outputs.long }}
|
|
||||||
overwrite: true
|
|
||||||
include-hidden-files: true
|
|
||||||
path: |
|
|
||||||
pio/*
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
name: Package for Launchpad PPA
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
secrets:
|
|
||||||
PPA_GPG_PRIVATE_KEY:
|
|
||||||
required: true
|
|
||||||
inputs:
|
|
||||||
ppa_repo:
|
|
||||||
description: Meshtastic PPA to target
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
series:
|
|
||||||
description: Ubuntu series to target
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-debian-src:
|
|
||||||
uses: ./.github/workflows/build_debian_src.yml
|
|
||||||
secrets: inherit
|
|
||||||
with:
|
|
||||||
series: ${{ inputs.series }}
|
|
||||||
build_location: ppa
|
|
||||||
|
|
||||||
package-ppa:
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
needs: build-debian-src
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
path: meshtasticd
|
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- name: Install deps
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
sudo apt-get update -y --fix-missing
|
|
||||||
sudo apt-get install -y dput
|
|
||||||
|
|
||||||
- name: Import GPG key
|
|
||||||
uses: crazy-max/ghaction-import-gpg@v6
|
|
||||||
with:
|
|
||||||
gpg_private_key: ${{ secrets.PPA_GPG_PRIVATE_KEY }}
|
|
||||||
id: gpg
|
|
||||||
|
|
||||||
- name: Get release version string
|
|
||||||
working-directory: meshtasticd
|
|
||||||
run: |
|
|
||||||
echo "deb=$(./bin/buildinfo.py deb)" >> $GITHUB_OUTPUT
|
|
||||||
env:
|
|
||||||
BUILD_LOCATION: ppa
|
|
||||||
id: version
|
|
||||||
|
|
||||||
- name: Download artifacts
|
|
||||||
uses: actions/download-artifact@v6
|
|
||||||
with:
|
|
||||||
name: firmware-debian-${{ steps.version.outputs.deb }}~${{ inputs.series }}-src
|
|
||||||
merge-multiple: true
|
|
||||||
|
|
||||||
- name: Display structure of downloaded files
|
|
||||||
run: ls -lah
|
|
||||||
|
|
||||||
- name: Publish with dput
|
|
||||||
if: ${{ github.event_name != 'pull_request_target' && github.event_name != 'pull_request' }}
|
|
||||||
run: |
|
|
||||||
dput ${{ inputs.ppa_repo }} meshtasticd_${{ steps.version.outputs.deb }}~${{ inputs.series }}_source.changes
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
name: Check PR Labels
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
types: [opened, edited, labeled, unlabeled, synchronize, reopened]
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
pull-requests: read
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
check-label:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Check for PR labels
|
|
||||||
uses: actions/github-script@v8
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const labels = context.payload.pull_request.labels.map(label => label.name);
|
|
||||||
const requiredLabels = ['bugfix', 'enhancement', 'hardware-support', 'dependencies', 'submodules', 'github_actions', 'trunk'];
|
|
||||||
const hasRequiredLabel = labels.some(label => requiredLabels.includes(label));
|
|
||||||
if (!hasRequiredLabel) {
|
|
||||||
core.setFailed(`PR must have at least one of the following labels before it can be merged: ${requiredLabels.join(', ')}.`);
|
|
||||||
}
|
|
||||||
@@ -1,238 +0,0 @@
|
|||||||
name: Tests
|
|
||||||
|
|
||||||
# DISABLED: Changed from automatic PR triggers to manual only
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
reason:
|
|
||||||
description: "Reason for manual test run"
|
|
||||||
required: false
|
|
||||||
default: "Manual test execution"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: tests-${{ github.head_ref || github.run_id }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
actions: read
|
|
||||||
checks: write
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
native-tests:
|
|
||||||
name: "🧪 Native Tests"
|
|
||||||
if: github.repository == 'meshtastic/firmware'
|
|
||||||
uses: ./.github/workflows/test_native.yml
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
actions: read
|
|
||||||
checks: write
|
|
||||||
|
|
||||||
test-summary:
|
|
||||||
name: "📊 Test Results"
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [native-tests]
|
|
||||||
if: always()
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
actions: read
|
|
||||||
checks: write
|
|
||||||
pull-requests: write
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Get release version string
|
|
||||||
run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
|
||||||
id: version
|
|
||||||
|
|
||||||
- name: Download test artifacts
|
|
||||||
if: needs.native-tests.result != 'skipped'
|
|
||||||
uses: actions/download-artifact@v6
|
|
||||||
with:
|
|
||||||
name: platformio-test-report-${{ steps.version.outputs.long }}.zip
|
|
||||||
merge-multiple: true
|
|
||||||
|
|
||||||
- name: Parse test results and create detailed summary
|
|
||||||
id: test-results
|
|
||||||
run: |
|
|
||||||
echo "## 🧪 Test Results Summary" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
# Check overall job status first
|
|
||||||
if [[ "${{ needs.native-tests.result }}" == "success" ]]; then
|
|
||||||
echo "✅ **Overall Status**: PASSED" >> $GITHUB_STEP_SUMMARY
|
|
||||||
elif [[ "${{ needs.native-tests.result }}" == "failure" ]]; then
|
|
||||||
echo "❌ **Overall Status**: FAILED" >> $GITHUB_STEP_SUMMARY
|
|
||||||
elif [[ "${{ needs.native-tests.result }}" == "cancelled" ]]; then
|
|
||||||
echo "⏸️ **Overall Status**: CANCELLED" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "Tests were cancelled before completion." >> $GITHUB_STEP_SUMMARY
|
|
||||||
exit 0
|
|
||||||
else
|
|
||||||
echo "⚠️ **Overall Status**: SKIPPED" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "Tests were skipped." >> $GITHUB_STEP_SUMMARY
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
# Parse detailed test results if available
|
|
||||||
if [ -f "testreport.xml" ]; then
|
|
||||||
echo "### 🔍 Individual Test Results" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
python3 << 'EOF'
|
|
||||||
import xml.etree.ElementTree as ET
|
|
||||||
import os
|
|
||||||
|
|
||||||
try:
|
|
||||||
tree = ET.parse('testreport.xml')
|
|
||||||
root = tree.getroot()
|
|
||||||
|
|
||||||
total_tests = 0
|
|
||||||
passed_tests = 0
|
|
||||||
failed_tests = 0
|
|
||||||
skipped_tests = 0
|
|
||||||
|
|
||||||
# Parse testsuite elements
|
|
||||||
for testsuite in root.findall('.//testsuite'):
|
|
||||||
suite_name = testsuite.get('name', 'Unknown')
|
|
||||||
suite_tests = int(testsuite.get('tests', '0'))
|
|
||||||
suite_failures = int(testsuite.get('failures', '0'))
|
|
||||||
suite_errors = int(testsuite.get('errors', '0'))
|
|
||||||
suite_skipped = int(testsuite.get('skipped', '0'))
|
|
||||||
|
|
||||||
total_tests += suite_tests
|
|
||||||
failed_tests += suite_failures + suite_errors
|
|
||||||
skipped_tests += suite_skipped
|
|
||||||
passed_tests += suite_tests - suite_failures - suite_errors - suite_skipped
|
|
||||||
|
|
||||||
if suite_tests > 0:
|
|
||||||
status = "✅" if (suite_failures + suite_errors) == 0 else "❌"
|
|
||||||
print(f"**{status} Test Suite: {suite_name}**")
|
|
||||||
print(f"- Total: {suite_tests}")
|
|
||||||
print(f"- Passed: ✅ {suite_tests - suite_failures - suite_errors - suite_skipped}")
|
|
||||||
print(f"- Failed: ❌ {suite_failures + suite_errors}")
|
|
||||||
if suite_skipped > 0:
|
|
||||||
print(f"- Skipped: ⏭️ {suite_skipped}")
|
|
||||||
print("")
|
|
||||||
|
|
||||||
# Show individual test results for failed suites
|
|
||||||
if suite_failures + suite_errors > 0:
|
|
||||||
print("**Failed Tests:**")
|
|
||||||
for testcase in testsuite.findall('testcase'):
|
|
||||||
test_name = testcase.get('name', 'Unknown')
|
|
||||||
failure = testcase.find('failure')
|
|
||||||
error = testcase.find('error')
|
|
||||||
|
|
||||||
if failure is not None:
|
|
||||||
msg = failure.get('message', 'Unknown error')[:100]
|
|
||||||
print(f"- ❌ `{test_name}`: {msg}")
|
|
||||||
elif error is not None:
|
|
||||||
msg = error.get('message', 'Unknown error')[:100]
|
|
||||||
print(f"- ❌ `{test_name}`: ERROR - {msg}")
|
|
||||||
print("")
|
|
||||||
else:
|
|
||||||
# Show passed tests for successful suites
|
|
||||||
passed_count = 0
|
|
||||||
for testcase in testsuite.findall('testcase'):
|
|
||||||
if testcase.find('failure') is None and testcase.find('error') is None:
|
|
||||||
if passed_count < 5: # Limit to first 5 to avoid spam
|
|
||||||
test_name = testcase.get('name', 'Unknown')
|
|
||||||
print(f"- ✅ `{test_name}`: PASSED")
|
|
||||||
passed_count += 1
|
|
||||||
if passed_count > 5:
|
|
||||||
print(f"- ... and {passed_count - 5} more tests passed")
|
|
||||||
print("")
|
|
||||||
|
|
||||||
# Summary statistics
|
|
||||||
print("### 📊 Test Statistics")
|
|
||||||
print(f"- **Total Tests**: {total_tests}")
|
|
||||||
print(f"- **Passed**: ✅ {passed_tests}")
|
|
||||||
print(f"- **Failed**: ❌ {failed_tests}")
|
|
||||||
if skipped_tests > 0:
|
|
||||||
print(f"- **Skipped**: ⏭️ {skipped_tests}")
|
|
||||||
|
|
||||||
if failed_tests > 0:
|
|
||||||
print(f"\n❌ **{failed_tests} tests failed out of {total_tests} total**")
|
|
||||||
else:
|
|
||||||
print(f"\n✅ **All {total_tests} tests passed!**")
|
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
print(f"❌ Error parsing test results: {e}")
|
|
||||||
EOF
|
|
||||||
else
|
|
||||||
echo "⚠️ **No detailed test report available**" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "Test artifacts may not have been generated properly." >> $GITHUB_STEP_SUMMARY
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "---" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "View detailed logs in the [Actions tab](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
- name: Comment test results on PR
|
|
||||||
if: github.event_name == 'pull_request' && needs.native-tests.result != 'skipped'
|
|
||||||
uses: actions/github-script@v8
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const fs = require('fs');
|
|
||||||
|
|
||||||
// Read the step summary to use as PR comment
|
|
||||||
let testSummary = "## 🧪 Test Results Summary\n\n";
|
|
||||||
|
|
||||||
if ("${{ needs.native-tests.result }}" === "success") {
|
|
||||||
testSummary += "✅ **All tests passed!**\n\n";
|
|
||||||
} else if ("${{ needs.native-tests.result }}" === "failure") {
|
|
||||||
testSummary += "❌ **Some tests failed.**\n\n";
|
|
||||||
} else {
|
|
||||||
testSummary += "⚠️ **Tests did not complete normally.**\n\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
testSummary += `View detailed results: [Actions Run](${context.payload.repository.html_url}/actions/runs/${context.runId})\n\n`;
|
|
||||||
testSummary += "---\n";
|
|
||||||
testSummary += "*This comment will be automatically updated when new commits are pushed.*";
|
|
||||||
|
|
||||||
// Find existing comment
|
|
||||||
const comments = await github.rest.issues.listComments({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
issue_number: context.issue.number
|
|
||||||
});
|
|
||||||
|
|
||||||
const botComment = comments.data.find(comment =>
|
|
||||||
comment.user.type === 'Bot' &&
|
|
||||||
comment.body.includes('🧪 Test Results Summary')
|
|
||||||
);
|
|
||||||
|
|
||||||
if (botComment) {
|
|
||||||
// Update existing comment
|
|
||||||
await github.rest.issues.updateComment({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
comment_id: botComment.id,
|
|
||||||
body: testSummary
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// Create new comment
|
|
||||||
await github.rest.issues.createComment({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
issue_number: context.issue.number,
|
|
||||||
body: testSummary
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
- name: Set overall status
|
|
||||||
run: |
|
|
||||||
if [[ "${{ needs.native-tests.result }}" == "success" ]]; then
|
|
||||||
echo "All tests passed! ✅"
|
|
||||||
exit 0
|
|
||||||
else
|
|
||||||
echo "Some tests failed! ❌"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
@@ -1,112 +0,0 @@
|
|||||||
name: Trigger release workflows upon Publish
|
|
||||||
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [published, released]
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-docker:
|
|
||||||
uses: ./.github/workflows/docker_manifest.yml
|
|
||||||
with:
|
|
||||||
release_channel: |-
|
|
||||||
${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }}
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
package-ppa:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
series:
|
|
||||||
- jammy # 22.04 LTS
|
|
||||||
- noble # 24.04 LTS
|
|
||||||
- plucky # 25.04
|
|
||||||
- questing # 25.10
|
|
||||||
uses: ./.github/workflows/package_ppa.yml
|
|
||||||
with:
|
|
||||||
ppa_repo: |-
|
|
||||||
ppa:meshtastic/${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }}
|
|
||||||
series: ${{ matrix.series }}
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
package-obs:
|
|
||||||
uses: ./.github/workflows/package_obs.yml
|
|
||||||
with:
|
|
||||||
obs_project: |-
|
|
||||||
network:Meshtastic:${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }}
|
|
||||||
series: |-
|
|
||||||
${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }}
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
hook-copr:
|
|
||||||
uses: ./.github/workflows/hook_copr.yml
|
|
||||||
with:
|
|
||||||
copr_project: |-
|
|
||||||
${{ contains(github.event.release.name, 'Beta') && 'beta' || contains(github.event.release.name, 'Alpha') && 'alpha' }}
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
# Create a PR to bump version when a release is Published
|
|
||||||
bump-version:
|
|
||||||
if: github.event.action == 'published'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
pull-requests: write
|
|
||||||
contents: write
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Setup Python
|
|
||||||
uses: actions/setup-python@v6
|
|
||||||
with:
|
|
||||||
python-version: 3.x
|
|
||||||
|
|
||||||
- name: Bump version.properties
|
|
||||||
run: |
|
|
||||||
# Bump version.properties
|
|
||||||
chmod +x ./bin/bump_version.py
|
|
||||||
./bin/bump_version.py
|
|
||||||
|
|
||||||
- name: Get new release version string
|
|
||||||
run: |
|
|
||||||
echo "short=$(./bin/buildinfo.py short)" >> $GITHUB_OUTPUT
|
|
||||||
id: new_version
|
|
||||||
|
|
||||||
- name: Ensure debian deps are installed
|
|
||||||
run: |
|
|
||||||
sudo apt-get update -y --fix-missing
|
|
||||||
sudo apt-get install -y devscripts
|
|
||||||
|
|
||||||
- name: Update debian changelog
|
|
||||||
run: |
|
|
||||||
# Update debian changelog
|
|
||||||
chmod +x ./debian/ci_changelog.sh
|
|
||||||
./debian/ci_changelog.sh
|
|
||||||
|
|
||||||
- name: Bump org.meshtastic.meshtasticd.metainfo.xml
|
|
||||||
run: |
|
|
||||||
# Bump org.meshtastic.meshtasticd.metainfo.xml
|
|
||||||
pip install -r bin/bump_metainfo/requirements.txt -q
|
|
||||||
chmod +x ./bin/bump_metainfo/bump_metainfo.py
|
|
||||||
./bin/bump_metainfo/bump_metainfo.py --file bin/org.meshtastic.meshtasticd.metainfo.xml "${{ steps.new_version.outputs.short }}"
|
|
||||||
env:
|
|
||||||
PIP_DISABLE_PIP_VERSION_CHECK: 1
|
|
||||||
|
|
||||||
- name: Create Bumps pull request
|
|
||||||
uses: peter-evans/create-pull-request@v7
|
|
||||||
with:
|
|
||||||
base: ${{ github.event.repository.default_branch }}
|
|
||||||
branch: create-pull-request/bump-version
|
|
||||||
labels: github_actions
|
|
||||||
title: Bump release version
|
|
||||||
commit-message: Automated version bumps
|
|
||||||
add-paths: |
|
|
||||||
version.properties
|
|
||||||
debian/changelog
|
|
||||||
bin/org.meshtastic.meshtasticd.metainfo.xml
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
---
|
|
||||||
name: Semgrep Full Scan
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: 0 1 * * 6
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
actions: read
|
|
||||||
contents: read
|
|
||||||
security-events: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
semgrep-full:
|
|
||||||
if: github.repository == 'meshtastic/firmware'
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
container:
|
|
||||||
image: semgrep/semgrep
|
|
||||||
|
|
||||||
steps:
|
|
||||||
# step 1
|
|
||||||
- name: clone application source code
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
# step 2
|
|
||||||
- name: full scan
|
|
||||||
run: |
|
|
||||||
semgrep \
|
|
||||||
--sarif --output report.sarif \
|
|
||||||
--metrics=off \
|
|
||||||
--config="p/default"
|
|
||||||
|
|
||||||
# step 3
|
|
||||||
- name: save report as pipeline artifact
|
|
||||||
uses: actions/upload-artifact@v5
|
|
||||||
with:
|
|
||||||
name: report.sarif
|
|
||||||
overwrite: true
|
|
||||||
path: report.sarif
|
|
||||||
|
|
||||||
# step 4
|
|
||||||
- name: publish code scanning alerts
|
|
||||||
uses: github/codeql-action/upload-sarif@v4
|
|
||||||
with:
|
|
||||||
sarif_file: report.sarif
|
|
||||||
category: semgrep
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
---
|
|
||||||
name: Semgrep Differential Scan
|
|
||||||
on: pull_request
|
|
||||||
|
|
||||||
permissions: read-all
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
semgrep-diff:
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
container:
|
|
||||||
image: semgrep/semgrep
|
|
||||||
|
|
||||||
steps:
|
|
||||||
# step 1
|
|
||||||
- name: clone application source code
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
# step 2
|
|
||||||
- name: differential scan
|
|
||||||
run: |
|
|
||||||
semgrep scan \
|
|
||||||
--error \
|
|
||||||
--metrics=off \
|
|
||||||
--baseline-commit ${{ github.event.pull_request.base.sha }} \
|
|
||||||
--config="p/default"
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
name: process stale Issues and PR's
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: 0 6 * * *
|
|
||||||
workflow_dispatch: {}
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
issues: write
|
|
||||||
pull-requests: write
|
|
||||||
actions: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
stale_issues:
|
|
||||||
if: github.repository == 'meshtastic/firmware'
|
|
||||||
name: Close Stale Issues
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Stale PR+Issues
|
|
||||||
uses: actions/stale@v10.1.0
|
|
||||||
with:
|
|
||||||
days-before-stale: 45
|
|
||||||
stale-issue-message: This issue has not had any comment or update in the last month. If it is still relevant, please post update comments. If no comments are made, this issue will be closed automagically in 7 days.
|
|
||||||
close-issue-message: This issue has not had any comment since the last notice. It has been closed automatically. If this is incorrect, or the issue becomes relevant again, please request that it is reopened.
|
|
||||||
exempt-issue-labels: pinned,3.0,triaged,backlog
|
|
||||||
exempt-pr-labels: pinned,3.0,triaged,backlog
|
|
||||||
@@ -1,169 +0,0 @@
|
|||||||
name: Run Tests on Native platform
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions: {}
|
|
||||||
|
|
||||||
env:
|
|
||||||
LCOV_CAPTURE_FLAGS: --quiet --capture --include "${PWD}/src/*" --exclude '*/src/mesh/generated/*' --directory .pio/build/coverage/src --base-directory "${PWD}"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
simulator-tests:
|
|
||||||
name: Native Simulator Tests
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Setup native build
|
|
||||||
id: base
|
|
||||||
uses: ./.github/actions/setup-native
|
|
||||||
|
|
||||||
- name: Install simulator dependencies
|
|
||||||
run: pip install -U dotmap
|
|
||||||
|
|
||||||
# We now run integration test before other build steps (to quickly see runtime failures)
|
|
||||||
- name: Build for native/coverage
|
|
||||||
run: platformio run -e coverage
|
|
||||||
|
|
||||||
- name: Capture initial coverage information
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
sudo apt-get install -y lcov
|
|
||||||
lcov ${{ env.LCOV_CAPTURE_FLAGS }} --initial --output-file coverage_base.info
|
|
||||||
sed -i -e "s#${PWD}#.#" coverage_base.info # Make paths relative.
|
|
||||||
|
|
||||||
- name: Integration test
|
|
||||||
run: |
|
|
||||||
.pio/build/coverage/program -s &
|
|
||||||
PID=$!
|
|
||||||
timeout 20 bash -c "until ls -al /proc/$PID/fd | grep socket; do sleep 1; done"
|
|
||||||
echo "Simulator started, launching python test..."
|
|
||||||
python3 -c 'from meshtastic.test import testSimulator; testSimulator()'
|
|
||||||
wait
|
|
||||||
|
|
||||||
- name: Capture coverage information
|
|
||||||
if: always() # run this step even if previous step failed
|
|
||||||
run: |
|
|
||||||
lcov ${{ env.LCOV_CAPTURE_FLAGS }} --test-name integration --output-file coverage_integration.info
|
|
||||||
sed -i -e "s#${PWD}#.#" coverage_integration.info # Make paths relative.
|
|
||||||
|
|
||||||
- name: Get release version string
|
|
||||||
if: always() # run this step even if previous step failed
|
|
||||||
run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
|
||||||
id: version
|
|
||||||
|
|
||||||
- name: Save coverage information
|
|
||||||
uses: actions/upload-artifact@v5
|
|
||||||
if: always() # run this step even if previous step failed
|
|
||||||
with:
|
|
||||||
name: lcov-coverage-info-native-simulator-test-${{ steps.version.outputs.long }}.zip
|
|
||||||
overwrite: true
|
|
||||||
path: ./coverage_*.info
|
|
||||||
|
|
||||||
platformio-tests:
|
|
||||||
name: Native PlatformIO Tests
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Setup native build
|
|
||||||
id: base
|
|
||||||
uses: ./.github/actions/setup-native
|
|
||||||
|
|
||||||
- name: Get release version string
|
|
||||||
run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
|
||||||
id: version
|
|
||||||
|
|
||||||
# Disable (comment-out) BUILD_EPOCH. It causes a full rebuild between tests and resets the
|
|
||||||
# coverage information each time.
|
|
||||||
- name: Disable BUILD_EPOCH
|
|
||||||
run: sed -i 's/-DBUILD_EPOCH=$UNIX_TIME/#-DBUILD_EPOCH=$UNIX_TIME/' platformio.ini
|
|
||||||
|
|
||||||
- name: PlatformIO Tests
|
|
||||||
run: platformio test -e coverage -v --junit-output-path testreport.xml
|
|
||||||
|
|
||||||
- name: Save test results
|
|
||||||
if: always() # run this step even if previous step failed
|
|
||||||
uses: actions/upload-artifact@v5
|
|
||||||
with:
|
|
||||||
name: platformio-test-report-${{ steps.version.outputs.long }}.zip
|
|
||||||
overwrite: true
|
|
||||||
path: ./testreport.xml
|
|
||||||
|
|
||||||
- name: Capture coverage information
|
|
||||||
if: always() # run this step even if previous step failed
|
|
||||||
run: |
|
|
||||||
sudo apt-get install -y lcov
|
|
||||||
lcov ${{ env.LCOV_CAPTURE_FLAGS }} --test-name tests --output-file coverage_tests.info
|
|
||||||
sed -i -e "s#${PWD}#.#" coverage_tests.info # Make paths relative.
|
|
||||||
|
|
||||||
- name: Save coverage information
|
|
||||||
uses: actions/upload-artifact@v5
|
|
||||||
if: always() # run this step even if previous step failed
|
|
||||||
with:
|
|
||||||
name: lcov-coverage-info-native-platformio-tests-${{ steps.version.outputs.long }}.zip
|
|
||||||
overwrite: true
|
|
||||||
path: ./coverage_*.info
|
|
||||||
|
|
||||||
generate-reports:
|
|
||||||
name: Generate Test Reports
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions: # Needed for dorny/test-reporter.
|
|
||||||
contents: read
|
|
||||||
actions: read
|
|
||||||
checks: write
|
|
||||||
needs:
|
|
||||||
- simulator-tests
|
|
||||||
- platformio-tests
|
|
||||||
if: always()
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- name: Get release version string
|
|
||||||
run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
|
||||||
id: version
|
|
||||||
|
|
||||||
- name: Download test artifacts
|
|
||||||
uses: actions/download-artifact@v6
|
|
||||||
with:
|
|
||||||
name: platformio-test-report-${{ steps.version.outputs.long }}.zip
|
|
||||||
merge-multiple: true
|
|
||||||
|
|
||||||
- name: Test Report
|
|
||||||
uses: dorny/test-reporter@v2.1.1
|
|
||||||
with:
|
|
||||||
name: PlatformIO Tests
|
|
||||||
path: testreport.xml
|
|
||||||
reporter: java-junit
|
|
||||||
|
|
||||||
- name: Download coverage artifacts
|
|
||||||
uses: actions/download-artifact@v6
|
|
||||||
with:
|
|
||||||
pattern: lcov-coverage-info-native-*-${{ steps.version.outputs.long }}.zip
|
|
||||||
path: code-coverage-report
|
|
||||||
merge-multiple: true
|
|
||||||
|
|
||||||
- name: Generate Code Coverage Report
|
|
||||||
run: |
|
|
||||||
sudo apt-get install -y lcov
|
|
||||||
lcov --quiet --add-tracefile code-coverage-report/coverage_base.info --add-tracefile code-coverage-report/coverage_integration.info --add-tracefile code-coverage-report/coverage_tests.info --output-file code-coverage-report/coverage_src.info
|
|
||||||
genhtml --quiet --legend --prefix "${PWD}" code-coverage-report/coverage_src.info --output-directory code-coverage-report
|
|
||||||
|
|
||||||
- name: Save Code Coverage Report
|
|
||||||
uses: actions/upload-artifact@v5
|
|
||||||
with:
|
|
||||||
name: code-coverage-report-${{ steps.version.outputs.long }}.zip
|
|
||||||
path: code-coverage-report
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
name: End to end tests
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: 0 0 * * * # Run every day at midnight
|
|
||||||
workflow_dispatch: {}
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
actions: read
|
|
||||||
checks: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
native-tests:
|
|
||||||
if: github.repository == 'meshtastic/firmware'
|
|
||||||
uses: ./.github/workflows/test_native.yml
|
|
||||||
|
|
||||||
hardware-tests:
|
|
||||||
if: github.repository == 'meshtastic/firmware'
|
|
||||||
runs-on: test-runner
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
# - uses: actions/setup-python@v5
|
|
||||||
# with:
|
|
||||||
# python-version: '3.10'
|
|
||||||
|
|
||||||
# pipx install "setuptools<72"
|
|
||||||
- name: Upgrade python tools
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
pipx install adafruit-nrfutil
|
|
||||||
pipx install poetry
|
|
||||||
pipx install meshtastic --pip-args=--pre
|
|
||||||
|
|
||||||
- name: Install PlatformIO from script
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
curl -fsSL -o get-platformio.py https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py
|
|
||||||
python3 get-platformio.py
|
|
||||||
|
|
||||||
- name: Upgrade platformio
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
export PATH=$PATH:$HOME/.local/bin
|
|
||||||
pio upgrade
|
|
||||||
|
|
||||||
- name: Setup Node
|
|
||||||
uses: actions/setup-node@v6
|
|
||||||
with:
|
|
||||||
node-version: 24
|
|
||||||
|
|
||||||
- name: Setup pnpm
|
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
with:
|
|
||||||
version: latest
|
|
||||||
|
|
||||||
- name: Install dependencies, setup devices and run
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
git submodule update --init --recursive
|
|
||||||
cd meshtestic/
|
|
||||||
pnpm install
|
|
||||||
pnpm run setup
|
|
||||||
pnpm run test
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
name: Annotate PR with trunk issues
|
|
||||||
# See: https://github.com/trunk-io/trunk-action/blob/v1/readme.md#getting-inline-annotations-for-fork-prs
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_run:
|
|
||||||
workflows: [Pull Request] # Name from `trunk_check.yml`
|
|
||||||
types: [completed]
|
|
||||||
|
|
||||||
permissions: read-all
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
trunk_check:
|
|
||||||
name: Trunk Code Quality Annotate
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
permissions:
|
|
||||||
checks: write # For trunk to post annotations
|
|
||||||
contents: read # For repo checkout
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Trunk Check
|
|
||||||
uses: trunk-io/trunk-action@v1
|
|
||||||
with:
|
|
||||||
post-annotations: true
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
name: Pull Request
|
|
||||||
on: [pull_request]
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.head_ref || github.run_id }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
permissions: read-all
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
trunk_check:
|
|
||||||
name: Trunk Check Runner
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
permissions:
|
|
||||||
checks: write # For trunk to post annotations
|
|
||||||
contents: read # For repo checkout
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Trunk Check
|
|
||||||
uses: trunk-io/trunk-action@v1
|
|
||||||
with:
|
|
||||||
save-annotations: true
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
name: Run Trunk Fmt on PR Comment
|
|
||||||
|
|
||||||
on:
|
|
||||||
issue_comment:
|
|
||||||
types: [created]
|
|
||||||
|
|
||||||
permissions: read-all
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
trunk-fmt:
|
|
||||||
if: github.event.issue.pull_request != null && contains(github.event.comment.body, 'trunk fmt')
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
|
||||||
|
|
||||||
- name: Install trunk
|
|
||||||
run: curl https://get.trunk.io -fsSL | bash
|
|
||||||
|
|
||||||
- name: Run Trunk Fmt
|
|
||||||
run: trunk fmt
|
|
||||||
|
|
||||||
- name: Get release version string
|
|
||||||
run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT
|
|
||||||
id: version
|
|
||||||
|
|
||||||
- name: Commit and push changes
|
|
||||||
run: |
|
|
||||||
git config --global user.name "github-actions[bot]"
|
|
||||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
|
||||||
git add .
|
|
||||||
git commit -m "Add firmware version ${{ steps.version.outputs.long }}"
|
|
||||||
git push
|
|
||||||
|
|
||||||
- name: Comment on PR
|
|
||||||
uses: actions/github-script@v8
|
|
||||||
with:
|
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
script: |
|
|
||||||
github.issues.createComment({
|
|
||||||
issue_number: context.issue.number,
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
body: '`trunk fmt` has been run on this PR.'
|
|
||||||
})
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
name: Update protobufs and regenerate classes
|
|
||||||
on: workflow_dispatch
|
|
||||||
|
|
||||||
permissions: read-all
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
update-protobufs:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
submodules: true
|
|
||||||
|
|
||||||
- name: Update submodule
|
|
||||||
if: ${{ github.ref == 'refs/heads/master' }}
|
|
||||||
run: |
|
|
||||||
git submodule update --remote protobufs
|
|
||||||
|
|
||||||
- name: Download nanopb
|
|
||||||
run: |
|
|
||||||
wget https://jpa.kapsi.fi/nanopb/download/nanopb-0.4.9.1-linux-x86.tar.gz
|
|
||||||
tar xvzf nanopb-0.4.9.1-linux-x86.tar.gz
|
|
||||||
mv nanopb-0.4.9.1-linux-x86 nanopb-0.4.9
|
|
||||||
|
|
||||||
- name: Re-generate protocol buffers
|
|
||||||
run: |
|
|
||||||
./bin/regen-protos.sh
|
|
||||||
|
|
||||||
- name: Create pull request
|
|
||||||
uses: peter-evans/create-pull-request@v7
|
|
||||||
with:
|
|
||||||
branch: create-pull-request/update-protobufs
|
|
||||||
labels: submodules
|
|
||||||
title: Update protobufs and classes
|
|
||||||
commit-message: Update protobufs
|
|
||||||
add-paths: |
|
|
||||||
protobufs
|
|
||||||
src/mesh
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
.pio
|
|
||||||
pio
|
|
||||||
pio.tar
|
|
||||||
web
|
|
||||||
web.tar
|
|
||||||
|
|
||||||
# ignore vscode IDE settings files
|
|
||||||
.vscode/*
|
|
||||||
!.vscode/settings.json
|
|
||||||
!.vscode/tasks.json
|
|
||||||
!.vscode/extensions.json
|
|
||||||
*.code-workspace
|
|
||||||
|
|
||||||
.idea
|
|
||||||
.platformio
|
|
||||||
.local
|
|
||||||
.cache
|
|
||||||
|
|
||||||
.DS_Store
|
|
||||||
Thumbs.db
|
|
||||||
.autotools
|
|
||||||
.built
|
|
||||||
.context
|
|
||||||
.cproject
|
|
||||||
.vagrant
|
|
||||||
nanopb*
|
|
||||||
flash.uf2
|
|
||||||
cmake-build*
|
|
||||||
__pycache__
|
|
||||||
|
|
||||||
*.swp
|
|
||||||
*.swo
|
|
||||||
*~
|
|
||||||
|
|
||||||
venv/
|
|
||||||
release/
|
|
||||||
.vscode/extensions.json
|
|
||||||
/compile_commands.json
|
|
||||||
src/mesh/raspihttp/certificate.pem
|
|
||||||
src/mesh/raspihttp/private_key.pem
|
|
||||||
|
|
||||||
# Ignore logo (set at build time with platformio-custom.py)
|
|
||||||
data/boot/logo.*
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
[submodule "protobufs"]
|
|
||||||
path = protobufs
|
|
||||||
url = https://github.com/meshtastic/protobufs.git
|
|
||||||
[submodule "meshtestic"]
|
|
||||||
path = meshtestic
|
|
||||||
url = https://github.com/meshtastic/meshTestic
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
tasks:
|
|
||||||
- init: pip install platformio && pip install --upgrade pip
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
.github/workflows/main_matrix.yml
|
|
||||||
src/mesh/compression/unishox2.cpp
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
*out
|
|
||||||
*logs
|
|
||||||
*actions
|
|
||||||
*notifications
|
|
||||||
*tools
|
|
||||||
plugins
|
|
||||||
user_trunk.yaml
|
|
||||||
user.yaml
|
|
||||||
tmp
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
[bandit]
|
|
||||||
skips = B101
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
Language: Cpp
|
|
||||||
IndentWidth: 4
|
|
||||||
ColumnLimit: 130
|
|
||||||
PointerAlignment: Right
|
|
||||||
BreakBeforeBraces: Linux
|
|
||||||
AllowShortFunctionsOnASingleLine: Inline
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# Autoformatter friendly flake8 config (all formatting rules disabled)
|
|
||||||
[flake8]
|
|
||||||
extend-ignore = D1, D2, E1, E2, E3, E501, W1, W2, W3, W5
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
# Following source doesn't work in most setups
|
|
||||||
ignored:
|
|
||||||
- SC1090
|
|
||||||
- SC1091
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
[settings]
|
|
||||||
profile=black
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
# Autoformatter friendly markdownlint config (all formatting rules disabled)
|
|
||||||
default: true
|
|
||||||
blank_lines: false
|
|
||||||
bullet: false
|
|
||||||
html: false
|
|
||||||
indentation: false
|
|
||||||
line_length: false
|
|
||||||
spaces: false
|
|
||||||
url: false
|
|
||||||
whitespace: false
|
|
||||||
headings: false
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
renovate.json
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"overrides": [
|
|
||||||
{
|
|
||||||
"files": "userPrefs.jsonc",
|
|
||||||
"options": {
|
|
||||||
"trailingComma": "none"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
enable=all
|
|
||||||
source-path=SCRIPTDIR
|
|
||||||
disable=SC2154
|
|
||||||
disable=SC2248
|
|
||||||
disable=SC2250
|
|
||||||
|
|
||||||
# If you're having issues with shellcheck following source, disable the errors via:
|
|
||||||
# disable=SC1090
|
|
||||||
# disable=SC1091
|
|
||||||
#
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
rules:
|
|
||||||
quoted-strings:
|
|
||||||
required: only-when-needed
|
|
||||||
extra-allowed: ["{|}"]
|
|
||||||
empty-values:
|
|
||||||
forbid-in-block-mappings: false
|
|
||||||
forbid-in-flow-mappings: true
|
|
||||||
key-duplicates: {}
|
|
||||||
octal-values:
|
|
||||||
forbid-implicit-octal: true
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# Generic, formatter-friendly config.
|
|
||||||
select = ["B", "D3", "D4", "E", "F"]
|
|
||||||
|
|
||||||
# Never enforce `E501` (line length violations). This should be handled by formatters.
|
|
||||||
ignore = ["E501"]
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
plugins: [
|
|
||||||
{
|
|
||||||
name: "preset-default",
|
|
||||||
params: {
|
|
||||||
overrides: {
|
|
||||||
removeViewBox: false, // https://github.com/svg/svgo/issues/1128
|
|
||||||
sortAttrs: true,
|
|
||||||
removeOffCanvasPaths: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
version: 0.1
|
|
||||||
cli:
|
|
||||||
version: 1.25.0
|
|
||||||
plugins:
|
|
||||||
sources:
|
|
||||||
- id: trunk
|
|
||||||
ref: v1.7.3
|
|
||||||
uri: https://github.com/trunk-io/plugins
|
|
||||||
lint:
|
|
||||||
enabled:
|
|
||||||
- checkov@3.2.489
|
|
||||||
- renovate@41.169.1
|
|
||||||
- prettier@3.6.2
|
|
||||||
- trufflehog@3.90.12
|
|
||||||
- yamllint@1.37.1
|
|
||||||
- bandit@1.8.6
|
|
||||||
- trivy@0.67.2
|
|
||||||
- taplo@0.10.0
|
|
||||||
- ruff@0.14.3
|
|
||||||
- isort@7.0.0
|
|
||||||
- markdownlint@0.45.0
|
|
||||||
- oxipng@9.1.5
|
|
||||||
- svgo@4.0.0
|
|
||||||
- actionlint@1.7.8
|
|
||||||
- flake8@7.3.0
|
|
||||||
- hadolint@2.14.0
|
|
||||||
- shfmt@3.6.0
|
|
||||||
- shellcheck@0.11.0
|
|
||||||
- black@25.9.0
|
|
||||||
- git-diff-check
|
|
||||||
- gitleaks@8.28.0
|
|
||||||
- clang-format@16.0.3
|
|
||||||
ignore:
|
|
||||||
- linters: [ALL]
|
|
||||||
paths:
|
|
||||||
- bin/**
|
|
||||||
runtimes:
|
|
||||||
enabled:
|
|
||||||
- python@3.10.8
|
|
||||||
- go@1.21.0
|
|
||||||
- node@22.16.0
|
|
||||||
actions:
|
|
||||||
disabled:
|
|
||||||
- trunk-announce
|
|
||||||
enabled:
|
|
||||||
- trunk-fmt-pre-commit
|
|
||||||
- trunk-check-pre-push
|
|
||||||
- trunk-upgrade-available
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"editor.formatOnSave": true,
|
|
||||||
"editor.defaultFormatter": "trunk.io",
|
|
||||||
"trunk.enableWindows": true,
|
|
||||||
"files.insertFinalNewline": false,
|
|
||||||
"files.trimFinalNewlines": false,
|
|
||||||
"cmake.configureOnOpen": false,
|
|
||||||
"[cpp]": {
|
|
||||||
"editor.defaultFormatter": "trunk.io"
|
|
||||||
},
|
|
||||||
"[powershell]": {
|
|
||||||
"editor.defaultFormatter": "ms-vscode.powershell"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "2.0.0",
|
|
||||||
"tasks": [
|
|
||||||
{
|
|
||||||
"type": "PlatformIO",
|
|
||||||
"task": "Build",
|
|
||||||
"problemMatcher": ["$platformio"],
|
|
||||||
"group": {
|
|
||||||
"kind": "build",
|
|
||||||
"isDefault": true
|
|
||||||
},
|
|
||||||
"label": "PlatformIO: Build"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
# Contributor Covenant Code of Conduct
|
|
||||||
|
|
||||||
The Meshtastic Firmware project is subject to the code of conduct for the parent project, which can be found here:
|
|
||||||
https://meshtastic.org/docs/legal/conduct/
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
# Contributing to Meshtastic Firmware
|
|
||||||
|
|
||||||
We're excited that you're interested in contributing to the Meshtastic firmware! This document provides a high-level overview of how you can get involved.
|
|
||||||
|
|
||||||
## Important First Steps
|
|
||||||
|
|
||||||
Before you begin, please:
|
|
||||||
|
|
||||||
1. **Read our documentation**: Our [official documentation](https://meshtastic.org/docs/) is a crucial resource. It contains essential information about the project.
|
|
||||||
|
|
||||||
2. **Check out the firmware build guide**: For specific instructions on setting up your development environment and building the firmware, refer to our [Firmware Build Guide](https://meshtastic.org/docs/development/firmware/build/).
|
|
||||||
|
|
||||||
3. Read our [Code of Conduct](https://meshtastic.org/docs/legal/conduct/)
|
|
||||||
|
|
||||||
4. Join our [Discord community](https://discord.com/invite/ktMAKGBnBs) to connect with developers and other contributors to get help.
|
|
||||||
|
|
||||||
## Getting Help and Discussing Ideas
|
|
||||||
|
|
||||||
We encourage open communication and discussion before diving into code changes:
|
|
||||||
|
|
||||||
1. **Use GitHub Discussions**: For new ideas, questions, or to discuss potential changes, start a conversation in our [GitHub Discussions](https://github.com/meshtastic/firmware/discussions) first. This helps us collaborate and avoid duplicate work.
|
|
||||||
|
|
||||||
2. **Join our Discord**: For real-time chat and quick questions, join our [Discord server](https://discord.com/invite/ktMAKGBnBs). It's a great place to get help and connect with other developers and the community.
|
|
||||||
|
|
||||||
3. **Reporting Issues**: If you've identified a bug, please use our bug report template when creating a new issue in the [issue tracker](https://github.com/meshtastic/firmware/issues). Ensure you've searched existing issues to avoid duplicates.
|
|
||||||
|
|
||||||
## Making Contributions
|
|
||||||
|
|
||||||
> [!IMPORTANT]
|
|
||||||
> Before making any contributions, you must sign our Contributor License Agreement (CLA). You can do this by visiting https://cla-assistant.io/meshtastic/firmware. Be sure to use the GitHub account you will use to submit your contributions when signing.
|
|
||||||
|
|
||||||
1. Fork the repository
|
|
||||||
2. Create a new branch for your feature or bug fix
|
|
||||||
3. Make your changes
|
|
||||||
4. Test your changes thoroughly
|
|
||||||
5. Create a pull request with a clear description, using the provided template, of your changes. Be sure to enable "Allow edits from maintainers".
|
|
||||||
|
|
||||||
## Coding Standards
|
|
||||||
|
|
||||||
To ensure consistent code formatting across the project:
|
|
||||||
|
|
||||||
1. Install the [Trunk](https://marketplace.visualstudio.com/items?itemName=Trunk.io) extension for Visual Studio Code.
|
|
||||||
2. Before submitting your changes, run `trunk fmt` to automatically format your code according to our standards.
|
|
||||||
|
|
||||||
Adhering to these formatting guidelines helps maintain code consistency and makes the review process smoother.
|
|
||||||
|
|
||||||
Thank you for contributing to Meshtastic!
|
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
# trunk-ignore-all(trivy/DS002): We must run as root for this container
|
|
||||||
# trunk-ignore-all(hadolint/DL3002): We must run as root for this container
|
|
||||||
# trunk-ignore-all(hadolint/DL3008): Do not pin apt package versions
|
|
||||||
# trunk-ignore-all(hadolint/DL3013): Do not pin pip package versions
|
|
||||||
|
|
||||||
FROM python:3.14-slim-trixie AS builder
|
|
||||||
ARG PIO_ENV=native
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
|
||||||
ENV TZ=Etc/UTC
|
|
||||||
|
|
||||||
# Install Dependencies
|
|
||||||
ENV PIP_ROOT_USER_ACTION=ignore
|
|
||||||
RUN apt-get update && apt-get install --no-install-recommends -y \
|
|
||||||
curl wget g++ zip git ca-certificates pkg-config \
|
|
||||||
libgpiod-dev libyaml-cpp-dev libbluetooth-dev libi2c-dev libuv1-dev \
|
|
||||||
libusb-1.0-0-dev libulfius-dev liborcania-dev libssl-dev \
|
|
||||||
libx11-dev libinput-dev libxkbcommon-x11-dev \
|
|
||||||
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
|
|
||||||
&& pip install --no-cache-dir -U platformio \
|
|
||||||
&& mkdir /tmp/firmware
|
|
||||||
|
|
||||||
# Copy source code
|
|
||||||
WORKDIR /tmp/firmware
|
|
||||||
COPY . /tmp/firmware
|
|
||||||
|
|
||||||
# Build
|
|
||||||
RUN bash ./bin/build-native.sh "$PIO_ENV" && \
|
|
||||||
cp "/tmp/firmware/release/meshtasticd_linux_$(uname -m)" "/tmp/firmware/release/meshtasticd"
|
|
||||||
|
|
||||||
# Fetch web assets
|
|
||||||
RUN curl -L "https://github.com/meshtastic/web/releases/download/v$(cat /tmp/firmware/bin/web.version)/build.tar" -o /tmp/web.tar \
|
|
||||||
&& mkdir -p /tmp/web \
|
|
||||||
&& tar -xf /tmp/web.tar -C /tmp/web/ \
|
|
||||||
&& gzip -dr /tmp/web \
|
|
||||||
&& rm /tmp/web.tar
|
|
||||||
|
|
||||||
##### PRODUCTION BUILD #############
|
|
||||||
|
|
||||||
FROM debian:trixie-slim
|
|
||||||
LABEL org.opencontainers.image.title="Meshtastic" \
|
|
||||||
org.opencontainers.image.description="Debian Meshtastic daemon and web interface" \
|
|
||||||
org.opencontainers.image.url="https://meshtastic.org" \
|
|
||||||
org.opencontainers.image.documentation="https://meshtastic.org/docs/" \
|
|
||||||
org.opencontainers.image.authors="Meshtastic" \
|
|
||||||
org.opencontainers.image.licenses="GPL-3.0-or-later" \
|
|
||||||
org.opencontainers.image.source="https://github.com/meshtastic/firmware/"
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
|
||||||
ENV TZ=Etc/UTC
|
|
||||||
|
|
||||||
# nosemgrep: dockerfile.security.last-user-is-root.last-user-is-root
|
|
||||||
USER root
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get --no-install-recommends -y install \
|
|
||||||
libc-bin libc6 libgpiod3 libyaml-cpp0.8 libi2c0 libuv1t64 libusb-1.0-0-dev \
|
|
||||||
liborcania2.3 libulfius2.7t64 libssl3t64 \
|
|
||||||
libx11-6 libinput10 libxkbcommon-x11-0 \
|
|
||||||
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
|
|
||||||
&& mkdir -p /var/lib/meshtasticd \
|
|
||||||
&& mkdir -p /etc/meshtasticd/config.d \
|
|
||||||
&& mkdir -p /etc/meshtasticd/ssl
|
|
||||||
|
|
||||||
# Fetch compiled binary from the builder
|
|
||||||
COPY --from=builder /tmp/firmware/release/meshtasticd /usr/bin/
|
|
||||||
COPY --from=builder /tmp/web /usr/share/meshtasticd/web/
|
|
||||||
# Copy config templates
|
|
||||||
COPY ./bin/config.d /etc/meshtasticd/available.d
|
|
||||||
|
|
||||||
WORKDIR /var/lib/meshtasticd
|
|
||||||
VOLUME /var/lib/meshtasticd
|
|
||||||
|
|
||||||
# Expose Meshtastic TCP API port from the host
|
|
||||||
EXPOSE 4403
|
|
||||||
# Expose Meshtastic Web UI port from the host
|
|
||||||
EXPOSE 9443
|
|
||||||
|
|
||||||
CMD [ "sh", "-cx", "meshtasticd --fsdir=/var/lib/meshtasticd" ]
|
|
||||||
|
|
||||||
HEALTHCHECK NONE
|
|
||||||
@@ -1,675 +0,0 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
|
||||||
Version 3, 29 June 2007
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The GNU General Public License is a free, copyleft license for
|
|
||||||
software and other kinds of works.
|
|
||||||
|
|
||||||
The licenses for most software and other practical works are designed
|
|
||||||
to take away your freedom to share and change the works. By contrast,
|
|
||||||
the GNU General Public License is intended to guarantee your freedom to
|
|
||||||
share and change all versions of a program--to make sure it remains free
|
|
||||||
software for all its users. We, the Free Software Foundation, use the
|
|
||||||
GNU General Public License for most of our software; it applies also to
|
|
||||||
any other work released this way by its authors. You can apply it to
|
|
||||||
your programs, too.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
them if you wish), that you receive source code or can get it if you
|
|
||||||
want it, that you can change the software or use pieces of it in new
|
|
||||||
free programs, and that you know you can do these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to prevent others from denying you
|
|
||||||
these rights or asking you to surrender the rights. Therefore, you have
|
|
||||||
certain responsibilities if you distribute copies of the software, or if
|
|
||||||
you modify it: responsibilities to respect the freedom of others.
|
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
|
||||||
gratis or for a fee, you must pass on to the recipients the same
|
|
||||||
freedoms that you received. You must make sure that they, too, receive
|
|
||||||
or can get the source code. And you must show them these terms so they
|
|
||||||
know their rights.
|
|
||||||
|
|
||||||
Developers that use the GNU GPL protect your rights with two steps:
|
|
||||||
(1) assert copyright on the software, and (2) offer you this License
|
|
||||||
giving you legal permission to copy, distribute and/or modify it.
|
|
||||||
|
|
||||||
For the developers' and authors' protection, the GPL clearly explains
|
|
||||||
that there is no warranty for this free software. For both users' and
|
|
||||||
authors' sake, the GPL requires that modified versions be marked as
|
|
||||||
changed, so that their problems will not be attributed erroneously to
|
|
||||||
authors of previous versions.
|
|
||||||
|
|
||||||
Some devices are designed to deny users access to install or run
|
|
||||||
modified versions of the software inside them, although the manufacturer
|
|
||||||
can do so. This is fundamentally incompatible with the aim of
|
|
||||||
protecting users' freedom to change the software. The systematic
|
|
||||||
pattern of such abuse occurs in the area of products for individuals to
|
|
||||||
use, which is precisely where it is most unacceptable. Therefore, we
|
|
||||||
have designed this version of the GPL to prohibit the practice for those
|
|
||||||
products. If such problems arise substantially in other domains, we
|
|
||||||
stand ready to extend this provision to those domains in future versions
|
|
||||||
of the GPL, as needed to protect the freedom of users.
|
|
||||||
|
|
||||||
Finally, every program is threatened constantly by software patents.
|
|
||||||
States should not allow patents to restrict development and use of
|
|
||||||
software on general-purpose computers, but in those that do, we wish to
|
|
||||||
avoid the special danger that patents applied to a free program could
|
|
||||||
make it effectively proprietary. To prevent this, the GPL assures that
|
|
||||||
patents cannot be used to render the program non-free.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
0. Definitions.
|
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU General Public License.
|
|
||||||
|
|
||||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
|
||||||
works, such as semiconductor masks.
|
|
||||||
|
|
||||||
"The Program" refers to any copyrightable work licensed under this
|
|
||||||
License. Each licensee is addressed as "you". "Licensees" and
|
|
||||||
"recipients" may be individuals or organizations.
|
|
||||||
|
|
||||||
To "modify" a work means to copy from or adapt all or part of the work
|
|
||||||
in a fashion requiring copyright permission, other than the making of an
|
|
||||||
exact copy. The resulting work is called a "modified version" of the
|
|
||||||
earlier work or a work "based on" the earlier work.
|
|
||||||
|
|
||||||
A "covered work" means either the unmodified Program or a work based
|
|
||||||
on the Program.
|
|
||||||
|
|
||||||
To "propagate" a work means to do anything with it that, without
|
|
||||||
permission, would make you directly or secondarily liable for
|
|
||||||
infringement under applicable copyright law, except executing it on a
|
|
||||||
computer or modifying a private copy. Propagation includes copying,
|
|
||||||
distribution (with or without modification), making available to the
|
|
||||||
public, and in some countries other activities as well.
|
|
||||||
|
|
||||||
To "convey" a work means any kind of propagation that enables other
|
|
||||||
parties to make or receive copies. Mere interaction with a user through
|
|
||||||
a computer network, with no transfer of a copy, is not conveying.
|
|
||||||
|
|
||||||
An interactive user interface displays "Appropriate Legal Notices"
|
|
||||||
to the extent that it includes a convenient and prominently visible
|
|
||||||
feature that (1) displays an appropriate copyright notice, and (2)
|
|
||||||
tells the user that there is no warranty for the work (except to the
|
|
||||||
extent that warranties are provided), that licensees may convey the
|
|
||||||
work under this License, and how to view a copy of this License. If
|
|
||||||
the interface presents a list of user commands or options, such as a
|
|
||||||
menu, a prominent item in the list meets this criterion.
|
|
||||||
|
|
||||||
1. Source Code.
|
|
||||||
|
|
||||||
The "source code" for a work means the preferred form of the work
|
|
||||||
for making modifications to it. "Object code" means any non-source
|
|
||||||
form of a work.
|
|
||||||
|
|
||||||
A "Standard Interface" means an interface that either is an official
|
|
||||||
standard defined by a recognized standards body, or, in the case of
|
|
||||||
interfaces specified for a particular programming language, one that
|
|
||||||
is widely used among developers working in that language.
|
|
||||||
|
|
||||||
The "System Libraries" of an executable work include anything, other
|
|
||||||
than the work as a whole, that (a) is included in the normal form of
|
|
||||||
packaging a Major Component, but which is not part of that Major
|
|
||||||
Component, and (b) serves only to enable use of the work with that
|
|
||||||
Major Component, or to implement a Standard Interface for which an
|
|
||||||
implementation is available to the public in source code form. A
|
|
||||||
"Major Component", in this context, means a major essential component
|
|
||||||
(kernel, window system, and so on) of the specific operating system
|
|
||||||
(if any) on which the executable work runs, or a compiler used to
|
|
||||||
produce the work, or an object code interpreter used to run it.
|
|
||||||
|
|
||||||
The "Corresponding Source" for a work in object code form means all
|
|
||||||
the source code needed to generate, install, and (for an executable
|
|
||||||
work) run the object code and to modify the work, including scripts to
|
|
||||||
control those activities. However, it does not include the work's
|
|
||||||
System Libraries, or general-purpose tools or generally available free
|
|
||||||
programs which are used unmodified in performing those activities but
|
|
||||||
which are not part of the work. For example, Corresponding Source
|
|
||||||
includes interface definition files associated with source files for
|
|
||||||
the work, and the source code for shared libraries and dynamically
|
|
||||||
linked subprograms that the work is specifically designed to require,
|
|
||||||
such as by intimate data communication or control flow between those
|
|
||||||
subprograms and other parts of the work.
|
|
||||||
|
|
||||||
The Corresponding Source need not include anything that users
|
|
||||||
can regenerate automatically from other parts of the Corresponding
|
|
||||||
Source.
|
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that
|
|
||||||
same work.
|
|
||||||
|
|
||||||
2. Basic Permissions.
|
|
||||||
|
|
||||||
All rights granted under this License are granted for the term of
|
|
||||||
copyright on the Program, and are irrevocable provided the stated
|
|
||||||
conditions are met. This License explicitly affirms your unlimited
|
|
||||||
permission to run the unmodified Program. The output from running a
|
|
||||||
covered work is covered by this License only if the output, given its
|
|
||||||
content, constitutes a covered work. This License acknowledges your
|
|
||||||
rights of fair use or other equivalent, as provided by copyright law.
|
|
||||||
|
|
||||||
You may make, run and propagate covered works that you do not
|
|
||||||
convey, without conditions so long as your license otherwise remains
|
|
||||||
in force. You may convey covered works to others for the sole purpose
|
|
||||||
of having them make modifications exclusively for you, or provide you
|
|
||||||
with facilities for running those works, provided that you comply with
|
|
||||||
the terms of this License in conveying all material for which you do
|
|
||||||
not control copyright. Those thus making or running the covered works
|
|
||||||
for you must do so exclusively on your behalf, under your direction
|
|
||||||
and control, on terms that prohibit them from making any copies of
|
|
||||||
your copyrighted material outside their relationship with you.
|
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under
|
|
||||||
the conditions stated below. Sublicensing is not allowed; section 10
|
|
||||||
makes it unnecessary.
|
|
||||||
|
|
||||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
|
|
||||||
No covered work shall be deemed part of an effective technological
|
|
||||||
measure under any applicable law fulfilling obligations under article
|
|
||||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
||||||
similar laws prohibiting or restricting circumvention of such
|
|
||||||
measures.
|
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid
|
|
||||||
circumvention of technological measures to the extent such circumvention
|
|
||||||
is effected by exercising rights under this License with respect to
|
|
||||||
the covered work, and you disclaim any intention to limit operation or
|
|
||||||
modification of the work as a means of enforcing, against the work's
|
|
||||||
users, your or third parties' legal rights to forbid circumvention of
|
|
||||||
technological measures.
|
|
||||||
|
|
||||||
4. Conveying Verbatim Copies.
|
|
||||||
|
|
||||||
You may convey verbatim copies of the Program's source code as you
|
|
||||||
receive it, in any medium, provided that you conspicuously and
|
|
||||||
appropriately publish on each copy an appropriate copyright notice;
|
|
||||||
keep intact all notices stating that this License and any
|
|
||||||
non-permissive terms added in accord with section 7 apply to the code;
|
|
||||||
keep intact all notices of the absence of any warranty; and give all
|
|
||||||
recipients a copy of this License along with the Program.
|
|
||||||
|
|
||||||
You may charge any price or no price for each copy that you convey,
|
|
||||||
and you may offer support or warranty protection for a fee.
|
|
||||||
|
|
||||||
5. Conveying Modified Source Versions.
|
|
||||||
|
|
||||||
You may convey a work based on the Program, or the modifications to
|
|
||||||
produce it from the Program, in the form of source code under the
|
|
||||||
terms of section 4, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The work must carry prominent notices stating that you modified
|
|
||||||
it, and giving a relevant date.
|
|
||||||
|
|
||||||
b) The work must carry prominent notices stating that it is
|
|
||||||
released under this License and any conditions added under section
|
|
||||||
7. This requirement modifies the requirement in section 4 to
|
|
||||||
"keep intact all notices".
|
|
||||||
|
|
||||||
c) You must license the entire work, as a whole, under this
|
|
||||||
License to anyone who comes into possession of a copy. This
|
|
||||||
License will therefore apply, along with any applicable section 7
|
|
||||||
additional terms, to the whole of the work, and all its parts,
|
|
||||||
regardless of how they are packaged. This License gives no
|
|
||||||
permission to license the work in any other way, but it does not
|
|
||||||
invalidate such permission if you have separately received it.
|
|
||||||
|
|
||||||
d) If the work has interactive user interfaces, each must display
|
|
||||||
Appropriate Legal Notices; however, if the Program has interactive
|
|
||||||
interfaces that do not display Appropriate Legal Notices, your
|
|
||||||
work need not make them do so.
|
|
||||||
|
|
||||||
A compilation of a covered work with other separate and independent
|
|
||||||
works, which are not by their nature extensions of the covered work,
|
|
||||||
and which are not combined with it such as to form a larger program,
|
|
||||||
in or on a volume of a storage or distribution medium, is called an
|
|
||||||
"aggregate" if the compilation and its resulting copyright are not
|
|
||||||
used to limit the access or legal rights of the compilation's users
|
|
||||||
beyond what the individual works permit. Inclusion of a covered work
|
|
||||||
in an aggregate does not cause this License to apply to the other
|
|
||||||
parts of the aggregate.
|
|
||||||
|
|
||||||
6. Conveying Non-Source Forms.
|
|
||||||
|
|
||||||
You may convey a covered work in object code form under the terms
|
|
||||||
of sections 4 and 5, provided that you also convey the
|
|
||||||
machine-readable Corresponding Source under the terms of this License,
|
|
||||||
in one of these ways:
|
|
||||||
|
|
||||||
a) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by the
|
|
||||||
Corresponding Source fixed on a durable physical medium
|
|
||||||
customarily used for software interchange.
|
|
||||||
|
|
||||||
b) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by a
|
|
||||||
written offer, valid for at least three years and valid for as
|
|
||||||
long as you offer spare parts or customer support for that product
|
|
||||||
model, to give anyone who possesses the object code either (1) a
|
|
||||||
copy of the Corresponding Source for all the software in the
|
|
||||||
product that is covered by this License, on a durable physical
|
|
||||||
medium customarily used for software interchange, for a price no
|
|
||||||
more than your reasonable cost of physically performing this
|
|
||||||
conveying of source, or (2) access to copy the
|
|
||||||
Corresponding Source from a network server at no charge.
|
|
||||||
|
|
||||||
c) Convey individual copies of the object code with a copy of the
|
|
||||||
written offer to provide the Corresponding Source. This
|
|
||||||
alternative is allowed only occasionally and noncommercially, and
|
|
||||||
only if you received the object code with such an offer, in accord
|
|
||||||
with subsection 6b.
|
|
||||||
|
|
||||||
d) Convey the object code by offering access from a designated
|
|
||||||
place (gratis or for a charge), and offer equivalent access to the
|
|
||||||
Corresponding Source in the same way through the same place at no
|
|
||||||
further charge. You need not require recipients to copy the
|
|
||||||
Corresponding Source along with the object code. If the place to
|
|
||||||
copy the object code is a network server, the Corresponding Source
|
|
||||||
may be on a different server (operated by you or a third party)
|
|
||||||
that supports equivalent copying facilities, provided you maintain
|
|
||||||
clear directions next to the object code saying where to find the
|
|
||||||
Corresponding Source. Regardless of what server hosts the
|
|
||||||
Corresponding Source, you remain obligated to ensure that it is
|
|
||||||
available for as long as needed to satisfy these requirements.
|
|
||||||
|
|
||||||
e) Convey the object code using peer-to-peer transmission, provided
|
|
||||||
you inform other peers where the object code and Corresponding
|
|
||||||
Source of the work are being offered to the general public at no
|
|
||||||
charge under subsection 6d.
|
|
||||||
|
|
||||||
A separable portion of the object code, whose source code is excluded
|
|
||||||
from the Corresponding Source as a System Library, need not be
|
|
||||||
included in conveying the object code work.
|
|
||||||
|
|
||||||
A "User Product" is either (1) a "consumer product", which means any
|
|
||||||
tangible personal property which is normally used for personal, family,
|
|
||||||
or household purposes, or (2) anything designed or sold for incorporation
|
|
||||||
into a dwelling. In determining whether a product is a consumer product,
|
|
||||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
|
||||||
product received by a particular user, "normally used" refers to a
|
|
||||||
typical or common use of that class of product, regardless of the status
|
|
||||||
of the particular user or of the way in which the particular user
|
|
||||||
actually uses, or expects or is expected to use, the product. A product
|
|
||||||
is a consumer product regardless of whether the product has substantial
|
|
||||||
commercial, industrial or non-consumer uses, unless such uses represent
|
|
||||||
the only significant mode of use of the product.
|
|
||||||
|
|
||||||
"Installation Information" for a User Product means any methods,
|
|
||||||
procedures, authorization keys, or other information required to install
|
|
||||||
and execute modified versions of a covered work in that User Product from
|
|
||||||
a modified version of its Corresponding Source. The information must
|
|
||||||
suffice to ensure that the continued functioning of the modified object
|
|
||||||
code is in no case prevented or interfered with solely because
|
|
||||||
modification has been made.
|
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or
|
|
||||||
specifically for use in, a User Product, and the conveying occurs as
|
|
||||||
part of a transaction in which the right of possession and use of the
|
|
||||||
User Product is transferred to the recipient in perpetuity or for a
|
|
||||||
fixed term (regardless of how the transaction is characterized), the
|
|
||||||
Corresponding Source conveyed under this section must be accompanied
|
|
||||||
by the Installation Information. But this requirement does not apply
|
|
||||||
if neither you nor any third party retains the ability to install
|
|
||||||
modified object code on the User Product (for example, the work has
|
|
||||||
been installed in ROM).
|
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a
|
|
||||||
requirement to continue to provide support service, warranty, or updates
|
|
||||||
for a work that has been modified or installed by the recipient, or for
|
|
||||||
the User Product in which it has been modified or installed. Access to a
|
|
||||||
network may be denied when the modification itself materially and
|
|
||||||
adversely affects the operation of the network or violates the rules and
|
|
||||||
protocols for communication across the network.
|
|
||||||
|
|
||||||
Corresponding Source conveyed, and Installation Information provided,
|
|
||||||
in accord with this section must be in a format that is publicly
|
|
||||||
documented (and with an implementation available to the public in
|
|
||||||
source code form), and must require no special password or key for
|
|
||||||
unpacking, reading or copying.
|
|
||||||
|
|
||||||
7. Additional Terms.
|
|
||||||
|
|
||||||
"Additional permissions" are terms that supplement the terms of this
|
|
||||||
License by making exceptions from one or more of its conditions.
|
|
||||||
Additional permissions that are applicable to the entire Program shall
|
|
||||||
be treated as though they were included in this License, to the extent
|
|
||||||
that they are valid under applicable law. If additional permissions
|
|
||||||
apply only to part of the Program, that part may be used separately
|
|
||||||
under those permissions, but the entire Program remains governed by
|
|
||||||
this License without regard to the additional permissions.
|
|
||||||
|
|
||||||
When you convey a copy of a covered work, you may at your option
|
|
||||||
remove any additional permissions from that copy, or from any part of
|
|
||||||
it. (Additional permissions may be written to require their own
|
|
||||||
removal in certain cases when you modify the work.) You may place
|
|
||||||
additional permissions on material, added by you to a covered work,
|
|
||||||
for which you have or can give appropriate copyright permission.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you
|
|
||||||
add to a covered work, you may (if authorized by the copyright holders of
|
|
||||||
that material) supplement the terms of this License with terms:
|
|
||||||
|
|
||||||
a) Disclaiming warranty or limiting liability differently from the
|
|
||||||
terms of sections 15 and 16 of this License; or
|
|
||||||
|
|
||||||
b) Requiring preservation of specified reasonable legal notices or
|
|
||||||
author attributions in that material or in the Appropriate Legal
|
|
||||||
Notices displayed by works containing it; or
|
|
||||||
|
|
||||||
c) Prohibiting misrepresentation of the origin of that material, or
|
|
||||||
requiring that modified versions of such material be marked in
|
|
||||||
reasonable ways as different from the original version; or
|
|
||||||
|
|
||||||
d) Limiting the use for publicity purposes of names of licensors or
|
|
||||||
authors of the material; or
|
|
||||||
|
|
||||||
e) Declining to grant rights under trademark law for use of some
|
|
||||||
trade names, trademarks, or service marks; or
|
|
||||||
|
|
||||||
f) Requiring indemnification of licensors and authors of that
|
|
||||||
material by anyone who conveys the material (or modified versions of
|
|
||||||
it) with contractual assumptions of liability to the recipient, for
|
|
||||||
any liability that these contractual assumptions directly impose on
|
|
||||||
those licensors and authors.
|
|
||||||
|
|
||||||
All other non-permissive additional terms are considered "further
|
|
||||||
restrictions" within the meaning of section 10. If the Program as you
|
|
||||||
received it, or any part of it, contains a notice stating that it is
|
|
||||||
governed by this License along with a term that is a further
|
|
||||||
restriction, you may remove that term. If a license document contains
|
|
||||||
a further restriction but permits relicensing or conveying under this
|
|
||||||
License, you may add to a covered work material governed by the terms
|
|
||||||
of that license document, provided that the further restriction does
|
|
||||||
not survive such relicensing or conveying.
|
|
||||||
|
|
||||||
If you add terms to a covered work in accord with this section, you
|
|
||||||
must place, in the relevant source files, a statement of the
|
|
||||||
additional terms that apply to those files, or a notice indicating
|
|
||||||
where to find the applicable terms.
|
|
||||||
|
|
||||||
Additional terms, permissive or non-permissive, may be stated in the
|
|
||||||
form of a separately written license, or stated as exceptions;
|
|
||||||
the above requirements apply either way.
|
|
||||||
|
|
||||||
8. Termination.
|
|
||||||
|
|
||||||
You may not propagate or modify a covered work except as expressly
|
|
||||||
provided under this License. Any attempt otherwise to propagate or
|
|
||||||
modify it is void, and will automatically terminate your rights under
|
|
||||||
this License (including any patent licenses granted under the third
|
|
||||||
paragraph of section 11).
|
|
||||||
|
|
||||||
However, if you cease all violation of this License, then your
|
|
||||||
license from a particular copyright holder is reinstated (a)
|
|
||||||
provisionally, unless and until the copyright holder explicitly and
|
|
||||||
finally terminates your license, and (b) permanently, if the copyright
|
|
||||||
holder fails to notify you of the violation by some reasonable means
|
|
||||||
prior to 60 days after the cessation.
|
|
||||||
|
|
||||||
Moreover, your license from a particular copyright holder is
|
|
||||||
reinstated permanently if the copyright holder notifies you of the
|
|
||||||
violation by some reasonable means, this is the first time you have
|
|
||||||
received notice of violation of this License (for any work) from that
|
|
||||||
copyright holder, and you cure the violation prior to 30 days after
|
|
||||||
your receipt of the notice.
|
|
||||||
|
|
||||||
Termination of your rights under this section does not terminate the
|
|
||||||
licenses of parties who have received copies or rights from you under
|
|
||||||
this License. If your rights have been terminated and not permanently
|
|
||||||
reinstated, you do not qualify to receive new licenses for the same
|
|
||||||
material under section 10.
|
|
||||||
|
|
||||||
9. Acceptance Not Required for Having Copies.
|
|
||||||
|
|
||||||
You are not required to accept this License in order to receive or
|
|
||||||
run a copy of the Program. Ancillary propagation of a covered work
|
|
||||||
occurring solely as a consequence of using peer-to-peer transmission
|
|
||||||
to receive a copy likewise does not require acceptance. However,
|
|
||||||
nothing other than this License grants you permission to propagate or
|
|
||||||
modify any covered work. These actions infringe copyright if you do
|
|
||||||
not accept this License. Therefore, by modifying or propagating a
|
|
||||||
covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
|
||||||
10. Automatic Licensing of Downstream Recipients.
|
|
||||||
|
|
||||||
Each time you convey a covered work, the recipient automatically
|
|
||||||
receives a license from the original licensors, to run, modify and
|
|
||||||
propagate that work, subject to this License. You are not responsible
|
|
||||||
for enforcing compliance by third parties with this License.
|
|
||||||
|
|
||||||
An "entity transaction" is a transaction transferring control of an
|
|
||||||
organization, or substantially all assets of one, or subdividing an
|
|
||||||
organization, or merging organizations. If propagation of a covered
|
|
||||||
work results from an entity transaction, each party to that
|
|
||||||
transaction who receives a copy of the work also receives whatever
|
|
||||||
licenses to the work the party's predecessor in interest had or could
|
|
||||||
give under the previous paragraph, plus a right to possession of the
|
|
||||||
Corresponding Source of the work from the predecessor in interest, if
|
|
||||||
the predecessor has it or can get it with reasonable efforts.
|
|
||||||
|
|
||||||
You may not impose any further restrictions on the exercise of the
|
|
||||||
rights granted or affirmed under this License. For example, you may
|
|
||||||
not impose a license fee, royalty, or other charge for exercise of
|
|
||||||
rights granted under this License, and you may not initiate litigation
|
|
||||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
||||||
any patent claim is infringed by making, using, selling, offering for
|
|
||||||
sale, or importing the Program or any portion of it.
|
|
||||||
|
|
||||||
11. Patents.
|
|
||||||
|
|
||||||
A "contributor" is a copyright holder who authorizes use under this
|
|
||||||
License of the Program or a work on which the Program is based. The
|
|
||||||
work thus licensed is called the contributor's "contributor version".
|
|
||||||
|
|
||||||
A contributor's "essential patent claims" are all patent claims
|
|
||||||
owned or controlled by the contributor, whether already acquired or
|
|
||||||
hereafter acquired, that would be infringed by some manner, permitted
|
|
||||||
by this License, of making, using, or selling its contributor version,
|
|
||||||
but do not include claims that would be infringed only as a
|
|
||||||
consequence of further modification of the contributor version. For
|
|
||||||
purposes of this definition, "control" includes the right to grant
|
|
||||||
patent sublicenses in a manner consistent with the requirements of
|
|
||||||
this License.
|
|
||||||
|
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
||||||
patent license under the contributor's essential patent claims, to
|
|
||||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
||||||
propagate the contents of its contributor version.
|
|
||||||
|
|
||||||
In the following three paragraphs, a "patent license" is any express
|
|
||||||
agreement or commitment, however denominated, not to enforce a patent
|
|
||||||
(such as an express permission to practice a patent or covenant not to
|
|
||||||
sue for patent infringement). To "grant" such a patent license to a
|
|
||||||
party means to make such an agreement or commitment not to enforce a
|
|
||||||
patent against the party.
|
|
||||||
|
|
||||||
If you convey a covered work, knowingly relying on a patent license,
|
|
||||||
and the Corresponding Source of the work is not available for anyone
|
|
||||||
to copy, free of charge and under the terms of this License, through a
|
|
||||||
publicly available network server or other readily accessible means,
|
|
||||||
then you must either (1) cause the Corresponding Source to be so
|
|
||||||
available, or (2) arrange to deprive yourself of the benefit of the
|
|
||||||
patent license for this particular work, or (3) arrange, in a manner
|
|
||||||
consistent with the requirements of this License, to extend the patent
|
|
||||||
license to downstream recipients. "Knowingly relying" means you have
|
|
||||||
actual knowledge that, but for the patent license, your conveying the
|
|
||||||
covered work in a country, or your recipient's use of the covered work
|
|
||||||
in a country, would infringe one or more identifiable patents in that
|
|
||||||
country that you have reason to believe are valid.
|
|
||||||
|
|
||||||
If, pursuant to or in connection with a single transaction or
|
|
||||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
||||||
covered work, and grant a patent license to some of the parties
|
|
||||||
receiving the covered work authorizing them to use, propagate, modify
|
|
||||||
or convey a specific copy of the covered work, then the patent license
|
|
||||||
you grant is automatically extended to all recipients of the covered
|
|
||||||
work and works based on it.
|
|
||||||
|
|
||||||
A patent license is "discriminatory" if it does not include within
|
|
||||||
the scope of its coverage, prohibits the exercise of, or is
|
|
||||||
conditioned on the non-exercise of one or more of the rights that are
|
|
||||||
specifically granted under this License. You may not convey a covered
|
|
||||||
work if you are a party to an arrangement with a third party that is
|
|
||||||
in the business of distributing software, under which you make payment
|
|
||||||
to the third party based on the extent of your activity of conveying
|
|
||||||
the work, and under which the third party grants, to any of the
|
|
||||||
parties who would receive the covered work from you, a discriminatory
|
|
||||||
patent license (a) in connection with copies of the covered work
|
|
||||||
conveyed by you (or copies made from those copies), or (b) primarily
|
|
||||||
for and in connection with specific products or compilations that
|
|
||||||
contain the covered work, unless you entered into that arrangement,
|
|
||||||
or that patent license was granted, prior to 28 March 2007.
|
|
||||||
|
|
||||||
Nothing in this License shall be construed as excluding or limiting
|
|
||||||
any implied license or other defenses to infringement that may
|
|
||||||
otherwise be available to you under applicable patent law.
|
|
||||||
|
|
||||||
12. No Surrender of Others' Freedom.
|
|
||||||
|
|
||||||
If conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot convey a
|
|
||||||
covered work so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you may
|
|
||||||
not convey it at all. For example, if you agree to terms that obligate you
|
|
||||||
to collect a royalty for further conveying from those to whom you convey
|
|
||||||
the Program, the only way you could satisfy both those terms and this
|
|
||||||
License would be to refrain entirely from conveying the Program.
|
|
||||||
|
|
||||||
13. Use with the GNU Affero General Public License.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, you have
|
|
||||||
permission to link or combine any covered work with a work licensed
|
|
||||||
under version 3 of the GNU Affero General Public License into a single
|
|
||||||
combined work, and to convey the resulting work. The terms of this
|
|
||||||
License will continue to apply to the part which is the covered work,
|
|
||||||
but the special requirements of the GNU Affero General Public License,
|
|
||||||
section 13, concerning interaction through a network will apply to the
|
|
||||||
combination as such.
|
|
||||||
|
|
||||||
14. Revised Versions of this License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions of
|
|
||||||
the GNU General Public License from time to time. Such new versions will
|
|
||||||
be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
|
||||||
Program specifies that a certain numbered version of the GNU General
|
|
||||||
Public License "or any later version" applies to it, you have the
|
|
||||||
option of following the terms and conditions either of that numbered
|
|
||||||
version or of any later version published by the Free Software
|
|
||||||
Foundation. If the Program does not specify a version number of the
|
|
||||||
GNU General Public License, you may choose any version ever published
|
|
||||||
by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future
|
|
||||||
versions of the GNU General Public License can be used, that proxy's
|
|
||||||
public statement of acceptance of a version permanently authorizes you
|
|
||||||
to choose that version for the Program.
|
|
||||||
|
|
||||||
Later license versions may give you additional or different
|
|
||||||
permissions. However, no additional obligations are imposed on any
|
|
||||||
author or copyright holder as a result of your choosing to follow a
|
|
||||||
later version.
|
|
||||||
|
|
||||||
15. Disclaimer of Warranty.
|
|
||||||
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
||||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
||||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
|
||||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
|
||||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
|
||||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. Limitation of Liability.
|
|
||||||
|
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
|
||||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
|
||||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
|
||||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
|
||||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
|
||||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
|
||||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
|
||||||
SUCH DAMAGES.
|
|
||||||
|
|
||||||
17. Interpretation of Sections 15 and 16.
|
|
||||||
|
|
||||||
If the disclaimer of warranty and limitation of liability provided
|
|
||||||
above cannot be given local legal effect according to their terms,
|
|
||||||
reviewing courts shall apply local law that most closely approximates
|
|
||||||
an absolute waiver of all civil liability in connection with the
|
|
||||||
Program, unless a warranty or assumption of liability accompanies a
|
|
||||||
copy of the Program in return for a fee.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
state the exclusion of warranty; and each file should have at least
|
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If the program does terminal interaction, make it output a short
|
|
||||||
notice like this when it starts in an interactive mode:
|
|
||||||
|
|
||||||
<program> Copyright (C) <year> <name of author>
|
|
||||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
||||||
This is free software, and you are welcome to redistribute it
|
|
||||||
under certain conditions; type `show c' for details.
|
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
||||||
parts of the General Public License. Of course, your program's commands
|
|
||||||
might be different; for a GUI interface, you would use an "about box".
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or school,
|
|
||||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
|
||||||
For more information on this, and how to apply and follow the GNU GPL, see
|
|
||||||
<http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
The GNU General Public License does not permit incorporating your program
|
|
||||||
into proprietary programs. If your program is a subroutine library, you
|
|
||||||
may consider it more useful to permit linking proprietary applications with
|
|
||||||
the library. If this is what you want to do, use the GNU Lesser General
|
|
||||||
Public License instead of this License. But first, please read
|
|
||||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
|
||||||
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
<div align="center" markdown="1">
|
|
||||||
|
|
||||||
<img src=".github/meshtastic_logo.png" alt="Meshtastic Logo" width="80"/>
|
|
||||||
<h1>Meshtastic Firmware</h1>
|
|
||||||
|
|
||||||

|
|
||||||
[](https://github.com/meshtastic/firmware/actions/workflows/ci.yml)
|
|
||||||
[](https://cla-assistant.io/meshtastic/firmware)
|
|
||||||
[](https://opencollective.com/meshtastic/)
|
|
||||||
[](https://vercel.com?utm_source=meshtastic&utm_campaign=oss)
|
|
||||||
|
|
||||||
<a href="https://trendshift.io/repositories/5524" target="_blank"><img src="https://trendshift.io/api/badge/repositories/5524" alt="meshtastic%2Ffirmware | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div align="center">
|
|
||||||
<a href="https://meshtastic.org">Website</a>
|
|
||||||
-
|
|
||||||
<a href="https://meshtastic.org/docs/">Documentation</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
## Overview
|
|
||||||
|
|
||||||
This repository contains the official device firmware for Meshtastic, an open-source LoRa mesh networking project designed for long-range, low-power communication without relying on internet or cellular infrastructure. The firmware supports various hardware platforms, including ESP32, nRF52, RP2040/RP2350, and Linux-based devices.
|
|
||||||
|
|
||||||
Meshtastic enables text messaging, location sharing, and telemetry over a decentralized mesh network, making it ideal for outdoor adventures, emergency preparedness, and remote operations.
|
|
||||||
|
|
||||||
### Get Started
|
|
||||||
|
|
||||||
- 🔧 **[Building Instructions](https://meshtastic.org/docs/development/firmware/build)** – Learn how to compile the firmware from source.
|
|
||||||
- ⚡ **[Flashing Instructions](https://meshtastic.org/docs/getting-started/flashing-firmware/)** – Install or update the firmware on your device.
|
|
||||||
|
|
||||||
Join our community and help improve Meshtastic! 🚀
|
|
||||||
|
|
||||||
## Stats
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
# Security Policy
|
|
||||||
|
|
||||||
## Supported Versions
|
|
||||||
|
|
||||||
| Firmware Version | Supported |
|
|
||||||
| ---------------- | ------------------ |
|
|
||||||
| 2.6.x | :white_check_mark: |
|
|
||||||
| <= 2.5.x | :x: |
|
|
||||||
|
|
||||||
## Reporting a Vulnerability
|
|
||||||
|
|
||||||
We support the private reporting of potential security vulnerabilities. Please go to the Security tab to file a report with a description of the potential vulnerability and reproduction scripts (preferred) or steps, and our developers will review.
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
# trunk-ignore-all(trivy/DS002): We must run as root for this container
|
|
||||||
# trunk-ignore-all(hadolint/DL3002): We must run as root for this container
|
|
||||||
# trunk-ignore-all(hadolint/DL3018): Do not pin apk package versions
|
|
||||||
# trunk-ignore-all(hadolint/DL3013): Do not pin pip package versions
|
|
||||||
|
|
||||||
FROM python:3.14-alpine3.22 AS builder
|
|
||||||
ARG PIO_ENV=native
|
|
||||||
ENV PIP_ROOT_USER_ACTION=ignore
|
|
||||||
|
|
||||||
RUN apk --no-cache add \
|
|
||||||
bash g++ libstdc++-dev linux-headers zip git ca-certificates libbsd-dev \
|
|
||||||
libgpiod-dev yaml-cpp-dev bluez-dev \
|
|
||||||
libusb-dev i2c-tools-dev libuv-dev openssl-dev pkgconf argp-standalone \
|
|
||||||
libx11-dev libinput-dev libxkbcommon-dev \
|
|
||||||
&& rm -rf /var/cache/apk/* \
|
|
||||||
&& pip install --no-cache-dir -U platformio \
|
|
||||||
&& mkdir /tmp/firmware
|
|
||||||
|
|
||||||
WORKDIR /tmp/firmware
|
|
||||||
COPY . /tmp/firmware
|
|
||||||
|
|
||||||
# Create small package (no debugging symbols)
|
|
||||||
# Add `argp` for musl
|
|
||||||
ENV PLATFORMIO_BUILD_FLAGS="-Os -ffunction-sections -fdata-sections -Wl,--gc-sections -largp"
|
|
||||||
|
|
||||||
RUN bash ./bin/build-native.sh "$PIO_ENV" && \
|
|
||||||
cp "/tmp/firmware/release/meshtasticd_linux_$(uname -m)" "/tmp/firmware/release/meshtasticd"
|
|
||||||
|
|
||||||
# ##### PRODUCTION BUILD #############
|
|
||||||
|
|
||||||
FROM alpine:3.22
|
|
||||||
LABEL org.opencontainers.image.title="Meshtastic" \
|
|
||||||
org.opencontainers.image.description="Alpine Meshtastic daemon" \
|
|
||||||
org.opencontainers.image.url="https://meshtastic.org" \
|
|
||||||
org.opencontainers.image.documentation="https://meshtastic.org/docs/" \
|
|
||||||
org.opencontainers.image.authors="Meshtastic" \
|
|
||||||
org.opencontainers.image.licenses="GPL-3.0-or-later" \
|
|
||||||
org.opencontainers.image.source="https://github.com/meshtastic/firmware/"
|
|
||||||
|
|
||||||
# nosemgrep: dockerfile.security.last-user-is-root.last-user-is-root
|
|
||||||
USER root
|
|
||||||
|
|
||||||
RUN apk --no-cache add \
|
|
||||||
shadow libstdc++ libbsd libgpiod yaml-cpp libusb \
|
|
||||||
i2c-tools libuv libx11 libinput libxkbcommon \
|
|
||||||
&& rm -rf /var/cache/apk/* \
|
|
||||||
&& mkdir -p /var/lib/meshtasticd \
|
|
||||||
&& mkdir -p /etc/meshtasticd/config.d \
|
|
||||||
&& mkdir -p /etc/meshtasticd/ssl
|
|
||||||
|
|
||||||
# Fetch compiled binary from the builder
|
|
||||||
COPY --from=builder /tmp/firmware/release/meshtasticd /usr/bin/
|
|
||||||
# Copy config templates
|
|
||||||
COPY ./bin/config.d /etc/meshtasticd/available.d
|
|
||||||
|
|
||||||
WORKDIR /var/lib/meshtasticd
|
|
||||||
VOLUME /var/lib/meshtasticd
|
|
||||||
|
|
||||||
EXPOSE 4403
|
|
||||||
|
|
||||||
CMD [ "sh", "-cx", "meshtasticd --fsdir=/var/lib/meshtasticd" ]
|
|
||||||
|
|
||||||
HEALTHCHECK NONE
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
; Common settings for ESP targes, mixin with extends = esp32_base
|
|
||||||
[esp32_base]
|
|
||||||
extends = arduino_base
|
|
||||||
custom_esp32_kind = esp32
|
|
||||||
platform =
|
|
||||||
# renovate: datasource=custom.pio depName=platformio/espressif32 packageName=platformio/platform/espressif32
|
|
||||||
platformio/espressif32@6.11.0
|
|
||||||
|
|
||||||
build_src_filter =
|
|
||||||
${arduino_base.build_src_filter} -<platform/nrf52/> -<platform/stm32wl> -<platform/rp2xx0> -<mesh/eth/> -<mesh/raspihttp>
|
|
||||||
|
|
||||||
upload_speed = 921600
|
|
||||||
debug_init_break = tbreak setup
|
|
||||||
monitor_filters = esp32_exception_decoder
|
|
||||||
|
|
||||||
board_build.filesystem = littlefs
|
|
||||||
|
|
||||||
# Remove -DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL for low level BLE logging.
|
|
||||||
# See library directory for BLE logging possible values: .pio/libdeps/tbeam/NimBLE-Arduino/src/log_common/log_common.h
|
|
||||||
# This overrides the BLE logging default of LOG_LEVEL_INFO (1) from: .pio/libdeps/tbeam/NimBLE-Arduino/src/esp_nimble_cfg.h
|
|
||||||
build_unflags = -fno-lto
|
|
||||||
build_flags =
|
|
||||||
${arduino_base.build_flags}
|
|
||||||
-flto
|
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Isrc/platform/esp32
|
|
||||||
-std=c++11
|
|
||||||
-DLOG_LOCAL_LEVEL=ESP_LOG_DEBUG
|
|
||||||
-DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
|
|
||||||
-DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL
|
|
||||||
-DAXP_DEBUG_PORT=Serial
|
|
||||||
-DCONFIG_BT_NIMBLE_ENABLED
|
|
||||||
-DCONFIG_BT_NIMBLE_MAX_BONDS=6 # default is 3
|
|
||||||
-DCONFIG_NIMBLE_CPP_LOG_LEVEL=2
|
|
||||||
-DCONFIG_BT_NIMBLE_MAX_CCCDS=20
|
|
||||||
-DCONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=8192
|
|
||||||
-DESP_OPENSSL_SUPPRESS_LEGACY_WARNING
|
|
||||||
-DSERIAL_BUFFER_SIZE=4096
|
|
||||||
-DSERIAL_HAS_ON_RECEIVE
|
|
||||||
-DLIBPAX_ARDUINO
|
|
||||||
-DLIBPAX_WIFI
|
|
||||||
-DLIBPAX_BLE
|
|
||||||
-DHAS_UDP_MULTICAST=1
|
|
||||||
;-DDEBUG_HEAP
|
|
||||||
|
|
||||||
lib_deps =
|
|
||||||
${arduino_base.lib_deps}
|
|
||||||
${networking_base.lib_deps}
|
|
||||||
${environmental_base.lib_deps}
|
|
||||||
${environmental_extra.lib_deps}
|
|
||||||
${radiolib_base.lib_deps}
|
|
||||||
# renovate: datasource=git-refs depName=meshtastic-esp32_https_server packageName=https://github.com/meshtastic/esp32_https_server gitBranch=master
|
|
||||||
https://github.com/meshtastic/esp32_https_server/archive/3223704846752e6d545139204837bdb2a55459ca.zip
|
|
||||||
# renovate: datasource=custom.pio depName=NimBLE-Arduino packageName=h2zero/library/NimBLE-Arduino
|
|
||||||
h2zero/NimBLE-Arduino@^1.4.3
|
|
||||||
# renovate: datasource=git-refs depName=libpax packageName=https://github.com/dbinfrago/libpax gitBranch=master
|
|
||||||
https://github.com/dbinfrago/libpax/archive/3cdc0371c375676a97967547f4065607d4c53fd1.zip
|
|
||||||
# renovate: datasource=github-tags depName=XPowersLib packageName=lewisxhe/XPowersLib
|
|
||||||
https://github.com/lewisxhe/XPowersLib/archive/v0.3.1.zip
|
|
||||||
# renovate: datasource=git-refs depName=meshtastic-ESP32_Codec2 packageName=https://github.com/meshtastic/ESP32_Codec2 gitBranch=master
|
|
||||||
https://github.com/meshtastic/ESP32_Codec2/archive/633326c78ac251c059ab3a8c430fcdf25b41672f.zip
|
|
||||||
# renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto
|
|
||||||
rweather/Crypto@0.4.0
|
|
||||||
|
|
||||||
lib_ignore =
|
|
||||||
segger_rtt
|
|
||||||
ESP32 BLE Arduino
|
|
||||||
|
|
||||||
; leave this commented out to avoid breaking Windows
|
|
||||||
;upload_port = /dev/ttyUSB0
|
|
||||||
;monitor_port = /dev/ttyUSB0
|
|
||||||
|
|
||||||
; Please don't delete these lines. JM uses them.
|
|
||||||
;upload_port = /dev/cu.SLAB_USBtoUART
|
|
||||||
;monitor_port = /dev/cu.SLAB_USBtoUART
|
|
||||||
|
|
||||||
; customize the partition table
|
|
||||||
; http://docs.platformio.org/en/latest/platforms/espressif32.html#partition-tables
|
|
||||||
board_build.partitions = partition-table.csv
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
[esp32c3_base]
|
|
||||||
extends = esp32_base
|
|
||||||
custom_esp32_kind = esp32c3
|
|
||||||
|
|
||||||
monitor_speed = 115200
|
|
||||||
monitor_filters = esp32_c3_exception_decoder
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
[esp32c6_base]
|
|
||||||
extends = esp32_base
|
|
||||||
platform =
|
|
||||||
# Do not renovate until we have switched to pioarduino tagged builds
|
|
||||||
https://github.com/Jason2866/platform-espressif32/archive/22faa566df8c789000f8136cd8d0aca49617af55.zip
|
|
||||||
build_flags =
|
|
||||||
${arduino_base.build_flags}
|
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Isrc/platform/esp32
|
|
||||||
-std=c++11
|
|
||||||
-DESP_OPENSSL_SUPPRESS_LEGACY_WARNING
|
|
||||||
-DSERIAL_BUFFER_SIZE=4096
|
|
||||||
-DLIBPAX_ARDUINO
|
|
||||||
-DLIBPAX_WIFI
|
|
||||||
-DLIBPAX_BLE
|
|
||||||
-DMESHTASTIC_EXCLUDE_WEBSERVER
|
|
||||||
;-DDEBUG_HEAP
|
|
||||||
; TEMP
|
|
||||||
-DHAS_BLUETOOTH=0
|
|
||||||
-DMESHTASTIC_EXCLUDE_PAXCOUNTER
|
|
||||||
-DMESHTASTIC_EXCLUDE_BLUETOOTH
|
|
||||||
|
|
||||||
lib_deps =
|
|
||||||
${arduino_base.lib_deps}
|
|
||||||
${networking_base.lib_deps}
|
|
||||||
${environmental_base.lib_deps}
|
|
||||||
${environmental_extra.lib_deps}
|
|
||||||
${radiolib_base.lib_deps}
|
|
||||||
# renovate: datasource=custom.pio depName=XPowersLib packageName=lewisxhe/library/XPowersLib
|
|
||||||
lewisxhe/XPowersLib@0.3.1
|
|
||||||
# renovate: datasource=git-refs depName=meshtastic-ESP32_Codec2 packageName=https://github.com/meshtastic/ESP32_Codec2 gitBranch=master
|
|
||||||
https://github.com/meshtastic/ESP32_Codec2/archive/633326c78ac251c059ab3a8c430fcdf25b41672f.zip
|
|
||||||
# renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto
|
|
||||||
rweather/Crypto@0.4.0
|
|
||||||
|
|
||||||
build_src_filter =
|
|
||||||
${esp32_base.build_src_filter} -<mesh/http>
|
|
||||||
|
|
||||||
monitor_speed = 460800
|
|
||||||
monitor_filters = esp32_c3_exception_decoder
|
|
||||||
|
|
||||||
lib_ignore =
|
|
||||||
NonBlockingRTTTL
|
|
||||||
NimBLE-Arduino
|
|
||||||
libpax
|
|
||||||
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
[esp32s2_base]
|
|
||||||
extends = esp32_base
|
|
||||||
custom_esp32_kind = esp32s2
|
|
||||||
|
|
||||||
build_src_filter =
|
|
||||||
${esp32_base.build_src_filter} - <libpax/> -<nimble/> -<mesh/raspihttp>
|
|
||||||
|
|
||||||
monitor_speed = 115200
|
|
||||||
|
|
||||||
build_flags =
|
|
||||||
${esp32_base.build_flags}
|
|
||||||
-DHAS_BLUETOOTH=0
|
|
||||||
-DMESHTASTIC_EXCLUDE_PAXCOUNTER
|
|
||||||
-DMESHTASTIC_EXCLUDE_BLUETOOTH
|
|
||||||
|
|
||||||
lib_ignore =
|
|
||||||
${esp32_base.lib_ignore}
|
|
||||||
NimBLE-Arduino
|
|
||||||
libpax
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
[esp32s3_base]
|
|
||||||
extends = esp32_base
|
|
||||||
custom_esp32_kind = esp32s3
|
|
||||||
|
|
||||||
monitor_speed = 115200
|
|
||||||
@@ -1,208 +0,0 @@
|
|||||||
/*
|
|
||||||
* lfs utility functions
|
|
||||||
*
|
|
||||||
* Copyright (c) 2017, Arm Limited. All rights reserved.
|
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
|
||||||
*/
|
|
||||||
|
|
||||||
// MESHTASTIC/@geeksville note: This file is copied from the Adafruit nrf52 arduino lib. And we use a special -include in
|
|
||||||
// nrf52.ini to load it before EVERY file we do this hack because the default definitions for LFS_ASSERT are quite poor and we
|
|
||||||
// don't want to fork the adafruit lib (again) and send in a PR that they probably won't merge anyways. This file might break if
|
|
||||||
// they ever update lfs.util on their side, in which case we'll need to update this file to match their new version. The version
|
|
||||||
// this is a copy from is almost exactly
|
|
||||||
// https://github.com/adafruit/Adafruit_nRF52_Arduino/blob/c25d93268a3b9c23e9a1ccfcaf9b208beca624ca/libraries/Adafruit_LittleFS/src/littlefs/lfs_util.h
|
|
||||||
|
|
||||||
#ifndef LFS_UTIL_H
|
|
||||||
#define LFS_UTIL_H
|
|
||||||
|
|
||||||
// Users can override lfs_util.h with their own configuration by defining
|
|
||||||
// LFS_CONFIG as a header file to include (-DLFS_CONFIG=lfs_config.h).
|
|
||||||
//
|
|
||||||
// If LFS_CONFIG is used, none of the default utils will be emitted and must be
|
|
||||||
// provided by the config file. To start I would suggest copying lfs_util.h and
|
|
||||||
// modifying as needed.
|
|
||||||
#ifdef LFS_CONFIG
|
|
||||||
#define LFS_STRINGIZE(x) LFS_STRINGIZE2(x)
|
|
||||||
#define LFS_STRINGIZE2(x) #x
|
|
||||||
#include LFS_STRINGIZE(LFS_CONFIG)
|
|
||||||
#else
|
|
||||||
|
|
||||||
// System includes
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#ifndef LFS_NO_MALLOC
|
|
||||||
#include <stdlib.h>
|
|
||||||
#endif
|
|
||||||
#ifndef LFS_NO_ASSERT
|
|
||||||
#include <assert.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(LFS_NO_DEBUG) || !defined(LFS_NO_WARN) || !defined(LFS_NO_ERROR)
|
|
||||||
#include <stdio.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Macros, may be replaced by system specific wrappers. Arguments to these
|
|
||||||
// macros must not have side-effects as the macros can be removed for a smaller
|
|
||||||
// code footprint
|
|
||||||
|
|
||||||
// Logging functions
|
|
||||||
#ifndef LFS_NO_DEBUG
|
|
||||||
|
|
||||||
void logLegacy(const char *level, const char *fmt, ...);
|
|
||||||
#define LFS_DEBUG(fmt, ...) logLegacy("DEBUG", "lfs debug:%d: " fmt "\n", __LINE__, __VA_ARGS__)
|
|
||||||
#else
|
|
||||||
#define LFS_DEBUG(fmt, ...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef LFS_NO_WARN
|
|
||||||
#define LFS_WARN(fmt, ...) logLegacy("WARN", "lfs warn:%d: " fmt "\n", __LINE__, __VA_ARGS__)
|
|
||||||
#else
|
|
||||||
#define LFS_WARN(fmt, ...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef LFS_NO_ERROR
|
|
||||||
#define LFS_ERROR(fmt, ...) logLegacy("ERROR", "lfs error:%d: " fmt "\n", __LINE__, __VA_ARGS__)
|
|
||||||
#else
|
|
||||||
#define LFS_ERROR(fmt, ...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Runtime assertions
|
|
||||||
#ifndef LFS_NO_ASSERT
|
|
||||||
#define LFS_ASSERT(test) assert(test)
|
|
||||||
#else
|
|
||||||
extern void lfs_assert(const char *reason);
|
|
||||||
#define LFS_ASSERT(test) \
|
|
||||||
if (!(test)) \
|
|
||||||
lfs_assert(#test)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Builtin functions, these may be replaced by more efficient
|
|
||||||
// toolchain-specific implementations. LFS_NO_INTRINSICS falls back to a more
|
|
||||||
// expensive basic C implementation for debugging purposes
|
|
||||||
|
|
||||||
// Min/max functions for unsigned 32-bit numbers
|
|
||||||
static inline uint32_t lfs_max(uint32_t a, uint32_t b)
|
|
||||||
{
|
|
||||||
return (a > b) ? a : b;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline uint32_t lfs_min(uint32_t a, uint32_t b)
|
|
||||||
{
|
|
||||||
return (a < b) ? a : b;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Find the next smallest power of 2 less than or equal to a
|
|
||||||
static inline uint32_t lfs_npw2(uint32_t a)
|
|
||||||
{
|
|
||||||
#if !defined(LFS_NO_INTRINSICS) && (defined(__GNUC__) || defined(__CC_ARM))
|
|
||||||
return 32 - __builtin_clz(a - 1);
|
|
||||||
#else
|
|
||||||
uint32_t r = 0;
|
|
||||||
uint32_t s;
|
|
||||||
a -= 1;
|
|
||||||
s = (a > 0xffff) << 4;
|
|
||||||
a >>= s;
|
|
||||||
r |= s;
|
|
||||||
s = (a > 0xff) << 3;
|
|
||||||
a >>= s;
|
|
||||||
r |= s;
|
|
||||||
s = (a > 0xf) << 2;
|
|
||||||
a >>= s;
|
|
||||||
r |= s;
|
|
||||||
s = (a > 0x3) << 1;
|
|
||||||
a >>= s;
|
|
||||||
r |= s;
|
|
||||||
return (r | (a >> 1)) + 1;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
// Count the number of trailing binary zeros in a
|
|
||||||
// lfs_ctz(0) may be undefined
|
|
||||||
static inline uint32_t lfs_ctz(uint32_t a)
|
|
||||||
{
|
|
||||||
#if !defined(LFS_NO_INTRINSICS) && defined(__GNUC__)
|
|
||||||
return __builtin_ctz(a);
|
|
||||||
#else
|
|
||||||
return lfs_npw2((a & -a) + 1) - 1;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
// Count the number of binary ones in a
|
|
||||||
static inline uint32_t lfs_popc(uint32_t a)
|
|
||||||
{
|
|
||||||
#if !defined(LFS_NO_INTRINSICS) && (defined(__GNUC__) || defined(__CC_ARM))
|
|
||||||
return __builtin_popcount(a);
|
|
||||||
#else
|
|
||||||
a = a - ((a >> 1) & 0x55555555);
|
|
||||||
a = (a & 0x33333333) + ((a >> 2) & 0x33333333);
|
|
||||||
return (((a + (a >> 4)) & 0xf0f0f0f) * 0x1010101) >> 24;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
// Find the sequence comparison of a and b, this is the distance
|
|
||||||
// between a and b ignoring overflow
|
|
||||||
static inline int lfs_scmp(uint32_t a, uint32_t b)
|
|
||||||
{
|
|
||||||
return (int)(unsigned)(a - b);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Convert from 32-bit little-endian to native order
|
|
||||||
static inline uint32_t lfs_fromle32(uint32_t a)
|
|
||||||
{
|
|
||||||
#if !defined(LFS_NO_INTRINSICS) && ((defined(BYTE_ORDER) && BYTE_ORDER == ORDER_LITTLE_ENDIAN) || \
|
|
||||||
(defined(__BYTE_ORDER) && __BYTE_ORDER == __ORDER_LITTLE_ENDIAN) || \
|
|
||||||
(defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__))
|
|
||||||
return a;
|
|
||||||
#elif !defined(LFS_NO_INTRINSICS) && \
|
|
||||||
((defined(BYTE_ORDER) && BYTE_ORDER == ORDER_BIG_ENDIAN) || (defined(__BYTE_ORDER) && __BYTE_ORDER == __ORDER_BIG_ENDIAN) || \
|
|
||||||
(defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__))
|
|
||||||
return __builtin_bswap32(a);
|
|
||||||
#else
|
|
||||||
return (((uint8_t *)&a)[0] << 0) | (((uint8_t *)&a)[1] << 8) | (((uint8_t *)&a)[2] << 16) | (((uint8_t *)&a)[3] << 24);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
// Convert to 32-bit little-endian from native order
|
|
||||||
static inline uint32_t lfs_tole32(uint32_t a)
|
|
||||||
{
|
|
||||||
return lfs_fromle32(a);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Calculate CRC-32 with polynomial = 0x04c11db7
|
|
||||||
void lfs_crc(uint32_t *crc, const void *buffer, size_t size);
|
|
||||||
|
|
||||||
// Allocate memory, only used if buffers are not provided to littlefs
|
|
||||||
static inline void *lfs_malloc(size_t size)
|
|
||||||
{
|
|
||||||
#ifndef LFS_NO_MALLOC
|
|
||||||
extern void *pvPortMalloc(size_t xWantedSize);
|
|
||||||
return pvPortMalloc(size);
|
|
||||||
#else
|
|
||||||
(void)size;
|
|
||||||
return NULL;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deallocate memory, only used if buffers are not provided to littlefs
|
|
||||||
static inline void lfs_free(void *p)
|
|
||||||
{
|
|
||||||
#ifndef LFS_NO_MALLOC
|
|
||||||
extern void vPortFree(void *pv);
|
|
||||||
vPortFree(p);
|
|
||||||
#else
|
|
||||||
(void)p;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
[nrf52_base]
|
|
||||||
; Instead of the standard nordicnrf52 platform, we use our fork which has our added variant files
|
|
||||||
platform =
|
|
||||||
# renovate: datasource=custom.pio depName=platformio/nordicnrf52 packageName=platformio/platform/nordicnrf52
|
|
||||||
platformio/nordicnrf52@^10.8.0
|
|
||||||
extends = arduino_base
|
|
||||||
platform_packages =
|
|
||||||
; our custom Git version until they merge our PR
|
|
||||||
# TODO renovate
|
|
||||||
platformio/framework-arduinoadafruitnrf52 @ https://github.com/meshtastic/Adafruit_nRF52_Arduino#e13f5820002a4fb2a5e6754b42ace185277e5adf
|
|
||||||
; Don't renovate toolchain-gccarmnoneeabi
|
|
||||||
platformio/toolchain-gccarmnoneeabi@~1.90301.0
|
|
||||||
|
|
||||||
build_type = debug
|
|
||||||
build_flags =
|
|
||||||
-include arch/nrf52/cpp_overrides/lfs_util.h
|
|
||||||
${arduino_base.build_flags}
|
|
||||||
-DSERIAL_BUFFER_SIZE=1024
|
|
||||||
-Wno-unused-variable
|
|
||||||
-Isrc/platform/nrf52
|
|
||||||
-DLFS_NO_ASSERT ; Disable LFS assertions , see https://github.com/meshtastic/firmware/pull/3818
|
|
||||||
-DMESHTASTIC_EXCLUDE_AUDIO=1
|
|
||||||
-DMESHTASTIC_EXCLUDE_PAXCOUNTER=1
|
|
||||||
|
|
||||||
build_src_filter =
|
|
||||||
${arduino_base.build_src_filter} -<platform/esp32/> -<platform/stm32wl> -<nimble/> -<mesh/wifi/> -<mesh/api/> -<mesh/http/> -<modules/esp32> -<platform/rp2xx0> -<mesh/eth/> -<mesh/raspihttp> -<serialization/>
|
|
||||||
|
|
||||||
lib_deps=
|
|
||||||
${arduino_base.lib_deps}
|
|
||||||
${radiolib_base.lib_deps}
|
|
||||||
# renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto
|
|
||||||
rweather/Crypto@0.4.0
|
|
||||||
|
|
||||||
lib_ignore =
|
|
||||||
BluetoothOTA
|
|
||||||
lvgl
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
[nrf52832_base]
|
|
||||||
extends = nrf52_base
|
|
||||||
|
|
||||||
build_flags = ${nrf52_base.build_flags}
|
|
||||||
|
|
||||||
lib_deps =
|
|
||||||
${nrf52_base.lib_deps}
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
[nrf52840_base]
|
|
||||||
extends = nrf52_base
|
|
||||||
|
|
||||||
build_flags = ${nrf52_base.build_flags}
|
|
||||||
|
|
||||||
lib_deps =
|
|
||||||
${nrf52_base.lib_deps}
|
|
||||||
${environmental_base.lib_deps}
|
|
||||||
${environmental_extra.lib_deps}
|
|
||||||
# renovate: datasource=git-refs depName=Kongduino-Adafruit_nRFCrypto packageName=https://github.com/Kongduino/Adafruit_nRFCrypto gitBranch=master
|
|
||||||
https://github.com/Kongduino/Adafruit_nRFCrypto/archive/5f838d2709461a2c981f642917aa50254a25c14c.zip
|
|
||||||
|
|
||||||
; Common NRF52 debugging settings follow. See the Meshtastic developer docs for how to connect SWD debugging probes to your board.
|
|
||||||
|
|
||||||
; We want the initial breakpoint at setup() instead of main(). Also we want to enable semihosting at that point so instead of
|
|
||||||
debug_init_break = tbreak setup
|
|
||||||
; we just turn off the platformio tbreak and do it in .gdbinit (where we have more flexibility for scripting)
|
|
||||||
; also we use a permanent breakpoint so it gets reused each time we restart the debugging session?
|
|
||||||
; debug_init_break = tbreak main
|
|
||||||
|
|
||||||
; Note: add "monitor arm semihosting_redirect tcp 4444 all" if you want the stdout from the device to go to that port number instead
|
|
||||||
; (for use by meshtastic command line)
|
|
||||||
; monitor arm semihosting disable
|
|
||||||
; monitor debug_level 3
|
|
||||||
;
|
|
||||||
; IMPORTANT: fileio must be disabled before using port 5555 - openocd ver 0.12 has a bug where if enabled it never properly parses the special :tt name
|
|
||||||
; for stdio access.
|
|
||||||
; monitor arm semihosting_redirect tcp 5555 stdio
|
|
||||||
|
|
||||||
; Also note: it is _impossible_ to do non blocking reads on the semihost console port (an oversight when ARM specified the semihost API).
|
|
||||||
; So we'll neve be able to general purpose bi-directional communication with the device over semihosting.
|
|
||||||
debug_extra_cmds =
|
|
||||||
echo Running .gdbinit script
|
|
||||||
;monitor arm semihosting enable
|
|
||||||
;monitor arm semihosting_fileio enable
|
|
||||||
;monitor arm semihosting_redirect disable
|
|
||||||
commands 1
|
|
||||||
; echo Breakpoint at setup() has semihosting console, connect to it with "telnet localhost 5555"
|
|
||||||
; set wantSemihost = 1
|
|
||||||
set useSoftDevice = 0
|
|
||||||
end
|
|
||||||
|
|
||||||
; Only reprogram the board if the code has changed
|
|
||||||
debug_load_mode = modified
|
|
||||||
;debug_load_mode = manual
|
|
||||||
; We default to the stlink adapter because it is very cheap and works well, though others (such as jlink) are also supported.
|
|
||||||
;debug_tool = jlink
|
|
||||||
debug_tool = stlink
|
|
||||||
debug_speed = 4000
|
|
||||||
;debug_tool = custom
|
|
||||||
; debug_server =
|
|
||||||
; openocd
|
|
||||||
; -f
|
|
||||||
; /usr/local/share/openocd/scripts/interface/stlink.cfg
|
|
||||||
; -f
|
|
||||||
; /usr/local/share/openocd/scripts/target/nrf52.cfg
|
|
||||||
; $PLATFORMIO_CORE_DIR/packages/tool-openocd/openocd/scripts/interface/cmsis-dap.cfg
|
|
||||||
|
|
||||||
; Allows programming and debug via the RAK NanoDAP as the default debugger tool for the RAK4631 (it is only $10!)
|
|
||||||
; programming time is about the same as the bootloader version.
|
|
||||||
; For information on this see the meshtastic developers documentation for "Development on the NRF52"
|
|
||||||
; We manually pass in the elf file so that pyocd can reverse engineer FreeRTOS data (running threads, etc...)
|
|
||||||
;debug_server =
|
|
||||||
; pyocd
|
|
||||||
; gdbserver
|
|
||||||
; -j
|
|
||||||
; ${platformio.workspace_dir}/..
|
|
||||||
; -t
|
|
||||||
; nrf52840
|
|
||||||
; --semihosting
|
|
||||||
; --elf
|
|
||||||
; ${platformio.build_dir}/${this.__env__}/firmware.elf
|
|
||||||
|
|
||||||
; If you want to debug the semihosting support you can turn on extra logging in pyocd with
|
|
||||||
; -L
|
|
||||||
; pyocd.debug.semihost.trace=debug
|
|
||||||
|
|
||||||
; The following is not needed because it automatically tries do this
|
|
||||||
;debug_server_ready_pattern = -.*GDB server started on port \d+.*
|
|
||||||
;debug_port = localhost:3333
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
; The Portduino based 'native' environment. Currently supported on Linux targets with real LoRa hardware (or simulated).
|
|
||||||
[portduino_base]
|
|
||||||
platform =
|
|
||||||
# renovate: datasource=git-refs depName=platform-native packageName=https://github.com/meshtastic/platform-native gitBranch=develop
|
|
||||||
https://github.com/meshtastic/platform-native/archive/f566d364204416cdbf298e349213f7d551f793d9.zip
|
|
||||||
framework = arduino
|
|
||||||
|
|
||||||
build_src_filter =
|
|
||||||
${env.build_src_filter}
|
|
||||||
-<platform/esp32/>
|
|
||||||
-<nimble/>
|
|
||||||
-<platform/nrf52/>
|
|
||||||
-<platform/stm32wl/>
|
|
||||||
-<platform/rp2xx0>
|
|
||||||
-<mesh/wifi/>
|
|
||||||
-<mesh/http/>
|
|
||||||
+<mesh/raspihttp/>
|
|
||||||
-<mesh/eth/>
|
|
||||||
-<modules/esp32>
|
|
||||||
|
|
||||||
lib_deps =
|
|
||||||
${env.lib_deps}
|
|
||||||
${networking_base.lib_deps}
|
|
||||||
${radiolib_base.lib_deps}
|
|
||||||
${environmental_base.lib_deps}
|
|
||||||
# renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto
|
|
||||||
rweather/Crypto@0.4.0
|
|
||||||
# renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX
|
|
||||||
lovyan03/LovyanGFX@^1.2.0
|
|
||||||
# renovate: datasource=git-refs depName=libch341-spi-userspace packageName=https://github.com/pine64/libch341-spi-userspace gitBranch=main
|
|
||||||
https://github.com/pine64/libch341-spi-userspace/archive/af9bc27c9c30fa90772279925b7c5913dff789b4.zip
|
|
||||||
# renovate: datasource=custom.pio depName=adafruit/Adafruit seesaw Library packageName=adafruit/library/Adafruit seesaw Library
|
|
||||||
adafruit/Adafruit seesaw Library@1.7.9
|
|
||||||
# renovate: datasource=git-refs depName=RAK12034-BMX160 packageName=https://github.com/RAKWireless/RAK12034-BMX160 gitBranch=main
|
|
||||||
https://github.com/RAKWireless/RAK12034-BMX160/archive/dcead07ffa267d3c906e9ca4a1330ab989e957e2.zip
|
|
||||||
|
|
||||||
build_flags =
|
|
||||||
${arduino_base.build_flags}
|
|
||||||
-D ARCH_PORTDUINO
|
|
||||||
-fPIC
|
|
||||||
-Isrc/platform/portduino
|
|
||||||
-DRADIOLIB_EEPROM_UNSUPPORTED
|
|
||||||
-DPORTDUINO_LINUX_HARDWARE
|
|
||||||
-DHAS_UDP_MULTICAST=1
|
|
||||||
-lpthread
|
|
||||||
-lstdc++fs
|
|
||||||
-lbluetooth
|
|
||||||
-lgpiod
|
|
||||||
-lyaml-cpp
|
|
||||||
-li2c
|
|
||||||
-luv
|
|
||||||
-std=gnu17
|
|
||||||
-std=c++17
|
|
||||||
|
|
||||||
lib_ignore =
|
|
||||||
Adafruit NeoPixel
|
|
||||||
Adafruit ST7735 and ST7789 Library
|
|
||||||
SD
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
; Common settings for rp2040 Processor based targets
|
|
||||||
[rp2040_base]
|
|
||||||
platform =
|
|
||||||
# TODO renovate
|
|
||||||
https://github.com/maxgerhardt/platform-raspberrypi#76ecf3c7e9dd4503af0331154c4ca1cddc4b03e5
|
|
||||||
; For arduino-pico >= 4.4.3
|
|
||||||
extends = arduino_base
|
|
||||||
platform_packages =
|
|
||||||
# TODO renovate
|
|
||||||
framework-arduinopico@https://github.com/earlephilhower/arduino-pico#4.4.3
|
|
||||||
|
|
||||||
board_build.core = earlephilhower
|
|
||||||
board_build.filesystem_size = 0.5m
|
|
||||||
build_flags =
|
|
||||||
${arduino_base.build_flags} -Wno-unused-variable -Wcast-align
|
|
||||||
-Isrc/platform/rp2xx0
|
|
||||||
-Isrc/platform/rp2xx0/hardware_rosc/include
|
|
||||||
-Isrc/platform/rp2xx0/pico_sleep/include
|
|
||||||
-D__PLAT_RP2040__
|
|
||||||
# -D _POSIX_THREADS
|
|
||||||
build_src_filter =
|
|
||||||
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<modules/esp32> -<platform/nrf52/> -<platform/stm32wl> -<mesh/eth/> -<mesh/wifi/> -<mesh/http/> -<mesh/raspihttp>
|
|
||||||
|
|
||||||
lib_ignore =
|
|
||||||
BluetoothOTA
|
|
||||||
lvgl
|
|
||||||
|
|
||||||
lib_deps =
|
|
||||||
${arduino_base.lib_deps}
|
|
||||||
${environmental_base.lib_deps}
|
|
||||||
${environmental_extra.lib_deps}
|
|
||||||
${radiolib_base.lib_deps}
|
|
||||||
# renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto
|
|
||||||
rweather/Crypto@0.4.0
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
; Common settings for rp2350 Processor based targets
|
|
||||||
[rp2350_base]
|
|
||||||
platform =
|
|
||||||
# TODO renovate
|
|
||||||
https://github.com/maxgerhardt/platform-raspberrypi#76ecf3c7e9dd4503af0331154c4ca1cddc4b03e5
|
|
||||||
; For arduino-pico >= 4.4.3
|
|
||||||
extends = arduino_base
|
|
||||||
platform_packages =
|
|
||||||
# TODO renovate
|
|
||||||
framework-arduinopico@https://github.com/earlephilhower/arduino-pico#4.4.3
|
|
||||||
|
|
||||||
board_build.core = earlephilhower
|
|
||||||
board_build.filesystem_size = 0.5m
|
|
||||||
build_flags =
|
|
||||||
${arduino_base.build_flags} -Wno-unused-variable -Wcast-align
|
|
||||||
-Isrc/platform/rp2xx0
|
|
||||||
-D__PLAT_RP2350__
|
|
||||||
build_src_filter =
|
|
||||||
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<modules/esp32> -<platform/nrf52/> -<platform/stm32wl> -<mesh/eth/> -<mesh/wifi/> -<mesh/http/> -<mesh/raspihttp> -<platform/rp2xx0/pico_sleep> -<platform/rp2xx0/hardware_rosc>
|
|
||||||
|
|
||||||
lib_ignore =
|
|
||||||
BluetoothOTA
|
|
||||||
lvgl
|
|
||||||
|
|
||||||
lib_deps =
|
|
||||||
${arduino_base.lib_deps}
|
|
||||||
${environmental_base.lib_deps}
|
|
||||||
${environmental_extra.lib_deps}
|
|
||||||
${radiolib_base.lib_deps}
|
|
||||||
# renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto
|
|
||||||
rweather/Crypto@0.4.0
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
[stm32_base]
|
|
||||||
extends = arduino_base
|
|
||||||
platform =
|
|
||||||
# renovate: datasource=custom.pio depName=platformio/ststm32 packageName=platformio/platform/ststm32
|
|
||||||
platformio/ststm32@19.3.0
|
|
||||||
platform_packages =
|
|
||||||
# TODO renovate
|
|
||||||
platformio/framework-arduinoststm32@https://github.com/stm32duino/Arduino_Core_STM32/archive/2.10.1.zip
|
|
||||||
extra_scripts =
|
|
||||||
${env.extra_scripts}
|
|
||||||
post:extra_scripts/extra_stm32.py
|
|
||||||
|
|
||||||
build_type = release
|
|
||||||
|
|
||||||
build_flags =
|
|
||||||
${arduino_base.build_flags}
|
|
||||||
-flto
|
|
||||||
-Isrc/platform/stm32wl -g
|
|
||||||
-DMESHTASTIC_EXCLUDE_AUDIO=1
|
|
||||||
-DMESHTASTIC_EXCLUDE_ATAK=1 ; ATAK is quite big, disable it for big flash savings.
|
|
||||||
-DMESHTASTIC_EXCLUDE_INPUTBROKER=1
|
|
||||||
-DMESHTASTIC_EXCLUDE_POWERMON=1
|
|
||||||
-DMESHTASTIC_EXCLUDE_SCREEN=1
|
|
||||||
-DMESHTASTIC_EXCLUDE_MQTT=1
|
|
||||||
-DMESHTASTIC_EXCLUDE_BLUETOOTH=1
|
|
||||||
-DMESHTASTIC_EXCLUDE_WIFI=1
|
|
||||||
-DMESHTASTIC_EXCLUDE_TZ=1 ; Exclude TZ to save some flash space.
|
|
||||||
-DSERIAL_RX_BUFFER_SIZE=256 ; For GPS - the default of 64 is too small.
|
|
||||||
-DHAS_SCREEN=0 ; Always disable screen for STM32, it is not supported.
|
|
||||||
-DPIO_FRAMEWORK_ARDUINO_NANOLIB_FLOAT_PRINTF ; This is REQUIRED for at least traceroute debug prints - without it the length ends up uninitialized.
|
|
||||||
-DDEBUG_MUTE ; You can #undef DEBUG_MUTE in certain source files if you need the logs.
|
|
||||||
-fmerge-all-constants
|
|
||||||
-ffunction-sections
|
|
||||||
-fdata-sections
|
|
||||||
-DRADIOLIB_EXCLUDE_SX128X=1
|
|
||||||
-DRADIOLIB_EXCLUDE_SX127X=1
|
|
||||||
-DRADIOLIB_EXCLUDE_LR11X0=1
|
|
||||||
-DHAL_DAC_MODULE_ONLY
|
|
||||||
-DHAL_RNG_MODULE_ENABLED
|
|
||||||
-Wl,--wrap=__assert_func
|
|
||||||
-Wl,--wrap=strerror
|
|
||||||
-Wl,--wrap=_tzset_unlocked_r
|
|
||||||
|
|
||||||
build_src_filter =
|
|
||||||
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<mesh/api/> -<mesh/wifi/> -<mesh/http/> -<modules/esp32> -<mesh/eth/> -<input> -<buzz> -<modules/RemoteHardwareModule.cpp> -<platform/nrf52> -<platform/portduino> -<platform/rp2xx0> -<mesh/raspihttp>
|
|
||||||
|
|
||||||
board_upload.offset_address = 0x08000000
|
|
||||||
upload_protocol = stlink
|
|
||||||
debug_tool = stlink
|
|
||||||
|
|
||||||
lib_deps =
|
|
||||||
${env.lib_deps}
|
|
||||||
${radiolib_base.lib_deps}
|
|
||||||
|
|
||||||
# renovate: datasource=git-refs depName=caveman99-stm32-Crypto packageName=https://github.com/caveman99/Crypto gitBranch=main
|
|
||||||
https://github.com/caveman99/Crypto/archive/1aa30eb536bd52a576fde6dfa393bf7349cf102d.zip
|
|
||||||
|
|
||||||
lib_ignore =
|
|
||||||
OneButton
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
config.yaml
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# Set spidev ownership to 'spi' group
|
|
||||||
SUBSYSTEM=="spidev", KERNEL=="spidev*", GROUP="spi", MODE="0660"
|
|
||||||
# Allow access to USB CH341 devices
|
|
||||||
SUBSYSTEM=="usb", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="5512", MODE="0666"
|
|
||||||
# Set gpio ownership to 'gpio' group
|
|
||||||
SUBSYSTEM=="*gpiomem*", GROUP="gpio", MODE="0660"
|
|
||||||
SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660"
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user