#==============================================================
#
#  Abs:  Startup Script for cpu-b34-sp02 LLRF ATCA Test-Stand
#
#  Name: st.cmd
#
#  Desc: The processor is an Advantech 1U server,
#        SKY-8100 S industrial pc/server.
#
#  Facility: EED Klystron Controls
#
#  Auth: 18-Jun-2020, Kukhee Kim      (KHKIM)
#  Rev:  dd-mmm-yyyy, Reviewer's Name (USERNAME)
#--------------------------------------------------------------
#  Mod:
#        19-Aug-2020, Ernest Williams (ERNESTO)
#         extract from test-stand kernel-module.cmd
#
#=============================================================

# Turn on local IPMI Client support
echo "Load IPMI..."
sleep 10
modprobe ipmi_devintf
ipmitool lan print

# Ethernet configuraiton
# Self Manager Crate ID:0001, Branch=0, ID=1, eth5
ifconfig eth5 10.0.1.1 netmask 255.255.255.0 up

# ==================================================================
# escalating RT priority for network kernel threads (SCHED_FIFO, 84)
# =================================================================
for PID in  $(ps -elF | grep eth5 | grep -v grep | awk '{print $4}'); do chrt -f -p 84 $PID ; done

# ======================================
# increasing receive buffer size to 10MB
# ======================================
sysctl -w net.core.rmem_default=10485760

# wait a bit to device become visible
sleep 2

# End of script'


