mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-09-30 19:33:42 +08:00
unify agnos/neos installers (#22023)
* c2 installer * remove old installer * move to its own dir * die immediately * fix that * init app
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
moc_*
|
||||
*.moc
|
||||
|
||||
installer/installers/*
|
||||
|
||||
replay/replay
|
||||
qt/text
|
||||
qt/spinner
|
||||
@@ -8,4 +10,3 @@ qt/setup/setup
|
||||
qt/setup/reset
|
||||
qt/setup/wifi
|
||||
qt/setup/updater
|
||||
qt/setup/installer_*
|
||||
|
||||
+15
-8
@@ -52,7 +52,8 @@ qt_src = ["main.cc", "ui.cc", "paint.cc", "qt/sidebar.cc", "qt/onroad.cc",
|
||||
|
||||
qt_env.Program("_ui", qt_src, LIBS=qt_libs)
|
||||
|
||||
# setup, factory resetter, and installer
|
||||
|
||||
# setup, factory resetter, and agnos updater
|
||||
if arch != 'aarch64' and GetOption('setup'):
|
||||
|
||||
# TODO: do this for all resources once NEOS has rcc
|
||||
@@ -67,20 +68,26 @@ if arch != 'aarch64' and GetOption('setup'):
|
||||
qt_env.Program("qt/setup/setup", ["qt/setup/setup.cc", asset_obj],
|
||||
LIBS=qt_libs + ['curl', 'common', 'json11'])
|
||||
|
||||
|
||||
# build installers
|
||||
if GetOption('setup'):
|
||||
senv = qt_env.Clone()
|
||||
senv['LINKFLAGS'].append('-Wl,-strip-debug')
|
||||
|
||||
release = "release3" if arch == 'larch64' else "release2"
|
||||
dashcam = "dashcam3" if arch == 'larch64' else "dashcam"
|
||||
installers = [
|
||||
("openpilot", "release3"),
|
||||
("openpilot_test", "release3-staging"),
|
||||
("openpilot", release),
|
||||
("openpilot_test", f"{release}-staging"),
|
||||
("openpilot_nightly", "master-ci"),
|
||||
("openpilot_internal", "master"),
|
||||
("dashcam", "dashcam3"),
|
||||
("dashcam_test", "dashcam3-staging"),
|
||||
("dashcam", dashcam),
|
||||
("dashcam_test", f"{dashcam}-staging"),
|
||||
]
|
||||
|
||||
cont = {}
|
||||
for brand in ("openpilot", "dashcam"):
|
||||
cont[brand] = senv.Command(f"qt/setup/continue_{brand}.o", f"#installer/continue_{brand}.sh",
|
||||
cont[brand] = senv.Command(f"installer/continue_{brand}.o", f"installer/continue_{brand}.sh",
|
||||
"ld -r -b binary -o $TARGET $SOURCE")
|
||||
for name, branch in installers:
|
||||
brand = "dashcam" if "dashcam" in branch else "openpilot"
|
||||
@@ -92,8 +99,8 @@ if arch != 'aarch64' and GetOption('setup'):
|
||||
r = requests.get("https://github.com/commaci2.keys")
|
||||
r.raise_for_status()
|
||||
d['SSH_KEYS'] = f'\\"{r.text.strip()}\\"'
|
||||
obj = senv.Object(f"qt/setup/installer_{name}.o", ["qt/setup/installer.cc"], CPPDEFINES=d)
|
||||
f = senv.Program(f"qt/setup/installer_{name}", [obj, cont[brand]], LIBS=qt_libs)
|
||||
obj = senv.Object(f"installer/installers/installer_{name}.o", ["installer/installer.cc"], CPPDEFINES=d)
|
||||
f = senv.Program(f"installer/installers/installer_{name}", [obj, cont[brand]], LIBS=qt_libs)
|
||||
# keep installers small
|
||||
assert f[0].get_size() < 300*1e3
|
||||
|
||||
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
cd /data/openpilot
|
||||
exec ./launch_chffrplus.sh
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
cd /data/openpilot
|
||||
exec ./launch_openpilot.sh
|
||||
@@ -10,21 +10,26 @@
|
||||
#include <QTimer>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "selfdrive/ui/installer/installer.h"
|
||||
#include "selfdrive/ui/qt/util.h"
|
||||
#include "selfdrive/ui/qt/qt_window.h"
|
||||
#include "selfdrive/ui/qt/setup/installer.h"
|
||||
|
||||
#define GIT_URL "https://github.com/commaai/openpilot.git"
|
||||
#define GIT_SSH_URL "git@github.com:commaai/openpilot.git"
|
||||
|
||||
#define CONTINUE_PATH "/data/continue.sh"
|
||||
#ifdef QCOM
|
||||
#define CONTINUE_PATH "/data/data/com.termux/files/continue.sh"
|
||||
#define CACHE_PATH "/system/comma/openpilot"
|
||||
#else
|
||||
#define CONTINUE_PATH "/data/continue.sh"
|
||||
#define CACHE_PATH "/usr/comma/openpilot"
|
||||
#endif
|
||||
|
||||
#define CACHE_PATH "/usr/comma/openpilot"
|
||||
#define INSTALL_PATH "/data/openpilot"
|
||||
#define TMP_INSTALL_PATH "/data/tmppilot"
|
||||
|
||||
extern const uint8_t str_continue[] asm("_binary_installer_continue_" BRAND "_sh_start");
|
||||
extern const uint8_t str_continue_end[] asm("_binary_installer_continue_" BRAND "_sh_end");
|
||||
extern const uint8_t str_continue[] asm("_binary_selfdrive_ui_installer_continue_" BRAND "_sh_start");
|
||||
extern const uint8_t str_continue_end[] asm("_binary_selfdrive_ui_installer_continue_" BRAND "_sh_end");
|
||||
|
||||
bool time_valid() {
|
||||
time_t rawtime;
|
||||
@@ -195,8 +200,12 @@ void Installer::cloneFinished(int exitCode, QProcess::ExitStatus exitStatus) {
|
||||
run("chmod +x /data/continue.sh.new");
|
||||
run("mv /data/continue.sh.new " CONTINUE_PATH);
|
||||
|
||||
#ifdef QCOM
|
||||
QTimer::singleShot(100, &QCoreApplication::quit);
|
||||
#else
|
||||
// wait for the installed software's UI to take over
|
||||
QTimer::singleShot(60 * 1000, &QCoreApplication::quit);
|
||||
#endif
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
Reference in New Issue
Block a user