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. 17
      selfdrive/ui/qt/setup/installer.cc

@ -39,10 +39,10 @@ if arch != 'aarch64' and "BUILD_SETUP" in os.environ:
installers = [ installers = [
("openpilot", "master"), ("openpilot", "master"),
#("openpilot_test", "release3-staging"), ("openpilot_test", "release3-staging"),
#("openpilot_internal", "master"), ("openpilot_internal", "master"),
#("dashcam", "dashcam3-staging"), ("dashcam", "dashcam3-staging"),
#("dashcam_test", "dashcam3-staging"), ("dashcam_test", "dashcam3-staging"),
] ]
for name, branch in installers: for name, branch in installers:
d = {'BRANCH': f"'\"{branch}\"'"} 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 = requests.get("https://github.com/commaci2.keys")
r.raise_for_status() r.raise_for_status()
d['SSH_KEYS'] = f'\\"{r.text.strip()}\\"' 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 <cstdlib>
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
#include <map>
#ifndef BRANCH #ifndef BRANCH
#define BRANCH "master" #define BRANCH "master"
@ -41,15 +42,17 @@ int fresh_clone() {
err = std::system("mkdir -p /data/params/d/"); err = std::system("mkdir -p /data/params/d/");
if (err) return 1; if (err) return 1;
std::map<std::string, std::string> params = {
{"SshEnabled", "1"},
{"RecordFrontLock", "1"},
{"GithubSshKeys", SSH_KEYS},
};
for (const auto& [key, value] : params) {
std::ofstream param; std::ofstream param;
param.open("/data/params/d/RecordFrontLock"); param.open("/data/params/d/RecordFrontLock" + key);
param << "1"; param << value;
param.close(); param.close();
}
std::ofstream keys_param;
keys_param.open("/data/params/d/GithubSshKeys");
keys_param << SSH_KEYS;
keys_param.close();
#endif #endif
return 0; return 0;

Loading…
Cancel
Save