From e50d7bdf596e3a2a10f5631c718bbe7ff3e8e526 Mon Sep 17 00:00:00 2001 From: Will Greenberg Date: Wed, 22 May 2024 13:09:58 -0700 Subject: [PATCH] wip --- .github/workflows/build-release.yml | 7 ++++--- config.toml.example => dist/config.toml.example | 0 dist/install-common.sh | 13 +++++++++---- 3 files changed, 13 insertions(+), 7 deletions(-) rename config.toml.example => dist/config.toml.example (100%) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 57e1210..ba294b6 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -62,14 +62,15 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/download-artifact@v4 - with: - path: dist - - name: Archive release + - name: Setup release directory + run: mv rayhunter-daemon/rayhunter-daemon rootshell/rootshell serial-* dist + - name: Archive release directory uses: thedoctor0/zip-release@0.7.5 with: type: 'zip' filename: 'release.zip' directory: 'dist' + # TODO: have this create a release directly - name: Upload release uses: actions/upload-artifact@v4 with: diff --git a/config.toml.example b/dist/config.toml.example similarity index 100% rename from config.toml.example rename to dist/config.toml.example diff --git a/dist/install-common.sh b/dist/install-common.sh index 7e7fc32..a02b30d 100644 --- a/dist/install-common.sh +++ b/dist/install-common.sh @@ -33,7 +33,7 @@ force_debug_mode() { } setup_rootshell() { - adb push target/armv7-unknown-linux-gnueabihf/release/rootshell /tmp/ + _adb_push rootshell /tmp/ $(SERIAL_PATH) "AT+SYSCMD=mv /tmp/rootshell /bin/rootshell" sleep 1 $(SERIAL_PATH) "AT+SYSCMD=chown root /bin/rootshell" @@ -43,11 +43,16 @@ setup_rootshell() { adb shell /bin/rootshell -c id } +_adb_push() { + adb push "$(dirname "$0")/$1" "$2" +} + setup_rayhunter() { adb shell '/bin/rootshell -c "mkdir /data/rayhunter"' - adb push config.toml.example /data/rayhunter/config.toml - adb push scripts/rayhunter_daemon /tmp/rayhunter_daemon - adb push scripts/misc-daemon /tmp/misc-daemon + _adb_push config.toml.example /data/rayhunter/config.toml + _adb_push rayhunter-daemon /data/rayhunter/ + _adb_push scripts/rayhunter_daemon /tmp/rayhunter_daemon + _adb_push scripts/misc-daemon /tmp/misc-daemon adb shell '/bin/rootshell -c "mv /tmp/rayhunter_daemon /etc/init.d/rayhunter_daemon"' adb shell '/bin/rootshell -c "mv /tmp/misc-daemon /etc/init.d/misc-daemon"' adb shell '/bin/rootshell -c "chmod 755 /etc/init.d/rayhunter_daemon"'