Skip to content

Commit

Permalink
NO_UPSTREAM: update ping and driver services to use userdata for sett…
Browse files Browse the repository at this point in the history
…ings
  • Loading branch information
Williangalvani committed Feb 13, 2024
1 parent 3f20269 commit 29e952c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion core/services/bridget/bridget.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
from pathlib import Path
from typing import Dict, List

import requests
Expand Down Expand Up @@ -44,7 +45,7 @@ class Bridget:

def __init__(self) -> None:
self._bridges: Dict[BridgeFrontendSpec, Bridge] = {}
self._settings_manager = Manager("bridget", SettingsV2)
self._settings_manager = Manager("bridget", SettingsV2, Path("/usr/blueos/userdata/bridget/"))
self._settings_manager.load()
for bridge_settings_spec in self._settings_manager.settings.specsv2:
try:
Expand Down
3 changes: 2 additions & 1 deletion core/services/ping/ping1d_driver.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import asyncio
from pathlib import Path

from bridges.bridges import Bridge
from commonwealth.settings.manager import Manager
Expand All @@ -16,7 +17,7 @@ class Ping1DDriver(PingDriver):
def __init__(self, ping: PingDeviceDescriptor, port: int) -> None:
super().__init__(ping, port)
# load settings
self.manager = Manager(SERVICE_NAME, SettingsV1)
self.manager = Manager(SERVICE_NAME, SettingsV1, Path("/usr/blueos/userdata/ping/"))
# our settings file is a list for each sensor type.
# check the list to find our current sensor in it
connection_info = self.ping.get_hw_or_eth_info()
Expand Down
3 changes: 3 additions & 0 deletions core/start-blueos-core
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ fi

# fix permissions for logging folders:
find /var/logs/blueos -type d -exec chmod 777 {} \;
mkdir -p /usr/blueos/userdata/
find /usr/blueos -type d -exec chmod 777 {} \;
ln -s /root/.config /home/blueos/.config || true;

# These services have priority because they do the fundamental for the vehicle to work,
# and by initializing them first we reduce the time users have to wait to control the vehicle.
Expand Down

0 comments on commit 29e952c

Please sign in to comment.