diff --git a/recipes-support/oc2g-sysdev-remap/files/oc2g-sysdev-remap b/recipes-support/oc2g-sysdev-remap/files/oc2g-sysdev-remap new file mode 100644 index 0000000..b5ad651 --- /dev/null +++ b/recipes-support/oc2g-sysdev-remap/files/oc2g-sysdev-remap @@ -0,0 +1,393 @@ +#!/bin/sh +# This script performs symbolic linking all available system devices +# related to OC-2G platform to a easy to reach location in filesystem +# +# Author: Minh-Quang Nguyen +# +# Licensed under terms of BSD + +VERSION="0.2" +CWD=`pwd` +VERBOSE='' +__USESYSLOG=1 + +# Temp sensors coming from hwmon +declare -a TEMP_DEV_MAP=( + '/var/oc2g/temp/main-supply/x' + '/var/oc2g/temp/pa0/x' + '/var/oc2g/temp/tx0/x' + '/var/oc2g/temp/rmsdet/x' + '/var/oc2g/temp/ocxo/x' + '/var/oc2g/temp/fpga/x' +) + +# Temp sensors coming from thermal zones +declare -a TEMPTH_DEV_MAP=( + '/var/oc2g/temp/dsp/x' + '/var/oc2g/temp/cpu/x' + '/var/oc2g/temp/core/x' + '/var/oc2g/temp/iva/x' + '/var/oc2g/temp/gpu/x' +) + +declare -a OCXO_DAC_DEV_MAP=( + '/var/oc2g/ocxo/x' +) + +declare -a PA_STATE_DEV_MAP=( + '/var/oc2g/pa-state/pa0/x' +) + +declare -a ETH_DEV_MAP=( + '/var/oc2g/net/eth0/x' +) + +declare -a PWR_SENSING_DEV_MAP=( + '/var/oc2g/pwr-sense/main-supply/x' + '/var/oc2g/pwr-sense/pa0/x' +) + +declare -a FPGA_SENSING_DEV_MAP=( + '/var/oc2g/pwr-sense/fpga/x' +) + +declare -a RF_SENSING_DEV_MAP=( + '/var/oc2g/rf-sense/fwd/x' + '/var/oc2g/rf-sense/refl/x' +) + +declare -a LED_DEV_MAP=( + '/var/oc2g/leds/led0/x' + '/var/oc2g/leds/led1/x' +) + +declare -a OPT_DEV_MAP=( + '/var/oc2g/platform/x' +) + +declare -a CLKERR_DEV_MAP=( + '/var/oc2g/clkerr/x' +) + +declare -a VSWR_DEV_MAP=( + '/var/oc2g/vswr/tx0/x' +) + +function log_write() +{ + if [ ${__USESYSLOG} -eq 0 ]; then + echo "$*" + else + logger -p local4.info "$*" + fi +} + +function execute() +{ + $* > /dev/null + if [ $? -ne 0 ]; then + echo "ERROR: executing $*" + if [ ${__USESYSLOG} -ne 0 ]; then + logger -p local4.info "ERROR: $*" + fi + fi +} + +function version() +{ + echo + echo "`basename $1` version ${VERSION}" + echo "Script to create symbolic links of available sensors for OC-2G platform" + echo + exit 0 +} + +function usage() +{ +cat <