################################################################################
#      This file is part of OpenELEC - http://www.openelec.tv
#      Copyright (C) 2009-2015 Stephan Raue (stephan@openelec.tv)
#
#  OpenELEC is free software: you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation, either version 2 of the License, or
#  (at your option) any later version.
#
#  OpenELEC is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with OpenELEC.  If not, see <http://www.gnu.org/licenses/>.
################################################################################

# $ cat /sys/devices/soc0/machine
# Freescale i.MX6 Quad SABRE Smart Device Board
# $ cat /sys/devices/soc0/machine
# TBS Matrix
# $ cat /sys/devices/soc0/family
# Freescale i.MX
# $ cat /sys/devices/soc0/soc_id
# i.MX6Q
# $ cat /sys/devices/soc0/revision
# 1.2

SYSTEM_TYPE=$(cat /sys/bus/soc/devices/soc0/machine)
case "$SYSTEM_TYPE" in
  "TBS Matrix")
    export SYSTEM_TYPE="matrix"
    ;;
  "SolidRun Cubox-i Dual/Quad")
    export SYSTEM_TYPE="cuboxi"
    ;;
  "Udoo i.MX6 Dual-lite Board"|"Udoo i.MX6 Quad Board")
    export SYSTEM_TYPE="udoo"
    ;;
  *)
    export SYSTEM_TYPE="undef"
    ;;
esac
