Skip to content

Commit

Permalink
agnos 0.6 (#20077)
Browse files Browse the repository at this point in the history
* updates for agnos 0.6

* timezone

* bump version
  • Loading branch information
adeebshihadeh authored Feb 19, 2021
1 parent a0cdacb commit d169914
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 20 deletions.
1 change: 1 addition & 0 deletions common/params_pyx.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ keys = {
b"ReleaseNotes": [TxType.PERSISTENT],
b"ShouldDoUpdate": [TxType.CLEAR_ON_MANAGER_START],
b"SubscriberInfo": [TxType.PERSISTENT],
b"SshEnabled": [TxType.PERSISTENT],
b"TermsVersion": [TxType.PERSISTENT],
b"Timezone": [TxType.PERSISTENT],
b"TrainingVersion": [TxType.PERSISTENT],
Expand Down
2 changes: 1 addition & 1 deletion launch_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if [ -z "$REQUIRED_NEOS_VERSION" ]; then
fi

if [ -z "$AGNOS_VERSION" ]; then
export AGNOS_VERSION="0.5"
export AGNOS_VERSION="0.6"
fi

if [ -z "$PASSIVE" ]; then
Expand Down
14 changes: 7 additions & 7 deletions selfdrive/hardware/tici/agnos.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[
{
"name": "system",
"url": "https://commadist.azureedge.net/agnosupdate-staging/system-c74abe031e98073efca757f07903ad356e4ccf583a8c54c643d060bafddcd874.img.xz",
"hash": "6313b8f6cfaecfe8d37bd1f25ff7781a2b312eac85db817bda08dd0268dc471b",
"hash_raw": "c74abe031e98073efca757f07903ad356e4ccf583a8c54c643d060bafddcd874",
"url": "https://commadist.azureedge.net/agnosupdate-staging/system-f6c3e2b5b26e070a0b99afb004c2d48bba27ab1b85a48fcf87b43ca302faf614.img.xz",
"hash": "d51aedd84defed389eede52d2fa871846cc8d639bbf69215e0fb38ba25a47e42",
"hash_raw": "f6c3e2b5b26e070a0b99afb004c2d48bba27ab1b85a48fcf87b43ca302faf614",
"size": 10737418240,
"sparse": true
},
{
"name": "boot",
"url": "https://commadist.azureedge.net/agnosupdate-staging/boot-cf067c059a5c037c17659c97ec897f4e79271be67b1c9e6a602207a5a9e6f8a5.img.xz",
"hash": "cf067c059a5c037c17659c97ec897f4e79271be67b1c9e6a602207a5a9e6f8a5",
"hash_raw": "cf067c059a5c037c17659c97ec897f4e79271be67b1c9e6a602207a5a9e6f8a5",
"size": 14673920,
"url": "https://commadist.azureedge.net/agnosupdate-staging/boot-d292aacf2f760e85c60c1a25adcecae9df2c80ee3f3240ea8592bbac369db038.img.xz",
"hash": "d292aacf2f760e85c60c1a25adcecae9df2c80ee3f3240ea8592bbac369db038",
"hash_raw": "d292aacf2f760e85c60c1a25adcecae9df2c80ee3f3240ea8592bbac369db038",
"size": 14768128,
"sparse": false
}
]
12 changes: 10 additions & 2 deletions selfdrive/timezoned.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#!/usr/bin/env python3
import time
import json
import os
import time
import subprocess

import requests
from timezonefinder import TimezoneFinder

from common.params import Params
from selfdrive.hardware import TICI
from selfdrive.swaglog import cloudlog


Expand All @@ -17,7 +19,13 @@ def set_timezone(valid_timezones, timezone):

cloudlog.info(f"Setting timezone to {timezone}")
try:
subprocess.check_call(f'sudo timedatectl set-timezone {timezone}', shell=True)
if TICI:
tzpath = os.path.join("/usr/share/zoneinfo/", timezone)
os.symlink(tzpath, "/data/etc/localtime")
with open("/data/etc/timezone", "w") as f:
f.write(timezone)
else:
subprocess.check_call(f'sudo timedatectl set-timezone {timezone}', shell=True)
except subprocess.CalledProcessError:
cloudlog.exception(f"Error setting timezone to {timezone}")

Expand Down
7 changes: 3 additions & 4 deletions selfdrive/ui/qt/offroad/networking.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <QRandomGenerator>
#include <QtConcurrent>

#include "common/params.h"
#include "networking.hpp"
#include "util.h"

Expand Down Expand Up @@ -280,14 +281,12 @@ void AdvancedNetworking::toggleTethering(int enable) {
}

void enableSSH(Toggle* toggle_switch_SSH){
system("sudo systemctl enable ssh");
system("sudo systemctl start ssh");
Params().write_db_value("SshEnabled", "1");
toggle_switch_SSH->setEnabled(true);
}

void disableSSH(Toggle* toggle_switch_SSH){
system("sudo systemctl stop ssh");
system("sudo systemctl disable ssh");
Params().write_db_value("SshEnabled", "0");
toggle_switch_SSH->setEnabled(true);
}

Expand Down
10 changes: 4 additions & 6 deletions selfdrive/ui/qt/setup/installer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,16 @@ int fresh_clone() {
int err;

// Cleanup
err = std::system("rm -rf /tmp/openpilot /data/openpilot");
err = std::system("rm -rf /data/tmppilot /data/openpilot");
if (err) return 1;

// Clone
err = std::system("git clone " GIT_URL " -b " BRANCH " --depth=1 /tmp/openpilot");
err = std::system("git clone " GIT_URL " -b " BRANCH " --depth=1 --recurse-submodules /data/tmppilot");
if (err) return 1;
err = std::system("cd /tmp/openpilot && git submodule update --init");
if (err) return 1;
err = std::system("cd /tmp/openpilot && git remote set-url origin --push " GIT_SSH_URL);
err = std::system("cd /data/tmppilot && git remote set-url origin --push " GIT_SSH_URL);
if (err) return 1;

err = std::system("mv /tmp/openpilot /data");
err = std::system("mv /data/tmppilot /data/openpilot");
if (err) return 1;

#ifdef SSH_KEYS
Expand Down

0 comments on commit d169914

Please sign in to comment.