take dust off from gdb
This commit is contained in:
69
san
69
san
@@ -3,7 +3,7 @@ set -o vi
|
||||
# set -x
|
||||
|
||||
if [ -z $SAN_SERVER_IP ]; then
|
||||
SAN_SERVER_IP=10.23.135.17
|
||||
SAN_SERVER_IP=192.168.0.64
|
||||
fi
|
||||
|
||||
DESCR=""
|
||||
@@ -11,6 +11,10 @@ descr(){
|
||||
# echo "$1"
|
||||
DESCR="$DESCR\n$1"
|
||||
}
|
||||
header(){
|
||||
descr ""
|
||||
descr " * $1"
|
||||
}
|
||||
|
||||
descr "Available Commands:"
|
||||
descr " san_help - print this help."
|
||||
@@ -166,33 +170,32 @@ rokuflash()
|
||||
# Ddd to the start of the script
|
||||
# export APP_GDBSERVER="/nvram/tools/gdbserver :5555"ebug Server
|
||||
#
|
||||
descr ""
|
||||
descr " GDB"
|
||||
descr " setup_gdb - "
|
||||
setup_gdb()
|
||||
{
|
||||
#copy tools to /nvram folder for example:
|
||||
cp -rL /tmp/tools /nvram/
|
||||
header "GDB"
|
||||
#descr " setup_gdb [seconds|app|zipmountserver|apibroker|apitrace]"
|
||||
#setup_gdb()
|
||||
#{
|
||||
# #copy tools to /nvram folder for example:
|
||||
# cp -rL /tmp/tools /nvram/
|
||||
|
||||
#remount nvram with executable flag executable
|
||||
# mount /nvram -o remount,exec
|
||||
# #remount nvram with executable flag executable
|
||||
# # mount /nvram -o remount,exec
|
||||
|
||||
#make nvram to preserve the exec flag after reboot:
|
||||
# kdir /nvram/debug_overlay
|
||||
|
||||
# Create debug script, where we copy gdb back to tmp and run it from there.
|
||||
# This is to allow fastboot to umount /nvram
|
||||
cat > /nvram/launch_gdb.sh << EOF
|
||||
#!/bin/sh
|
||||
#export APIB_GDBSERVER="/tmp/tools2/strace -f"
|
||||
EOF
|
||||
}
|
||||
# #make nvram to preserve the exec flag after reboot:
|
||||
# # kdir /nvram/debug_overlay
|
||||
|
||||
# # Create debug script, where we copy gdb back to tmp and run it from there.
|
||||
# # This is to allow fastboot to umount /nvram
|
||||
##cat > /nvram/launch_gdb.sh << EOF
|
||||
###!/bin/sh
|
||||
###export APIB_GDBSERVER="/tmp/tools2/strace -f"
|
||||
##EOF
|
||||
#}
|
||||
|
||||
descr " launch_gdb [seconds|app|zipmountserver|apibroker|apitrace]"
|
||||
launch_gdb()
|
||||
{
|
||||
cp -r /nvram/tools /tmp/tools2
|
||||
export appargs="-nowd"
|
||||
local delay=0
|
||||
|
||||
if [ "$1" == "" ]; then
|
||||
delay = 5
|
||||
@@ -213,13 +216,19 @@ launch_gdb()
|
||||
fi
|
||||
}
|
||||
|
||||
descr " enable_gdb - "
|
||||
descr " enable_gdb [seconds|app|zipmountserver|apibroker|apitrace]"
|
||||
enable_gdb()
|
||||
{
|
||||
grep launch_gdb /nvram/autostart > /dev/null
|
||||
if [ $? != 0 ]; then
|
||||
echo "launch_gdb 5" >> /nvram/autostart
|
||||
fi
|
||||
[ ! -f /nvram/tools/gdbserver ] && cp -rL /tmp/tools /nvram/
|
||||
|
||||
[ -f /nvram/autostart ] && cat /nvram/autostart | sed '/launch_gdb/d' > /tmp/autostart
|
||||
|
||||
local cmd="app"
|
||||
[ "$1" != "" ] && cmd=$1
|
||||
|
||||
echo "launch_gdb $cmd" >> /tmp/autostart
|
||||
rm /nvram/autostart
|
||||
mv /tmp/autostart /nvram/
|
||||
}
|
||||
|
||||
descr " disable_gdb - "
|
||||
@@ -234,6 +243,7 @@ disable_gdb()
|
||||
#
|
||||
# Log
|
||||
#
|
||||
header "LOG"
|
||||
LOG_CONF="/nvram/logapi.conf"
|
||||
descr " log_reset - reset log configuration"
|
||||
log_reset()
|
||||
@@ -259,6 +269,7 @@ log_seconds()
|
||||
#
|
||||
# Config
|
||||
#
|
||||
header "Config"
|
||||
descr " config_reset - erase configuration"
|
||||
config_reset()
|
||||
{
|
||||
@@ -293,8 +304,7 @@ disable_failsafe()
|
||||
# Fastboot related
|
||||
#
|
||||
|
||||
descr ""
|
||||
descr " FastBoot"
|
||||
header "FastBoot"
|
||||
descr " enable_fastboot - "
|
||||
enable_fastboot()
|
||||
{
|
||||
@@ -334,8 +344,7 @@ fastboot_reset()
|
||||
#
|
||||
# Wifi Setup
|
||||
#
|
||||
descr ""
|
||||
descr " WiFi"
|
||||
header "WiFi"
|
||||
IFACE=wlan0
|
||||
wpa()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user