embed continue scripts in installer (#21846)
* embed continue scripts in installer * cleanuppull/21847/head
parent
ae1f5e0e8c
commit
31a4b55218
|
@ -1,5 +1,3 @@
|
|||
installer/continue_openpilot.sh
|
||||
|
||||
phonelibs/mapbox-gl-native-qt/include/*
|
||||
|
||||
selfdrive/timezoned.py
|
||||
|
|
|
@ -76,9 +76,14 @@ if arch != 'aarch64' and GetOption('setup'):
|
|||
("dashcam", "dashcam3"),
|
||||
("dashcam_test", "dashcam3-staging"),
|
||||
]
|
||||
|
||||
cont = {}
|
||||
for brand in ("openpilot", "dashcam"):
|
||||
cont[brand] = senv.Command(f"qt/setup/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"
|
||||
d = {'BRANCH': f"'\"{branch}\"'", 'CONTINUE_SRC_PATH': f"'\"installer/continue_{brand}.sh\"'"}
|
||||
d = {'BRANCH': f"'\"{branch}\"'", 'BRAND': f"'\"{brand}\"'"}
|
||||
if "internal" in name:
|
||||
d['INTERNAL'] = "1"
|
||||
|
||||
|
@ -87,7 +92,7 @@ if arch != 'aarch64' and GetOption('setup'):
|
|||
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, LIBS=qt_libs)
|
||||
f = senv.Program(f"qt/setup/installer_{name}", [obj, cont[brand]], LIBS=qt_libs)
|
||||
# keep installers small
|
||||
assert f[0].get_size() < 300*1e3
|
||||
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
#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");
|
||||
|
||||
bool time_valid() {
|
||||
time_t rawtime;
|
||||
|
@ -182,7 +184,14 @@ void Installer::cloneFinished(int exitCode, QProcess::ExitStatus exitStatus) {
|
|||
#endif
|
||||
|
||||
// write continue.sh
|
||||
run("cp " INSTALL_PATH "/" CONTINUE_SRC_PATH " /data/continue.sh.new");
|
||||
FILE *of = fopen("/data/continue.sh.new", "wb");
|
||||
assert(of != NULL);
|
||||
|
||||
size_t num = str_continue_end - str_continue;
|
||||
size_t num_written = fwrite(str_continue, 1, num, of);
|
||||
assert(num == num_written);
|
||||
fclose(of);
|
||||
|
||||
run("chmod +x /data/continue.sh.new");
|
||||
run("mv /data/continue.sh.new " CONTINUE_PATH);
|
||||
|
||||
|
|
Loading…
Reference in New Issue