Skip to content

Commit

Permalink
Add Ayn Odin 2 Support
Browse files Browse the repository at this point in the history
  • Loading branch information
FantasyGmm committed Feb 4, 2025
1 parent 3568e74 commit 8c6e7ae
Show file tree
Hide file tree
Showing 42 changed files with 1,831 additions and 100 deletions.
72 changes: 72 additions & 0 deletions board/batocera/qualcomm/sm8550/fsoverlay/etc/init.d/S05user
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/sh
#

start_services()
{
#QIPCRTR Name Service - dependency of following services
printf "Starting QIPCRTR Name Service: "
start-stop-daemon -S -b -m -p /var/run/qrtr-ns.pid --exec /usr/bin/qrtr-ns -- -f 1
if [ $? != 0 ]; then
echo "Starting QIPCRTR Name Service: FAILED"
exit 1
else
echo "OK"
fi
#Qualcomm PD mapper service
printf "Starting Qualcomm PD mapper service: "
start-stop-daemon -S -b -m -p /var/run/pd-mapper.pid --exec /usr/bin/pd-mapper
if [ $? != 0 ]; then
echo "Starting Qualcomm PD mapper service: FAILED"
exit 1
else
echo "OK"
fi
#QRTR TFTP service
printf "Starting QRTR TFTP service: "
start-stop-daemon -S -b -m -p /var/run/tqftpserv.pid --exec /usr/bin/tqftpserv
if [ $? != 0 ]; then
echo "Starting QRTR TFTP service: FAILED"
exit 1
else
echo "OK"
fi
#Qualcomm remotefs service
printf "Starting Qualcomm remotefs service: "
start-stop-daemon -S -b -m -p /var/run/rmtfs.pid --exec /usr/bin/rmtfs -- -r -P -s
if [ $? != 0 ]; then
echo "Starting Qualcomm remotefs service: FAILED"
exit 1
else
echo "OK"
fi
}

stop_services()
{
printf "Stopping QIPCRTR Name Service: "
start-stop-daemon -K -q -p /var/run/qrtr-ns.pid
killall qrtr-ns
start-stop-daemon -K -q -p /var/run/pd-mapper.pid
killall pd-mapper
start-stop-daemon -K -q -p /var/run/tqftpserv.pid
killall tqftpserv
start-stop-daemon -K -q -p /var/run/rmtfs.pid
killall rmtfs
echo "OK"
}

case "$1" in
start)
start_services
;;
stop)
stop_services
;;
restart|reload)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
15 changes: 15 additions & 0 deletions board/batocera/qualcomm/sm8550/fsoverlay/etc/init.d/S50btaddr
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

if test "$1" != "start"
then
exit 0
fi

printf "Set Bluetooth Address to MAC: "

mac="$(echo $(cat /userdata/system/machine-id; echo bluetooth)| sha256sum -)"
bt_mac=$(echo "42:${mac:0:2}:${mac:4:2}:${mac:8:2}:${mac:12:2}:${mac:16:2}")
echo $bt_mac
/usr/bin/bluetoothctl mgmt.public-addr $bt_mac

echo " OK"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SUBSYSTEM=="input", ATTRS{name}=="Ayn Odin2 Gamepad", MODE="0666", ENV{ID_INPUT_MOUSE}="0", ENV{ID_INPUT_JOYSTICK}="1"
Loading

0 comments on commit 8c6e7ae

Please sign in to comment.