#==============================================================
#
#  Abs:  Startup Script for Shared Platform (dev)
#
#  Name: st.cmd
#
#  Desc: The processor is an Advantech 1U server,
#        SKY-8100 industrial pc/server.
#
#  Facility:  EED Shared Platform
#
#  Auth: dd-mmm-yyyy, Author's Name   (USERNAME)
#  Rev:  dd-mmm-yyyy, Reviewer's Name (USERNAME)
#--------------------------------------------------------------
#  Mod:
#        11-Jun-2020, K. Luchini      (LUCHINI):
#         extracted from $EPICS_IOCS/cpu-b84-sp12/kernel-modules.cmd
#         and renamed to st.cmd
#
#==============================================================

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

# =========================================
# Network configuration
# =========================================
# ATCA carrier board has IP address 10.0.1.10X so let's use 10.0.1.1 on out local NIC
ifconfig eth5 10.0.1.1 netmask 255.255.255.0 up

# ATCA carrier board has IP address 10.0.2.10X so let's use 10.0.2.1 on out local NIC
ifconfig eth6 10.0.2.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
for PID in  $(ps -elF | grep eth6 | grep -v grep | awk '{print $4}'); do chrt -f -p 84 $PID ; done

# =========================================
# Start DHCP server on eth0
# =========================================
DHCPD_IF=eth0
/sbin/ifconfig $DHCPD_IF 192.168.1.1 netmask 255.255.255.0 up
. dhcpdStartup.sh $DHCPD_IF

# End of script'


