Skip to content

Commit

Permalink
Add debug script to help run the server from the command line
Browse files Browse the repository at this point in the history
Addresses issue #51
  • Loading branch information
Araneidae authored and EmilioPeJu committed Mar 6, 2024
1 parent e5a5dab commit 7fa5e30
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
52 changes: 52 additions & 0 deletions etc/debug-panda-server
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/sh

# Script for running panda_server from the command line
# Takes optional argument to determine which version of the server to run


panda_server=/opt/bin/panda_server
panda_config=/opt/share/panda-fpga/config_d
panda_module=/opt/share/panda-server/panda.ko
panda_state=/opt/state/panda.state
panda_mac=/qspi/MAC.FPGA

extension_server=/opt/share/panda-server/extension_server
extension_dir=/opt/share/panda-fpga/extensions


error()
{
echo >&2 "$@"
exit 1
}


debug_server="${1:-$panda_server}"


# Ensure the kernel module is loaded
[ -e /dev/panda.map ] || insmod $panda_module ||
error "Unable to install kernel module"


# Set the MAC addresses if the file is present
panda_server_mac=""
if [ -e $panda_mac ]; then
panda_server_mac="-M $panda_mac"
fi


# Ensure there isn't a dangling instance of the extension server
nc localhost 9999 </dev/null

# Now start the extension server
$extension_server -d -s $extension_dir &&

# Finally start the PANDA server
$debug_server \
-c $panda_config -f $panda_state -R -X 9999 \
-r "$(head -n1 /etc/version)" \
$panda_server_mac

# Make sure we don't leave a dangling instance of the extension server
nc localhost 9999 </dev/null
1 change: 1 addition & 0 deletions etc/panda-server.list
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ b bin/panda_server server/server
b bin/slow_load server/slow_load
b share/panda-server driver/panda.ko
t share/panda-server python/extension_server
t bin/debug-panda-server etc/debug-panda-server

# Install and configure the startup scripts
t etc/init.d etc/panda-server
Expand Down

0 comments on commit 7fa5e30

Please sign in to comment.