build all installers simulataneously

albatross
Comma Device 2021-04-11 15:14:06 -07:00
parent 1858c696f2
commit 242a8ba17a
2 changed files with 18 additions and 14 deletions

View File

@ -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)

View File

@ -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;