mirror of
https://github.com/commaai/agnos-builder.git
synced 2026-08-16 21:53:44 +08:00
remove RTC time pull from panda (#202)
This commit is contained in:
@@ -150,15 +150,6 @@ COPY ./userspace/usr/share/fonts/* /usr/share/fonts/
|
||||
COPY ./userspace/libs/* /usr/lib/aarch64-linux-gnu/
|
||||
COPY ./userspace/libs32/* /usr/lib/arm-linux-gnueabihf/
|
||||
|
||||
# copy of panda python lib
|
||||
RUN cd /tmp/ && \
|
||||
git clone https://github.com/commaai/panda.git && \
|
||||
cd panda && \
|
||||
git fetch --all && \
|
||||
git checkout dd78b2bf6c9d63ef59e81d0c400e85c8b477a8be && \
|
||||
mkdir /usr/comma/panda/ && \
|
||||
mv __init__.py python/ /usr/comma/panda/
|
||||
|
||||
# kernel headers for the AGNOS kernel (built on device)
|
||||
COPY ./userspace/files/linux-headers-4.9.103+_4.9.103+-1_arm64.deb /tmp/
|
||||
RUN dpkg -i /tmp/linux-headers-4.9.103+_4.9.103+-1_arm64.deb
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
[Unit]
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/local/pyenv/shims/python -u /usr/comma/set_time.py
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -23,7 +23,6 @@ systemctl enable ssh-param-watcher.path
|
||||
systemctl enable ssh-param-watcher.service
|
||||
systemctl enable home.mount
|
||||
systemctl enable logrotate-hourly.timer
|
||||
systemctl enable set_time.service
|
||||
systemctl enable phantom_touch_logger.service
|
||||
|
||||
# Disable some of our services
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
import datetime
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
here = os.path.dirname(os.path.realpath(__file__))
|
||||
sys.path.insert(0, here)
|
||||
from panda import Panda
|
||||
|
||||
# Systemd pushes the system time to the systemd build time if no time is set
|
||||
MIN_DATE = datetime.datetime.fromtimestamp(Path("/lib/systemd/systemd").stat().st_mtime)
|
||||
MIN_DATE += datetime.timedelta(days=1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys_time = datetime.datetime.today()
|
||||
print(f"System time: {sys_time}")
|
||||
if sys_time > MIN_DATE:
|
||||
print("System time valid")
|
||||
exit()
|
||||
|
||||
ps = Panda.list()
|
||||
if len(ps) == 0:
|
||||
print("Failed to set time, no pandas found")
|
||||
exit()
|
||||
|
||||
for s in ps:
|
||||
with Panda(serial=s) as p:
|
||||
if not p.is_internal():
|
||||
continue
|
||||
|
||||
# Set system time from panda RTC time
|
||||
panda_time = p.get_datetime()
|
||||
print(f"panda time: {panda_time}")
|
||||
if panda_time > MIN_DATE:
|
||||
print(f"adjusting time from '{sys_time}' to '{panda_time}'")
|
||||
os.system(f"TZ=UTC date -s '{panda_time}'")
|
||||
else:
|
||||
print("panda time invalid")
|
||||
break
|
||||
else:
|
||||
print("No internal pandas found")
|
||||
@@ -51,10 +51,6 @@ def test_color_calibration():
|
||||
def test_python_shims():
|
||||
subprocess.check_call("cd /data/openpilot && scons -h", shell=True, stdout=subprocess.DEVNULL)
|
||||
|
||||
def test_set_time():
|
||||
# TODO: ensure time is set from panda RTC
|
||||
pass
|
||||
|
||||
def test_dmesg():
|
||||
# TODO: ensure no new errors in dmesg. would catch things like the brightness setting bug
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user