build all installers simulataneously

old-commit-hash: 242a8ba17a
commatwo_master
Comma Device 4 years ago
parent 6387e8da63
commit 7b818198f1
  1. 11
      selfdrive/ui/SConscript
  2. 21
      selfdrive/ui/qt/setup/installer.cc

@ -39,10 +39,10 @@ if arch != 'aarch64' and "BUILD_SETUP" in os.environ:
installers = [
("openpilot", "master"),
#("openpilot_test", "release3-staging"),
#("openpilot_internal", "master"),
#("dashcam", "dashcam3-staging"),
#("dashcam_test", "dashcam3-staging"),
("openpilot_test", "release3-staging"),
("openpilot_internal", "master"),
("dashcam", "dashcam3-staging"),
("dashcam_test", "dashcam3-staging"),
]
for name, branch in installers:
d = {'BRANCH': f"'\"{branch}\"'"}
@ -53,4 +53,5 @@ if arch != 'aarch64' and "BUILD_SETUP" in os.environ:
r = requests.get("https://github.com/commaci2.keys")
r.raise_for_status()
d['SSH_KEYS'] = f'\\"{r.text.strip()}\\"'
qt_env.Program(f"qt/setup/installer_{name}", ["qt/setup/installer.cc"], LIBS=qt_libs, CPPDEFINES=d)
obj = qt_env.Object(f"qt/setup/installer_{name}.o", ["qt/setup/installer.cc"], CPPDEFINES=d)
qt_env.Program(f"qt/setup/installer_{name}", obj, LIBS=qt_libs, CPPDEFINES=d)

@ -3,6 +3,7 @@
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <map>
#ifndef BRANCH
#define BRANCH "master"
@ -41,15 +42,17 @@ int fresh_clone() {
err = std::system("mkdir -p /data/params/d/");
if (err) return 1;
std::ofstream param;
param.open("/data/params/d/RecordFrontLock");
param << "1";
param.close();
std::ofstream keys_param;
keys_param.open("/data/params/d/GithubSshKeys");
keys_param << SSH_KEYS;
keys_param.close();
std::map<std::string, std::string> params = {
{"SshEnabled", "1"},
{"RecordFrontLock", "1"},
{"GithubSshKeys", SSH_KEYS},
};
for (const auto& [key, value] : params) {
std::ofstream param;
param.open("/data/params/d/RecordFrontLock" + key);
param << value;
param.close();
}
#endif
return 0;

Loading…
Cancel
Save