CI: add release workflow

This commit is contained in:
Will Greenberg
2024-05-22 10:41:26 -07:00
parent 67cb1bfb98
commit b5cd3d3911
8 changed files with 153 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
# cat config.toml
qmdl_store_path = "/data/rayhunter/qmdl"
port = 8080
readonly_mode = false
+61
View File
@@ -0,0 +1,61 @@
#!/bin/env bash
install() {
if [[ -z "${SERIAL_PATH}" ]]; then
echo "SERIAL_PATH not set, did you run this from install-linux.sh or install-mac.sh?"
exit 1
fi
check_adb
force_debug_mode
setup_rootshell
setup_rayhunter
}
check_adb() {
if ! command -v adb &> /dev/null
then
echo "adb not found, please ensure it's installed or check the README.md"
exit 1
fi
}
force_debug_mode() {
# Force a switch into the debug mode to enable ADB
$(SERIAL_PATH) AT
echo -n "adb enabled, waiting for reboot"
until adb shell true 2> /dev/null
do
echo -n .
sleep 1
done
echo
echo "it's alive!"
}
setup_rootshell() {
_adb_push rootshell /tmp/
$(SERIAL_PATH) "AT+SYSCMD=mv /tmp/rootshell /bin/rootshell"
sleep 1
$(SERIAL_PATH) "AT+SYSCMD=chown root /bin/rootshell"
sleep 1
$(SERIAL_PATH) "AT+SYSCMD=chmod 4755 /bin/rootshell"
echo "we have root!"
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 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"'
adb shell '/bin/rootshell -c "chmod 755 /etc/init.d/misc-daemon"'
adb shell '/bin/rootshell -c "/etc/init.d/rayhunter_daemon start"'
}
+6
View File
@@ -0,0 +1,6 @@
#!/bin/env bash
set -e
export SERIAL_PATH="./serial-ubuntu-latest/serial"
. "$(dirname "$0")"/install-common.sh
install
+6
View File
@@ -0,0 +1,6 @@
#!/bin/env bash
set -e
export SERIAL_PATH="./serial-mac-latest/serial"
. "$(dirname "$0")"/install-common.sh
install
+1
View File
@@ -0,0 +1 @@
ECHO TODO
+102
View File
@@ -0,0 +1,102 @@
#!/bin/sh
set -e
case "$1" in
start)
echo -n "Starting miscellaneous daemons: "
search_dir="/sys/bus/msm_subsys/devices/"
for entry in `ls $search_dir`
do
subsys_temp=`cat $search_dir/$entry/name`
if [ "$subsys_temp" == "modem" ]
then
break
fi
done
counter=0
while [ ${counter} -le 10 ]
do
msstate=`cat $search_dir/$entry/state`
if [ "$msstate" == "ONLINE" ]
then
break
fi
counter=$(( $counter + 1 ))
sleep 1
done
if [ -f /etc/init.d/init_qcom_audio ]
then
/etc/init.d/init_qcom_audio start
fi
if [ -f /sbin/reboot-daemon ]
then
/sbin/reboot-daemon &
fi
if [ -f /etc/init.d/start_atfwd_daemon ]
then
/etc/init.d/start_atfwd_daemon start
fi
if [ -f /etc/init.d/rayhunter_daemon ]
then
/etc/init.d/rayhunter_daemon start
fi
if [ -f /etc/init.d/start_stop_qti_ppp_le ]
then
/etc/init.d/start_stop_qti_ppp_le start
fi
if [ -f /etc/init.d/start_loc_launcher ]
then
/etc/init.d/start_loc_launcher start
fi
echo -n "Completed starting miscellaneous daemons"
;;
stop)
echo -n "Stopping miscellaneous daemons: "
if [ -f /etc/init.d/start_atfwd_daemon ]
then
/etc/init.d/start_atfwd_daemon stop
fi
if [ -f /etc/init.d/start_loc_launcher ]
then
/etc/init.d/start_loc_launcher stop
fi
if [ -f /etc/init.d/rayhunter_daemon ]
then
/etc/init.d/rayhunter_daemon stop
fi
if [ -f /etc/init.d/init_qcom_audio ]
then
/etc/init.d/init_qcom_audio stop
fi
if [ -f /etc/init.d/start_stop_qti_ppp_le ]
then
/etc/init.d/start_stop_qti_ppp_le stop
fi
echo -n "Completed stopping miscellaneous daemons"
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage misc-daemon { start | stop | restart}" >&2
exit 1
;;
esac
exit 0
+27
View File
@@ -0,0 +1,27 @@
#! /bin/bash
set -e
case "$1" in
start)
echo -n "Starting rayhunter: "
start-stop-daemon -S -b --make-pidfile --pidfile /tmp/rayhunter.pid \
--startas /bin/bash -- -c "exec /data/rayhunter/rayhunter-daemon /data/rayhunter/config.toml > /data/rayhunter/rayhunter.log 2>&1"
echo "done"
;;
stop)
echo -n "Stopping rayhunter: "
start-stop-daemon -K -p /tmp/rayhunter.pid
echo "done"
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage rayhunter_daemon { start | stop | restart }" >&2
exit 1
;;
esac
exit 0