Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Commit

Permalink
Merge branch 'reactlabs_changes'
Browse files Browse the repository at this point in the history
  • Loading branch information
amokfa committed Jan 6, 2023
2 parents cb5444b + 0c3f894 commit f46e8ca
Show file tree
Hide file tree
Showing 8 changed files with 163 additions and 247 deletions.
15 changes: 12 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ archs.forEach { arch ->
println(String(process.inputStream.readAllBytes()))
println(String(process.errorStream.readAllBytes()))

assert(process.waitFor() == 0)
if (process.waitFor() != 0) {
throw Exception("cargo build failed")
}
}
}

Expand All @@ -95,7 +97,9 @@ archs.forEach { arch ->
println(String(process.inputStream.readAllBytes()))
println(String(process.errorStream.readAllBytes()))

assert(process.waitFor() == 0)
if (process.waitFor() != 0) {
throw Exception("cargo build failed")
}
}
}

Expand All @@ -112,7 +116,7 @@ archs.forEach { arch ->
}

task("copy-utilities-$arch", type = Copy::class) {
arrayOf("logrotate").forEach { utility ->
arrayOf("logrotate", "uplink_watchdog").forEach { utility ->
from(root.resolve(root.resolve(Paths.get("utilities", "target", arch, "release", utility))))
}
into(stage.resolve(arch).resolve("bin"))
Expand Down Expand Up @@ -168,3 +172,8 @@ tasks.create("buildArtifacts") {
}
dependsOn("copy-lib")
}

fun<T> trace(value: T) : T {
println(value)
return value
}
2 changes: 1 addition & 1 deletion module_template/bin/daemonize
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/system/bin/sh
nohup "$@" > /dev/null &
nohup "$@" > /dev/null 2>&1 &
4 changes: 2 additions & 2 deletions module_template/etc/uplink.config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ path = "/data/local/uplink/persistence"
max_file_size = 104857600
max_file_count = 3

[ota]
enabled = true
[downloader]
actions = ["update_firmware"]
path = "/data/local/uplink/ota"

[stats]
Expand Down
4 changes: 3 additions & 1 deletion module_template/service.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/system/bin/sh

MODULE_DIR=/data/local/uplinkmodule
MODULE_DIR=$(dirname "$0")
DATA_DIR=/data/local/uplink

pkill -x uplink_watchdog
pkill -x uplink
mkdir -p $DATA_DIR

cd $DATA_DIR|| exit
("$MODULE_DIR"/bin/uplink -a $DATA_DIR/device.json -c "$MODULE_DIR"/etc/uplink.config.toml -v 2>&1 | "$MODULE_DIR"/bin/logrotate --output $DATA_DIR/out.log) &
"$MODULE_DIR"/bin/uplink_watchdog >> $DATA_DIR/restart.log 2>&1
Loading

0 comments on commit f46e8ca

Please sign in to comment.