diff --git a/.github/workflows/selfdrive_tests.yaml b/.github/workflows/selfdrive_tests.yaml index a504e2b135..d959df82d3 100644 --- a/.github/workflows/selfdrive_tests.yaml +++ b/.github/workflows/selfdrive_tests.yaml @@ -295,7 +295,7 @@ jobs: ./common/tests/test_swaglog && \ ./selfdrive/boardd/tests/test_boardd_usbprotocol && \ ./selfdrive/loggerd/tests/test_logger &&\ - ./selfdrive/proclogd/tests/test_proclog && \ + ./system/proclogd/tests/test_proclog && \ ./selfdrive/ui/replay/tests/test_replay && \ ./selfdrive/camerad/test/ae_gray_test && \ coverage xml" diff --git a/.gitignore b/.gitignore index 83ccbb4781..334b1b4fed 100644 --- a/.gitignore +++ b/.gitignore @@ -41,7 +41,7 @@ board/obj/ selfdrive/boardd/boardd selfdrive/logcatd/logcatd selfdrive/mapd/default_speeds_by_region.json -selfdrive/proclogd/proclogd +system/proclogd/proclogd selfdrive/ui/_ui selfdrive/test/longitudinal_maneuvers/out selfdrive/visiond/visiond diff --git a/Dockerfile.openpilot b/Dockerfile.openpilot index daf85f8183..66b9f18a11 100644 --- a/Dockerfile.openpilot +++ b/Dockerfile.openpilot @@ -28,5 +28,6 @@ COPY ./opendbc ${OPENPILOT_PATH}/opendbc COPY ./cereal ${OPENPILOT_PATH}/cereal COPY ./panda ${OPENPILOT_PATH}/panda COPY ./selfdrive ${OPENPILOT_PATH}/selfdrive +COPY ./system ${OPENPILOT_PATH}/system RUN scons -j$(nproc) diff --git a/README.md b/README.md index 5af02de8d9..9d279fb84d 100755 --- a/README.md +++ b/README.md @@ -102,6 +102,9 @@ Directory Structure ├── panda # Code used to communicate on CAN ├── third_party # External libraries ├── pyextra # Extra python packages + └── system # Generic services + ├── logcatd # systemd journal as a service + └── proclogd # Logs information from /proc └── selfdrive # Code needed to drive the car ├── assets # Fonts, images, and sounds for UI ├── athena # Allows communication with the app @@ -112,7 +115,6 @@ Directory Structure ├── controls # Planning and controls ├── debug # Tools to help you debug and do car ports ├── locationd # Precise localization and vehicle parameter estimation - ├── logcatd # Android logcat as a service ├── loggerd # Logger and uploader of car data ├── modeld # Driving and monitoring model runners ├── proclogd # Logs information from proc diff --git a/SConstruct b/SConstruct index e6141f7385..e0e24d2664 100644 --- a/SConstruct +++ b/SConstruct @@ -377,6 +377,12 @@ if arch != "larch64": Export('rednose_config') SConscript(['rednose/SConscript']) +# Build system services + +SConscript(['system/proclogd/SConscript']) +if arch != "Darwin": + SConscript(['system/logcatd/SConscript']) + # Build openpilot SConscript(['cereal/SConscript']) @@ -396,7 +402,6 @@ SConscript(['selfdrive/controls/lib/lateral_mpc_lib/SConscript']) SConscript(['selfdrive/controls/lib/longitudinal_mpc_lib/SConscript']) SConscript(['selfdrive/boardd/SConscript']) -SConscript(['selfdrive/proclogd/SConscript']) SConscript(['selfdrive/clocksd/SConscript']) SConscript(['selfdrive/loggerd/SConscript']) @@ -405,9 +410,6 @@ SConscript(['selfdrive/locationd/SConscript']) SConscript(['selfdrive/sensord/SConscript']) SConscript(['selfdrive/ui/SConscript']) -if arch != "Darwin": - SConscript(['selfdrive/logcatd/SConscript']) - if GetOption('test'): SConscript('panda/tests/safety/SConscript') diff --git a/docs/c_docs.rst b/docs/c_docs.rst index 1e080a826d..218cd5a7d9 100644 --- a/docs/c_docs.rst +++ b/docs/c_docs.rst @@ -66,7 +66,7 @@ qt proclogd ^^^^^^^^ .. autodoxygenindex:: - :project: selfdrive_proclogd + :project: system_proclogd modeld ^^^^^^ diff --git a/docs/docker/Dockerfile b/docs/docker/Dockerfile index 124feb1bfc..cefe9be855 100644 --- a/docs/docker/Dockerfile +++ b/docs/docker/Dockerfile @@ -30,6 +30,7 @@ COPY ./opendbc ${OPENPILOT_PATH}/opendbc COPY ./cereal ${OPENPILOT_PATH}/cereal COPY ./panda ${OPENPILOT_PATH}/panda COPY ./selfdrive ${OPENPILOT_PATH}/selfdrive +COPY ./system ${OPENPILOT_PATH}/system COPY ./*.md ${OPENPILOT_PATH}/ RUN scons -j$(nproc) diff --git a/release/files_common b/release/files_common index 974ea27711..9c6a2cec47 100644 --- a/release/files_common +++ b/release/files_common @@ -220,13 +220,13 @@ selfdrive/locationd/models/live_kf.cc selfdrive/locationd/calibrationd.py -selfdrive/logcatd/SConscript -selfdrive/logcatd/logcatd_systemd.cc +system/logcatd/SConscript +system/logcatd/logcatd_systemd.cc -selfdrive/proclogd/SConscript -selfdrive/proclogd/main.cc -selfdrive/proclogd/proclog.cc -selfdrive/proclogd/proclog.h +system/proclogd/SConscript +system/proclogd/main.cc +system/proclogd/proclog.cc +system/proclogd/proclog.h selfdrive/loggerd/SConscript selfdrive/loggerd/encoder/encoder.cc diff --git a/selfdrive/manager/process_config.py b/selfdrive/manager/process_config.py index 48524aec1d..4a71aa508b 100644 --- a/selfdrive/manager/process_config.py +++ b/selfdrive/manager/process_config.py @@ -23,11 +23,11 @@ procs = [ NativeProcess("camerad", "selfdrive/camerad", ["./camerad"], unkillable=True, callback=driverview), NativeProcess("clocksd", "selfdrive/clocksd", ["./clocksd"]), NativeProcess("dmonitoringmodeld", "selfdrive/modeld", ["./dmonitoringmodeld"], enabled=(not PC or WEBCAM), callback=driverview), - NativeProcess("logcatd", "selfdrive/logcatd", ["./logcatd"]), + NativeProcess("logcatd", "system/logcatd", ["./logcatd"]), NativeProcess("encoderd", "selfdrive/loggerd", ["./encoderd"]), NativeProcess("loggerd", "selfdrive/loggerd", ["./loggerd"], onroad=False, callback=logging), NativeProcess("modeld", "selfdrive/modeld", ["./modeld"]), - NativeProcess("proclogd", "selfdrive/proclogd", ["./proclogd"]), + NativeProcess("proclogd", "system/proclogd", ["./proclogd"]), NativeProcess("sensord", "selfdrive/sensord", ["./sensord"], enabled=not PC), NativeProcess("ubloxd", "selfdrive/locationd", ["./ubloxd"], enabled=(not PC or WEBCAM)), NativeProcess("ui", "selfdrive/ui", ["./ui"], offroad=True, watchdog_max_dt=(5 if not PC else None)), diff --git a/selfdrive/logcatd/.gitignore b/system/logcatd/.gitignore similarity index 100% rename from selfdrive/logcatd/.gitignore rename to system/logcatd/.gitignore diff --git a/selfdrive/logcatd/SConscript b/system/logcatd/SConscript similarity index 100% rename from selfdrive/logcatd/SConscript rename to system/logcatd/SConscript diff --git a/selfdrive/logcatd/logcatd_systemd.cc b/system/logcatd/logcatd_systemd.cc similarity index 100% rename from selfdrive/logcatd/logcatd_systemd.cc rename to system/logcatd/logcatd_systemd.cc diff --git a/selfdrive/proclogd/SConscript b/system/proclogd/SConscript similarity index 100% rename from selfdrive/proclogd/SConscript rename to system/proclogd/SConscript diff --git a/selfdrive/proclogd/main.cc b/system/proclogd/main.cc similarity index 89% rename from selfdrive/proclogd/main.cc rename to system/proclogd/main.cc index 288238dc9a..c4faa916d9 100644 --- a/selfdrive/proclogd/main.cc +++ b/system/proclogd/main.cc @@ -2,7 +2,7 @@ #include #include "common/util.h" -#include "selfdrive/proclogd/proclog.h" +#include "system/proclogd/proclog.h" ExitHandler do_exit; diff --git a/selfdrive/proclogd/proclog.cc b/system/proclogd/proclog.cc similarity index 99% rename from selfdrive/proclogd/proclog.cc rename to system/proclogd/proclog.cc index 215d9e9df0..9064547d29 100644 --- a/selfdrive/proclogd/proclog.cc +++ b/system/proclogd/proclog.cc @@ -1,4 +1,4 @@ -#include "selfdrive/proclogd/proclog.h" +#include "system/proclogd/proclog.h" #include diff --git a/selfdrive/proclogd/proclog.h b/system/proclogd/proclog.h similarity index 100% rename from selfdrive/proclogd/proclog.h rename to system/proclogd/proclog.h diff --git a/selfdrive/proclogd/tests/.gitignore b/system/proclogd/tests/.gitignore similarity index 100% rename from selfdrive/proclogd/tests/.gitignore rename to system/proclogd/tests/.gitignore diff --git a/selfdrive/proclogd/tests/test_proclog.cc b/system/proclogd/tests/test_proclog.cc similarity index 99% rename from selfdrive/proclogd/tests/test_proclog.cc rename to system/proclogd/tests/test_proclog.cc index 3e346988c6..230e855acb 100644 --- a/selfdrive/proclogd/tests/test_proclog.cc +++ b/system/proclogd/tests/test_proclog.cc @@ -1,7 +1,7 @@ #define CATCH_CONFIG_MAIN #include "catch2/catch.hpp" #include "common/util.h" -#include "selfdrive/proclogd/proclog.h" +#include "system/proclogd/proclog.h" const std::string allowed_states = "RSDTZtWXxKWPI"; diff --git a/tools/sim/Dockerfile.sim b/tools/sim/Dockerfile.sim index 27cf25550f..7606c44846 100644 --- a/tools/sim/Dockerfile.sim +++ b/tools/sim/Dockerfile.sim @@ -54,6 +54,7 @@ COPY ./opendbc $HOME/openpilot/opendbc COPY ./cereal $HOME/openpilot/cereal COPY ./panda $HOME/openpilot/panda COPY ./selfdrive $HOME/openpilot/selfdrive +COPY ./system $HOME/openpilot/system COPY ./tools $HOME/openpilot/tools WORKDIR $HOME/openpilot